MATLAB: How to convert filter coefficients to a system object

filterfirsystem

Hi, I have a question about filter system object. I design a filter using firpm, which gives me a set of coefficients. Now I want to plot the Hankel singular value of this filter. However the "hsvd" function only takes system object as input. So my question is, how to convert FIR filter coefficients into system object? Or, is there a way to design filter easily using firpm which returns a system object?
My codes below here.
f = [0 0.3 0.4 0.6 0.7 1]; %a passband of 0.4-0.6
a = [0 0.0 1.0 1.0 0.0 0];
b = firpm(39,f,a,[30,1,30]);
hsv = hsvd(b)

Best Answer

  • This will create the system object from your filter:
    f = [0 0.3 0.4 0.6 0.7 1]; %a passband of 0.4-0.6
    a = [0 0.0 1.0 1.0 0.0 0];
    b = firpm(39,f,a,[30,1,30]);
    s = tf('s'); % Define Continuous System
    sysobj = tf(b, 1);
    hsv = hsvd(sysobj);
    However it throws this error:
    Error using DynamicSystem/hsvd (line 62)
    The "hsvd" command cannot be used for models with more zeros than poles.
    I will let you sort that.