components.interp.filterdesign

class FilterDesign(config={}, **kwds)[source]

Bases: Component

Generate 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 response output emits the ideal and actual filter responses. It can be connected to the PlotData component.

The interp option selects the function used to convert the series of response points to a continuous function, before calculating the filter coefficients. See scipy.interpolate.interp1d for more detail.

Config

frequency

str

List of frequency values, in increasing order.

gain

str

List of corresponding gain values.

weight

str

List of corresponding weight values. Default is unity.

aperture

int

The number of filter coefficients.

interp

str

Interpolation function. Possible values: 'linear', 'nearest', 'zero', 'slinear', 'quadratic', 'cubic'

direction

str

Direction of filter. Possible values: horizontal, vertical.

outputs = ['filter', 'response']

Comments or questions? Please email jim@jim-easterbrook.me.uk.