# [SciPy-User] How to calculate Yulewalk with scipy.optimize.leastsq

josef.pktd@gmai... josef.pktd@gmai...
Mon Jan 16 16:56:17 CST 2012

```On Mon, Jan 16, 2012 at 5:13 PM, klo uo <klonuo@gmail.com> wrote:

> H(z) = yulewalk(N,frq,mag) - finds the N-th order iir filter:
>
> [image:
> %5Cnormalsize%5C%21H%28z%29%3D%5Cfrac%7BB%28z%29%7D%7BA%28z%29%7D%3D%5Cfrac%7Bb%281%29%20%2B%20b%282%29z%5E%7B-1%7D%2B...%2Bb%28n%29z%5E%7B-%28n-1%29%7D%7D%7B1%2Ba%281%29z%5E%7B-1%7D%2B...%2Ba%28n%29z%5E%7B-%28n-1%29%7D%7D.gif]
>
> H(z) : filter B(z)/A(z)
> N    : integer (order of desired filter)
> frq  : real row vector (non-decreasing order), frequencies.
> mag  : non negative real row vector (same size as frq), desired magnitudes.
>
> ----------------------------------------
>
> yulewalk() function in "/scipy/signal/filter_design.py" is empty. It
> perhaps can be calculated using scipy.optimize.leastsq() but I lack skills
> to figure out how?
>
> All I can do right now is port it quick and dirty from Matlab to Python,
> but I feel it's bad idea and waste of time
>
> Can someone provide tip how can I calculate 10-th order yulewalk with
> scipy?
>

I have no idea about whether or how it can be used for filter design?

For estimation of the filter from data, the Yule Walker equations can only
estimate a autoregressive process, not an IIR filter (ARMA process).

statsmodels has yule walker for estimating the autoregressive filter, and
ARMA for estimating an IIR filter.
autoregressive can also be estimated with nitime and scikits.audiolab.
The only python package I know that can estimate an ARMA filter is
statsmodels.

Josef

>
>
> _______________________________________________
> SciPy-User mailing list
> SciPy-User@scipy.org
> http://mail.scipy.org/mailman/listinfo/scipy-user
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.scipy.org/pipermail/scipy-user/attachments/20120116/bdfec72e/attachment.html
```