Home:ALL Converter>Implementing Scilab FIR filter in Python

Implementing Scilab FIR filter in Python

Ask Time:2014-03-29T06:10:24         Author:something-not-here

Json Formatter

I am using the guide below:

http://www.neurotraces.com/scilab/scilab2/node50.html

And I am having particular difficulty with this line:

hz = horner (hpoly, (1/%z))

Is there a way to evaluate polynomials using rational function arguments in numpy?

Edit: The code above was taken from the link. It's in scilab.

valcoeff = wfir ('lp', 4, [.2 0], 'hm', [0 0]) 
hpoly =  poly (valcoeff, 'z','coeff')
hz = horner (hpoly, (1/%z))
lisys = syslin ('d', hz)

This is my attempt, so far, to port it in python:

valcoeff    = signal.firwin( 130, [1./128, 64./128], pass_zero=False )
hpoly       = numpy.poly1d( valcoeff, variable= 'z' )

Author:something-not-here,eproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/22724042/implementing-scilab-fir-filter-in-python
yy