Split a system to 2 second-order section: weird phase result.

I am trying to split a system with transfer function H(z)=0.0976(z-1)^2*(z+1)^2/((z-0.3575-0.5889i)*(z-0.3575+0.5889i)*(z-0.7686-0.3338i)(z-0.7686+0.3338i)) to 2 second order section. My codes are as below:
clearvars;
b0=0.0976;
b1=[1 -1];
b2=[1 1];
a1=[1 -0.3575-0.5889i];
a2=conj(a1);
a3=[1 -0.7686-0.3338i];
a4=conj(a3);
b=b0.*conv(conv(b1,b1),conv(b2,b2));
a=conv(conv(a1,a2),conv(a3,a4));
[r,p,k]=residuez(b,a)
zplane(b,a)
freqz(b,a)
sos=zp2sos(r,p,k);
freqz(sos(1,1:3),sos(1,4:6))
freqz(sos(2,1:3),sos(2,4:6))
My question is about the graphic of frequency response. The phase of 2 subsystems do not add up to the original system. For example, when frequency is near 1 (angular frequency pi), the the phase of two sub-systems both go to zero but the original system go to about -180 degree (-pi.) Do sum of the phase response of the sub-systems should be the same as the pashe response of original system? May you so kind to help he with this puzzle?
The frequency response of original system
The frequency response of subsystem 1:
The frequency response of subsystem 2:

Answers (1)

The issue here is incorrect use of @doc:residuez and/or @doc:zp2sos
b0=0.0976;
b1=[1 -1];
b2=[1 1];
a1=[1 -0.3575-0.5889i];
a2=conj(a1);
a3=[1 -0.7686-0.3338i];
a4=conj(a3);
b=b0.*conv(conv(b1,b1),conv(b2,b2));
a=conv(conv(a1,a2),conv(a3,a4));
[r,p,k]=residuez(b,a);
%zplane(b,a)
freqz(b,a)
Here, r is the vector of residues that correspond to each pole. r does not contain the zeros of the transfer function. And k is not the gain of the transfer function.
%sos=zp2sos(r,p,k)
From the transfer function, use @doc:tf2sos to form the second order sections.
sos=tf2sos(b,a);
freqz(sos(1,1:3),sos(1,4:6))
freqz(sos(2,1:3),sos(2,4:6))
b1, b2, a1-a4 were all essentially defined in terms of zeros and poles from the outset, so there really wasn't a need to form them explicitly and @doc:zp2sos could have been used directly with those poles and zeros and the value of b0.

Asked:

on 20 Jun 2017

Answered:

on 25 Nov 2026 at 17:51

Community Treasure Hunt

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

Start Hunting!