FIR and IIR Comb FIlter

10 次查看(过去 30 天)
Hello, I'm trying to build an FIR and IIR comb filter to demonstrate different effects on a wav file, can anyone direct me to useful resources?

采纳的回答

Star Strider
Star Strider 2020-8-29
One example of a FIR comb filter is Vibration Analysis FFT - Cut off frequency
I like IIR filters, because at least in my experience they are computationally more efficient (specific elliptic designs), however it necessary to put them in series in a loop to do the same sort of thing.
One example:
Fs = 44100; % Sampling Frequency
Fn = Fs/2; % Nyquist Frequency
Rp = 1; % Passband Ripple (Attenuation)
Rs = 50; % Stopband Ripple (Attenuation)
pbmtx = [48 51] + (0:50:150).';
for k1 = 1:size(pbmtx,1)
Ws = pbmtx(k1,:)/Fn;
Wp = Ws + [-2 2]/Fn;
[n,Wp] = ellipord(Wp,Ws,Rp,Rs);
[z,p,k] = ellip(n,Rp,Rs,Wp,'stop');
[sos{k1},g(k1)] = zp2sos(z,p,k);
[h(:,k1),f] = freqz(sos{k1},2^14,Fs);
end
figure
hold on
for k = 1:size(pbmtx,1)
plot(f, db(abs(h(:,k))/max(abs(h(:,k))))) % Normalisation For Display Purposes, Since ‘freqz’ Does Not Always Calculate The Magnitudes Correctly
end
axis([min(f) 300 -100 10])
grid
Use filtfilt to do the actual filtering with respect to both of these, once with the FIR filter and in a loop with the IIR filters, with the input of one filter being the output of the filter in the previous iteration.

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Digital Filter Design 的更多信息

标签

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by