diff --git a/track_audio.m b/track_audio.m index 7b77e66f7c373da3a5a12303a143a07a3d55055d..7d8a3e734f7fcdf99b8e849bfdd41dd01a707acc 100644 --- a/track_audio.m +++ b/track_audio.m @@ -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);