IIRPeakFilter (FPScript)
Calculates the numerator and denominator coefficients of a second-order IIR peak filter (also called a resonant filter) that can be used to block out frequencies outside a narrow frequency range (narrow-band bandpass filter).
Syntax
IIRPeakFilter(PeakFrequency, Bandwidth [ , SamplingRate ])
The syntax of the IIRPeakFilter function consists of the following parts:
Part |
Description |
---|---|
PeakFrequency |
Specifies the peak frequency (resonant frequency) of the filter, i.e. the frequency to be retained in the signal. 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 resonant frequency) of the filter. It defines the frequency range, outside of which frequencies are blocked 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 PeakFrequency. 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 peak filter are returned as a list with two elements b and a. Use the Filter function to filter data with the calculated filter.
The filter represents a particularly narrow-band type of band stop filter, which does not retain a wide frequency band, but ideally retains only exactly one frequency.
The filter has the following amplitude response (here, for example, for the peak frequency of 150 Hz and bandwidth of 5 Hz):
Available in
Option Digital Filters und Option Order Tracking
Examples
Dim coeff = IIRPeakFilter(0.2, 0.02)
Filter(Signal, coeff, TRUE)
First the numerator and denominator coefficients of the peak filter are calculated, then the data are filtered, phase-corrected, using the Filter function. The filter has a resonant frequency of 0.2 and bandwidth of 0.02.
Dim coeff = IIRPeakFilter(100 Hz, 8 Hz, SamplingRate(Signal))
Filter(Signal, coeff, TRUE)
First the numerator and denominator coefficients of the peak filter are calculated, then the data are filtered, phase-corrected, using the Filter function. The filter has a resonant frequency of 100 Hz and a bandwidth of 8 Hz.
Dim coeff = IIRPeakFilter(0.15, 0.02)
AmplitudeResponse(coeff, 100000)
Calculates the amplitude response (with 100000 data points) of the peak filter for the normalized resonant frequency of 0.15 and bandwidth of 0.02 using the AmplitudeResponse function.
Dim coeff = IIRPeakFilter(150 Hz, 5 Hz, 1000 Hz)
AmplitudeResponse(coeff, 500000, 1000 Hz)
Calculates the amplitude response (with 500000 data points) of the peak filter for the resonant 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.