components.interp.filterdesign
- class FilterDesign(config={}, **kwds)[source]
Bases:
ComponentGenerate a 1-D filter from an ideal response.
The response is specified as a series of normalised frequency values (in the range 0.0 to 0.5), corresponding gain values, usually in the range 0.0 to 1.0, and (optionally) corresponding weight values. A filter is generated that minimises the weighted square of the deviation from this ideal response.
The weight values are a measure of how much you care about the response at different frequencies. For example, you may want “flat” pass bands and stop bands, but not care too much about the transition band.
The
responseoutput emits the ideal and actual filter responses. It can be connected to thePlotDatacomponent.The
interpoption selects the function used to convert the series of response points to a continuous function, before calculating the filter coefficients. Seescipy.interpolate.interp1dfor more detail.Config
frequencystr
List of frequency values, in increasing order.
gainstr
List of corresponding gain values.
weightstr
List of corresponding weight values. Default is unity.
apertureint
The number of filter coefficients.
interpstr
Interpolation function. Possible values:
'linear','nearest','zero','slinear','quadratic','cubic'directionstr
Direction of filter. Possible values: horizontal, vertical.
- outputs = ['filter', 'response']
Comments or questions? Please email jim@jim-easterbrook.me.uk.