Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
T
turtlerob1
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Redmine
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Martin Karlsson
turtlerob1
Commits
b2766084
Commit
b2766084
authored
9 years ago
by
Fredrik Bagge Carlsson
Browse files
Options
Downloads
Patches
Plain Diff
mhm
parent
334fe5ab
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
track_audio.m
+39
-29
39 additions, 29 deletions
track_audio.m
with
39 additions
and
29 deletions
track_audio.m
+
39
−
29
View file @
b2766084
...
@@ -5,30 +5,42 @@ clc;
...
@@ -5,30 +5,42 @@ clc;
% To be modified
% To be modified
%% Request interaural time differences (ITDs)
% % % % % %% Request interaural time differences (ITDs)
requests
=
{
'itd'
};
% % % % % requests = {'itd'};
% % % % %
% Parameters of the auditory filterbank processor
% % % % % % Parameters of the auditory filterbank processor
fb_type
=
'gammatone'
;
% % % % % fb_type = 'gammatone';
fb_lowFreqHz
=
80
;
% % % % % fb_lowFreqHz = 80;
fb_highFreqHz
=
8000
;
% % % % % fb_highFreqHz = 8000;
fb_nChannels
=
32
;
% % % % % fb_nChannels = 32;
% % % % %
% Parameters of innerhaircell processor
% % % % % % Parameters of innerhaircell processor
ihc_method
=
'dau'
;
% % % % % ihc_method = 'dau';
% % % % %
% Parameters of crosscorrelation processor
% % % % % % Parameters of crosscorrelation processor
cc_wSizeSec
=
0.02
;
% % % % % cc_wSizeSec = 0.02;
cc_hSizeSec
=
0.01
;
% % % % % cc_hSizeSec = 0.01;
cc_wname
=
'hann'
;
% % % % % cc_wname = 'hann';
% % % % %
% Summary of parameters
% % % % % % Summary of parameters
par
=
genParStruct
(
'fb_type'
,
fb_type
,
'fb_lowFreqHz'
,
fb_lowFreqHz
,
...
% % % % % par = genParStruct('fb_type',fb_type,'fb_lowFreqHz',fb_lowFreqHz,...
'fb_highFreqHz'
,
fb_highFreqHz
,
'fb_nChannels'
,
fb_nChannels
,
...
% % % % % 'fb_highFreqHz',fb_highFreqHz,'fb_nChannels',fb_nChannels,...
'ihc_method'
,
ihc_method
,
'cc_wSizeSec'
,
cc_wSizeSec
,
...
% % % % % 'ihc_method',ihc_method,'cc_wSizeSec',cc_wSizeSec,...
'cc_hSizeSec'
,
cc_hSizeSec
,
'cc_wname'
,
cc_wname
);
% % % % % 'cc_hSizeSec',cc_hSizeSec,'cc_wname',cc_wname);
%% Setup objects
% Initialize localization models using braodband and subband settings
dObj
=
dataObject
([],
fsHz
,
10
,
2
);
% Settings for subband approach
par_sub
=
genParStruct
(
'cc_bBroadband'
,
0
,
'cc_wSizeSec'
,
winSec
,
...
'cc_hSizeSec'
,
winSec
/
2
,
'cc_maxDelaySec'
,
1.25e-3
,
...
'fb_lowFreqHz'
,
fLowHz
,
'fb_highFreqHz'
,
fHighHz
,
...
'fb_nERBs'
,
1
,
'ihc_method'
,
'none'
,
...
'loc_NSources'
,
nSpeakers
(
hh
));
% Initialize localization models using braodband and subband settings
mObj
=
manager
(
dObj
,
'localization'
,
par_sub
);
%% Model parameters
%% Model parameters
...
@@ -84,15 +96,13 @@ posteriorCovariance = zeros(size(A, 1), size(A, 1), N);
...
@@ -84,15 +96,13 @@ posteriorCovariance = zeros(size(A, 1), size(A, 1), N);
% =======================================================
% =======================================================
for
l
=
1
:
N
for
l
=
1
:
N
audio
=
get_audio
();
audio
=
get_audio
();
dObj
=
dataObject
(
audio
,
fsHz
);
% TODO: Put the audio in the data object!
% Create a manager
mObj
=
manager
(
dObj
,
requests
,
par
);
% Request processing
% Request processing
mObj
.
processSignal
();
mObj
.
processSignal
();
y
=
get_measurement
(
dObj
);
azimEst
=
dObj_sub
.
localization
{
1
}
.
Data
(
end
);
% Perform Kalman filter prediction and update
% Perform Kalman filter prediction and update
[
x
,
P
]
=
kf_predict
(
x
,
P
,
A
,
Q
);
[
x
,
P
]
=
kf_predict
(
x
,
P
,
A
,
Q
);
[
x
,
P
]
=
kf_update
(
x
,
P
,
y
,
c
'
,
R
);
[
x
,
P
]
=
kf_update
(
x
,
P
,
azimEst
,
c
'
,
R
);
posteriorMean
(:,
l
)
=
x
;
posteriorMean
(:,
l
)
=
x
;
posteriorCovariance
(:,
:,
l
)
=
P
;
posteriorCovariance
(:,
:,
l
)
=
P
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment