[SciPy-User] plot sos (freqz for sos) filter

Warren Weckesser warren.weckesser at gmail.com
Mon Jun 6 17:00:59 EDT 2016


On Mon, Jun 6, 2016 at 3:25 PM, Neal Becker <ndbecker2 at gmail.com> wrote:

> Happy to see sos format supported.  Getting the response of the sos design
> requires a little effort.  A nice addition would be for freqz to directly
> support an sos input.
>
> Here's some code which I'm using for now:
>
> sos = signal.ellip (8, 0.5, 80, 0.5 * 500e3/(sps*250e6), output='sos')
> ba = [signal.sos2tf(s[np.newaxis,:]) for s in sos]
> ws = np.pi * np.logspace (-4, 0, num=500)
> wh = [signal.freqz (_[0],_[1],worN=ws) for _ in ba]
> plt.semilogx (wh[0][0]/np.pi, np.clip (20*np.log10(np.abs(np.prod ([_[1]
> for
> _ in wh], axis=0))),-100,0))
>
>
>

I started an implementation of 'sosfreqz' here:
https://github.com/scipy/scipy/pull/4465

The implementation is simple--just repeated calls to freqz--but the API
needs work.  I've been away from nontrivial scipy development for the last
six months or so, and at the moment there are a couple other pull requests
with higher priority that I will be working on for the 0.18 release, so I
probably won't get back sosfreqz for a while.  There are several active
developers working on scipy.signal these days, and I suspect if you poke
the right ones, someone might take over that work or start a new pull
request (which would be fine with me!).

Warren



>
> _______________________________________________
> SciPy-User mailing list
> SciPy-User at scipy.org
> https://mail.scipy.org/mailman/listinfo/scipy-user
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.scipy.org/pipermail/scipy-user/attachments/20160606/a60b9e27/attachment.html>


More information about the SciPy-User mailing list