Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Martin Karlsson
turtlerob1
Commits
2fe2987d
Commit
2fe2987d
authored
Sep 24, 2015
by
Fredrik Bagge Carlsson
Browse files
clean up
parent
f255763a
Changes
1
Hide whitespace changes
Inline
Side-by-side
track_audio.m
View file @
2fe2987d
...
...
@@ -15,13 +15,6 @@ simParams.fHighHz = 8000; % Upper center frequency of the gammatone
simParams
.
nChannels
=
32
;
% Number of filterbank channels
simParams
.
frameSize
=
50E-3
;
% Frame size in seconds
% Optional noise types
% Choose between 'none', 'busystreet', 'restaurant', 'supermarket' and
% 'tubestation'
noiseType
=
'tubestation'
;
% Signal to noise ratio in dB
snr
=
0
;
%% Model parameters
...
...
@@ -46,11 +39,9 @@ addpath('./tools');
addpath
(
'./ekfukf-toolbox'
);
%% Simulation
figure
(
1
)
signal
=
...
signal
=
...
% get signal here
% Get signal length and number of frames
nSamples
=
size
(
signal
,
1
);
nFrames
=
floor
(
nSamples
/
(
simParams
.
frameSize
*
fsHz
));
...
...
@@ -66,14 +57,20 @@ azimuthDistribution = ...
squeeze
(
dataObj
.
azimuthDistribution
{
1
}
.
Data
(:));
% Use -90 to align coordinate system
measuredLocations
=
argmax
(
azimuthDistribution
,
2
)
-
90
;
N
=
length
(
measuredLocations
);
% Initialize posterior mean and covariance
posteriorMean
=
zeros
(
size
(
A
,
1
),
length
(
measuredLocations
));
posteriorCovariance
=
zeros
(
size
(
A
,
1
),
size
(
A
,
1
),
...
length
(
measuredLocations
));
posteriorMean
=
zeros
(
size
(
A
,
1
),
N
);
posteriorCovariance
=
zeros
(
size
(
A
,
1
),
size
(
A
,
1
),
N
);
% Perform localization and tracking
for
l
=
1
:
length
(
measuredLocations
)
for
l
=
1
:
N
% ===================================================
% Perform steps to get measurements inside this loop!
% ===================================================
% Perform Kalman filter prediction and update
[
x
,
P
]
=
kf_predict
(
x
,
P
,
A
,
Q
);
[
x
,
P
]
=
kf_update
(
x
,
P
,
measuredLocations
(
l
),
c
'
,
R
);
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment