Applying Filter to Signal

29 views Asked by At

I want to use the built in gammatone filterbank and run a signal through it. I then want to take that output and get the impulse response which should decay over time. But I am running into issues. I think the output_signal line is the issue but I don't know what to use instead. Thank you for your time! (This is Matlab)

fs = 16e3;
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);
impulse_response = impulse(output_signal);

The fvtool displays the correct thing! But the input signal is not going through this parallel filterbank at all. I keep getting errors. I tried doing:

figure;
hold on;
for i = 1:size(filtered_output, 2)
    % Generate an impulse signal
    impulse = zeros(1, num_points);
    impulse(1) = 1;
    
    % Apply the filter bank to the impulse signal
    impulse_response = gammaFiltBank(impulse);
    
    % Plot impulse response
    plot(filtered_output_time, squeeze(impulse_response(1, i, :)), 'LineWidth', 1.5);
end

` But this was wrong as I didn't get the impulse response to decay over time, so I think this whole segment is wrong which is why I removed it from the above part.

0

There are 0 answers