MATLAB: Frequency response of a parallel IIR filter

iir filter

Hello,
I am trying to plot the frequency response of a parallel iir filter composed of two subfilter as follow:
subfilter1: b1= [0.24 0]
a1= [0.4 0]
subfilter2: b2= [0.2 0.25]
a2= [-0.8 -0.5]
thanks.

Best Answer

If they were in series, the transfer functions would be multiplied, and in parallel, added, according to Series and Parallel Transfer Functions.
Try this:
% subfilter1:
b1= [0.24 0];
a1= [0.4 0];
% subfilter2:
b2= [0.2 0.25];
a2= [-0.8 -0.5];
[h1,w] = freqz(b1, a1, 2^16);
[h2,w] = freqz(b2, a2, 2^16);
figure
subplot(2,1,1)
plot(w, mag2db(abs(h1)+abs(h2)), 'LineWidth',1.5)
ylabel('dB')
xlim([0 pi])
grid
subplot(2,1,2)
plot(w, angle(h1+h2), 'LineWidth',1.5)
ylabel('rad')
xlabel('Frequency (rad/time unit)')
xlim([0 pi])
grid
Since the length of the Fourier transforms is the same for both freqz results, only one ‘w’ vector need be used.