FIR and IIR Comb FIlter
16 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Cian O'Farrell
el 29 de Ag. de 2020
Respondida: Star Strider
el 29 de Ag. de 2020
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?
0 comentarios
Respuesta aceptada
Star Strider
el 29 de Ag. de 2020
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 comentarios
Más respuestas (0)
Ver también
Categorías
Más información sobre Digital Filter Design en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!