help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Using sftrans as matlab's lp2lp


From: Mike Miller
Subject: Re: Using sftrans as matlab's lp2lp
Date: Wed, 11 Nov 2015 10:17:40 -0800
User-agent: Mutt/1.5.24 (2015-08-30)

On Tue, Nov 10, 2015 at 19:32:25 -0800, texidor wrote:
> Hi,
> I have been porting some code but I can not have equal results to moving
> lowpass' filter cuting frequency using the sftrans and lp2lp.
> 
> numNorm =
>          0         0         0    1.0000
> denNorm =
>     1.0000    2.0000    2.0000    1.0000
> fc=180
> 
> Matlab code uses:
> [num,den]=lp2lp(numNorm,denNorm,2*pi*fc);
> and returns:
> num =
>    1.4466e+09
> den =
>    1.0e+09 *
>     0.0000    0.0000    0.0026    1.4466
> 
> The octaves function have been seted:
> [num,den,sg]=sftrans(numNorm,denNorm,1,2*pi*fc,0);
> 
> returns:
> num =  1131.0
> den =
>    1131.0   2261.9   2261.9   1131.0
> 
> sg =   1.4466e+009
> 
> 
> Thanks in advance.

Hi, did you see that the arguments to the sftrans function are the
zero-pole-gain form of the filter? The following gives the same answer
that you reported getting with Matlab:

    [z, p, k] = tf2zp (numNorm, denNorm);
    [z, p, k] = sftrans (z, p, k, 2*pi*fc, false);
    [num, den] = zp2tf (z, p, k);

Cheers,

-- 
mike



reply via email to

[Prev in Thread] Current Thread [Next in Thread]