Impulse Response of a Filter
Show older comments
I am trying to get the impulse response of a filter in a gammatone filterbank. For a filter (in the gammatone filterbank) the impulse response has to decay over time. But I am not getting that and I am unsure what I am doing in coreectly. Thank you for your time!
fs = 16e3;
t = 0:(1/fs):1;
numFilts=32;
range=[50 8000];
gammaFiltBank = gammatoneFilterBank(range,numFilts);
%fvtool(gammaFiltBank)
input_signal = sin(2*pi*100*t) + sin(2*pi*300*t);
%output_signal = gammatoneFilterBank(gammaFiltBank, input_signal);
output_signal = gammaFiltBank(input_signal);
output_signal = squeeze(output_signal);
%Display a Filter's Output
figure
filter_number=10;
plot(t,output_signal(filter_number,:)) %10th filter output
title('Output of Filter', num2str(filter_number))
% Impulse signal
impulse_signal = zeros(size(t));
impulse_signal(1) = 1;
%Display a Filter's Output of Impulse
output_signal2=gammaFiltBank(impulse_signal);
output_signal2 = squeeze(output_signal2);
figure
plot(t,output_signal2(10,:)) %10th filter output
title('Impulse Output of Filter', num2str(filter_number))
Accepted Answer
More Answers (0)
Categories
Find more on Audio Processing Algorithm Design in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
