IIRNotchFilter (FPScript)
Calculates the numerator and denominator coefficients of a second-order IIR notch filter that can be used to filter out frequencies within a narrow frequency range (narrow-band notch filter).
Syntax
IIRNotchFilter(NotchFrequency, Bandwidth [ , SamplingRate ])
The syntax of the IIRNotchFilter function consists of the following parts:
Part |
Description |
---|---|
NotchFrequency |
Specifies the notch frequency of the filter. The frequency must be between 0 and 0.5 (half of the sampling rate normalized to one) or between 0 and 0.5 * SamplingRate. Permitted data structures are scalar value. All real data types are permitted, except calendar time und time span. The value must be greater than 0. If the argument is a list, then the first element in the list is taken. If this is also a list, then the process is repeated. |
Bandwidth |
Specifies the bandwidth (symmetrically arranged around the notch frequency) of the notch filter. It defines the frequency range within which frequencies are filtered out (defined by -3 dB point, i.e. point at which 70.7 percent of the original signal amplitude is reached). Permitted data structures are scalar value. All real data types are permitted, except calendar time und time span. The value must be greater than 0. If the argument is a list, then the first element in the list is taken. If this is also a list, then the process is repeated. |
SamplingRate |
Specifies the sampling rate. The argument is optional. If this argument is not specified, a normalized frequency of 0 to 0.5 must be specified as the cut-off frequency for NotchFrequency. Permitted data structures are scalar value. All real data types are permitted, except calendar time und time span. The value must be greater than 0. If the argument is a list, then the function is executed for each element of the list and the result is also a list. |
Remarks
As a return result, the numerator and denominator coefficients of the second-order IIR notch filter are returned as a list with two elements b and a. Use the Filter function to filter data with the calculated filter.
Notch filters represent a particularly narrow-band type of band stop filter, which have only one zero point in the transfer function and thus do not attenuate a wide frequency band, but ideally attenuate exactly one frequency as strongly as possible.
The filter has the following amplitude response (here, for example, for the notch frequency of 150 Hz and bandwidth of 5 Hz):
Available in
Option Digital Filters
Examples
Dim coeff = IIRNotchFilter(0.2, 0.02)
Filter(Signal, coeff, TRUE)
First the numerator and denominator coefficients of the notch filter are calculated, then the data are filtered, phase-corrected, with the Filter function. The notch filter has a notch frequency of 0.2 and bandwidth of 0.02.
Dim coeff = IIRNotchFilter(100 Hz, 8 Hz, SamplingRate(Signal))
Filter(Signal, coeff, TRUE)
First the numerator and denominator coefficients of the notch filter are calculated, then the data are filtered, phase-corrected, with the Filter function. The notch filter has a notch frequency of 100 Hz and a bandwidth of 8 Hz.
Dim coeff = IIRNotchFilter(0.15, 0.02)
AmplitudeResponse(coeff, 100000)
Calculates the amplitude response (with 100000 data points) of the notch filter for the normalized notch frequency of 0.15 and bandwidth of 0.02 using the AmplitudeResponse function.
Dim coeff = IIRNotchFilter(150 Hz, 5 Hz, 1000 Hz)
AmplitudeResponse(coeff, 500000, 1000 Hz)
Calculates the amplitude response (with 500000 data points) of the notch filter for the notch frequency of 150 Hz and bandwidth of 5 Hz (sampling rate of 1 kHz) using the AmplitudeResponse function.
See Also
References
[1] Sophocles J. Orfanidis: Introduction to Signal Processing. Prentice Hall,1996.