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.
