freqz -style plot of "window design" FIR?

Matti Viljamaa mviljamaa at kapsi.fi
Mon Aug 29 09:59:47 EDT 2016


Since I noticed this is better suited to the SciPy Users List, I moved it there:

https://mail.scipy.org/pipermail/scipy-user/2016-August/037023.html

> On 29 Aug 2016, at 14:34, Matti Viljamaa <mviljamaa at kapsi.fi> wrote:
> 
> I’m trying to design an arbitrary frequency response filter as described here:
> http://www.dspguide.com/ch17/1.htm <http://www.dspguide.com/ch17/1.htm>
> 
> The technique is said to result in an impulse response in time domain and later in to a filter kernel.
> 
> I’ve been using scipy.signal.freqz to make magnitude response plots:
> 
> e.g.
> 
> fs = 44100
> 
> # Design a low-pass filter using remez.
> cutoff = 2000.0
> transition_width = 200
> bands = np.array([0, cutoff - 0.5*transition_width,
>                  cutoff + 0.5*transition_width, fs/2.0]) / fs
> desired = [1, 0]
> lpf = remez(513, bands, desired)
> 
> # Plot the frequency response of the filter.
> w, h = freqz(lpf)
> plt.figure(1)
> plt.plot(fs*w/(2*np.pi), 20*np.log10(abs(h)))
> plt.xlim(0, fs/2)
> plt.xlabel('Frequency (Hz)')
> plt.ylabel('Gain (dB)')
> plt.grid(True)
> 
> But my question is, if using the above arbitrary frequency response design technique, would I be able to use freqz?
> 
> freqz takes as a parameter “numerator of a linear filter” and remez is returning an array of coefficients, which I read to be the same thing.
> 
> But in the case of the arbitrary frequency response filter, what can I put into freqz? Is filter kernel perhaps the same as coefficients?
> -- 
> https://mail.python.org/mailman/listinfo/python-list




More information about the Python-list mailing list