q>> mf=ginput(50) % pick 50 points: the first column
of mf is the frequency points and the second column of mf is the corresponding magnitude responses.
•>>magg=vpck(mf(:2),mf(:,1)); % pack them as a varying
matrix.
•>> Wa=fitmag(magg); % choose the order of Wa online.
A third-order Wa is
sufficient for this example.
•>> [A,B,C,D]=unpck(Wa ) %converting into
state-space.
•>> [Z,P,K]=ss2zp(A,B,C,D) % converting into
zero/pole/gain form.