Digital IIR Filter VI

Owning Palette: Waveform Conditioning VIs

Requires: Full Development System

Filters signals in either single or multiple waveforms. If you are filtering multiple waveforms, the VI maintains separate filter states for each waveform. The data types you wire to the signal in and IIR filter specifications inputs determine the polymorphic instance to use.

Note  Do not use the single-channel instance of this VI for continuous multiple-channel processing.

Details  Examples

Use the pull-down menu to select an instance of this VI.

 Add to the block diagram  Find on the palette

IIR Filter for 1 Chan

reset filter forces the filter coefficients to be redesigned and the internal filter states to be reset to zero when it is TRUE.
signal in is the waveform data you want to filter for channel 1.
filter structure option specifies the order of the IIR cascade filter.

0IIR 2nd Order—Returns IIR second-order filter stages.
1IIR 4th Order—Returns IIR fourth-order filter stages.
2Auto Select (default)—Returns either IIR second-order or IIR fourth-order filter stages according to the type. If type is Lowpass or Highpass, the VI returns IIR second-order filter stages. If type is Bandpass or Bandstop, the VI returns IIR fourth-order filter stages.
error in describes error conditions that occur before this node runs. This input provides standard error in functionality.
IIR filter specifications is the cluster containing design parameters for an IIR filter.
Topology determines the design type of the filter.

0Off
1Butterworth
2Chebyshev
3Inverse Chebyshev
4Elliptic
5Bessel
Type specifies the passband of the filter according to the following values.

0Lowpass
1Highpass
2Bandpass
3Bandstop
Order is the filter order. If Order 0, the filter uses optional IIR filter specification to compute the order.
Lower Fc is the low cutoff frequency and must observe the Nyquist criterion. The Nyquist criterion is 0 < fl < 0.5fs, where fl is the cutoff frequency, and fs is the sampling frequency. If Lower Fc is less than zero or greater than half the sampling frequency, the VI sets the signal out waveform to be empty and returns an error. The default is 100.
Upper Fc is the high cutoff frequency. This parameter is ignored when Type is 0 (lowpass) or 1 (highpass).
PB Ripple must be greater than zero, and you must express it in decibels. If PB Ripple is less than or equal to zero, the VI sets the signal out waveform to be empty and returns an error. The default is 1.0.
SB Attenuation specifies the stopband attenuation. SB Attenuation must be greater than zero and expressed in decibels. If SB Attenuation is less than or equal to zero, the VI sets the signal output to zero or an empty array and returns an error. The default is 60.0.
optional IIR filter specifications is a cluster containing information necessary to compute the order of an IIR filter.
Lower PB is the lower of the two passband frequencies. The default is 100 Hz.
Upper PB is the higher of the two passband frequencies. The default is 0.
Lower SB is the lower of the two stopband frequencies. The default is 200 Hz.
Upper SB is the higher of the two stopband frequencies. The default is 0.
PB Gain is the gain at the passband frequencies. Gain may be specified in linear terms or dB. The default is –3dB.
SB Gain is the gain at the stopband frequencies. Gain may be specified in linear terms or dB. The default is –60dB.
Scale determines how the Passband and Stopband gain parameters are interpreted.
signal out is the generated waveform.
filter information contains the magnitude and phase responses of the filter in a cluster that is ready to graph. filter information also contains the order of the filter.
magnitude H(w) is the magnitude response of the filter. You can wire this cluster to a graph.
f0 is the start frequency of the magnitude response.
df is the spacing between elements of the magnitude response in hertz.
Mag H(w) is an array of values containing the magnitude response of the filter.
phase H(w) is the phase response of the filter.
f0 is the start frequency of the phase response.
df is the spacing between elements of the magnitude response in hertz.
Phase H(w) is an array of values containing the phase response of the filter, expressed in degrees.
order is the order of the filter.
error out contains error information. This output provides standard error out functionality.

IIR Filter for N Chan

reset filters forces the filter coefficients to be redesigned and the internal filter states to be reset to zero for each input waveform when it is TRUE.
signal(s) in is an array of waveforms containing the signals to filter.
filter structure option specifies the order of the IIR cascade filter.

0IIR 2nd Order—Returns IIR second-order filter stages.
1IIR 4th Order—Returns IIR fourth-order filter stages.
2Auto Select (default)—Returns either IIR second-order or IIR fourth-order filter stages according to the type. If type is Lowpass or Highpass, the VI returns IIR second-order filter stages. If type is Bandpass or Bandstop, the VI returns IIR fourth-order filter stages.
error in describes error conditions that occur before this node runs. This input provides standard error in functionality.
IIR filter specifications is the cluster containing design parameters for an IIR filter.
Topology determines the design type of the filter.

0Off
1Butterworth
2Chebyshev
3Inverse Chebyshev
4Elliptic
5Bessel
Type specifies the passband of the filter according to the following values.

0Lowpass
1Highpass
2Bandpass
3Bandstop
Order is the filter order. If Order 0, the filter uses optional IIR filter specification to compute the order.
Lower Fc is the low cutoff frequency and must observe the Nyquist criterion. The Nyquist criterion is 0 < fl < 0.5fs, where fl is the cutoff frequency, and fs is the sampling frequency. If Lower Fc is less than zero or greater than half the sampling frequency, the VI sets the signal out waveform to be empty and returns an error. The default is 100.
Upper Fc is the high cutoff frequency. This parameter is ignored when Type is 0 (lowpass) or 1 (highpass).
PB Ripple must be greater than zero, and you must express it in decibels. If PB Ripple is less than or equal to zero, the VI sets the signal out waveform to be empty and returns an error. The default is 1.0.
SB Attenuation specifies the stopband attenuation. SB Attenuation must be greater than zero and expressed in decibels. If SB Attenuation is less than or equal to zero, the VI sets the signal output to zero or an empty array and returns an error. The default is 60.0.
optional IIR filter specifications is a cluster containing information necessary to compute the order of an IIR filter.
Lower PB is the lower of the two passband frequencies. The default is 100 Hz.
Upper PB is the higher of the two passband frequencies. The default is 0.
Lower SB is the lower of the two stopband frequencies. The default is 200 Hz.
Upper SB is the higher of the two stopband frequencies. The default is 0.
PB Gain is the gain at the passband frequencies. Gain may be specified in linear terms or dB. The default is –3dB.
SB Gain is the gain at the stopband frequencies. Gain may be specified in linear terms or dB. The default is –60dB.
Scale determines how the Passband and Stopband gain parameters are interpreted.
signal(s) out is an array of signals that have been filtered according to the filter specifications controls.
filter information contains the magnitude and phase responses of the filter in a cluster that is ready to graph. filter information also contains the order of the filter.
magnitude H(w) is the magnitude response of the filter. You can wire this cluster to a graph.
f0 is the start frequency of the magnitude response.
df is the spacing between elements of the magnitude response in hertz.
Mag H(w) is an array of values containing the magnitude response of the filter.
phase H(w) is the phase response of the filter.
f0 is the start frequency of the phase response.
df is the spacing between elements of the magnitude response in hertz.
Phase H(w) is an array of values containing the phase response of the filter, expressed in degrees.
order is the order of the filter.
error out contains error information. This output provides standard error out functionality.

IIR Filter by N Specs for N Chan

reset filters forces the filter coefficients to be redesigned and the internal filter states to be reset to zero for each input waveform when it is TRUE.
signal(s) in is an array of waveforms containing the signals to filter.
filter structure option specifies the order of the IIR cascade filter.

0IIR 2nd Order—Returns IIR second-order filter stages.
1IIR 4th Order—Returns IIR fourth-order filter stages.
2Auto Select (default)—Returns either IIR second-order or IIR fourth-order filter stages according to the type. If type is Lowpass or Highpass, the VI returns IIR second-order filter stages. If type is Bandpass or Bandstop, the VI returns IIR fourth-order filter stages.
error in describes error conditions that occur before this node runs. This input provides standard error in functionality.
IIR filter specifications is an array of filter parameters. The size of this array must be the same as the number of waveforms in the signal(s) in array. The default is an empty array.
IIR filter specifications is the cluster containing design parameters for an IIR filter.
Topology determines the design type of the filter.

0Off
1Butterworth
2Chebyshev
3Inverse Chebyshev
4Elliptic
5Bessel
Type specifies the passband of the filter according to the following values.

0Lowpass
1Highpass
2Bandpass
3Bandstop
Order is the filter order. If Order 0, the filter uses optional IIR filter specification to compute the order.
Lower Fc is the low cutoff frequency and must observe the Nyquist criterion. The Nyquist criterion is 0 < fl < 0.5fs, where fl is the cutoff frequency, and fs is the sampling frequency. If Lower Fc is less than zero or greater than half the sampling frequency, the VI sets the signal out waveform to be empty and returns an error. The default is 100.
Upper Fc is the high cutoff frequency. This parameter is ignored when Type is 0 (lowpass) or 1 (highpass).
PB Ripple must be greater than zero, and you must express it in decibels. If PB Ripple is less than or equal to zero, the VI sets the signal out waveform to be empty and returns an error. The default is 1.0.
SB Attenuation specifies the stopband attenuation. SB Attenuation must be greater than zero and expressed in decibels. If SB Attenuation is less than or equal to zero, the VI sets the signal output to zero or an empty array and returns an error. The default is 60.0.
optional IIR filter specifications is an array of additional filter parameters. This array must either be empty or must have the same size as the IIR filter specifications array.
optional IIR filter specifications is a cluster containing information necessary to compute the order of an IIR filter.
Lower PB is the lower of the two passband frequencies. The default is 100 Hz.
Upper PB is the higher of the two passband frequencies. The default is 0.
Lower SB is the lower of the two stopband frequencies. The default is 200 Hz.
Upper SB is the higher of the two stopband frequencies. The default is 0.
PB Gain is the gain at the passband frequencies. Gain may be specified in linear terms or dB. The default is –3dB.
SB Gain is the gain at the stopband frequencies. Gain may be specified in linear terms or dB. The default is –60dB.
Scale determines how the Passband and Stopband gain parameters are interpreted.
signal(s) out is an array of signals that have been filtered according to the filter specifications controls.
filter information contains the magnitude and phase responses of the filter in a cluster that is ready to graph. filter information also contains the order of the filter.
magnitude H(w) is the magnitude response of the filter. You can wire this cluster to a graph.
f0 is the start frequency of the magnitude response.
df is the spacing between elements of the magnitude response in hertz.
Mag H(w) is an array of values containing the magnitude response of the filter.
phase H(w) is the phase response of the filter.
f0 is the start frequency of the phase response.
df is the spacing between elements of the magnitude response in hertz.
Phase H(w) is an array of values containing the phase response of the filter, expressed in degrees.
order is the order of the filter.
error out contains error information. This output provides standard error out functionality.

IIR Filter for 1 Chan (CDB)

reset filter forces the filter coefficients to be redesigned and the internal filter states to be reset to zero when it is TRUE.
signal in is the waveform data you want to filter for channel 1.
filter structure option specifies the order of the IIR cascade filter.

0IIR 2nd Order—Returns IIR second-order filter stages.
1IIR 4th Order—Returns IIR fourth-order filter stages.
2Auto Select (default)—Returns either IIR second-order or IIR fourth-order filter stages according to the type. If type is Lowpass or Highpass, the VI returns IIR second-order filter stages. If type is Bandpass or Bandstop, the VI returns IIR fourth-order filter stages.
error in describes error conditions that occur before this node runs. This input provides standard error in functionality.
IIR filter specifications is the cluster containing design parameters for an IIR filter.
Topology determines the design type of the filter.

0Off
1Butterworth
2Chebyshev
3Inverse Chebyshev
4Elliptic
5Bessel
Type specifies the passband of the filter according to the following values.

0Lowpass
1Highpass
2Bandpass
3Bandstop
Order is the filter order. If Order 0, the filter uses optional IIR filter specification to compute the order.
Lower Fc is the low cutoff frequency and must observe the Nyquist criterion. The Nyquist criterion is 0 < fl < 0.5fs, where fl is the cutoff frequency, and fs is the sampling frequency. If Lower Fc is less than zero or greater than half the sampling frequency, the VI sets the signal out waveform to be empty and returns an error. The default is 100.
Upper Fc is the high cutoff frequency. This parameter is ignored when Type is 0 (lowpass) or 1 (highpass).
PB Ripple must be greater than zero, and you must express it in decibels. If PB Ripple is less than or equal to zero, the VI sets the signal out waveform to be empty and returns an error. The default is 1.0.
SB Attenuation specifies the stopband attenuation. SB Attenuation must be greater than zero and expressed in decibels. If SB Attenuation is less than or equal to zero, the VI sets the signal output to zero or an empty array and returns an error. The default is 60.0.
optional IIR filter specifications is a cluster containing information necessary to compute the order of an IIR filter.
Lower PB is the lower of the two passband frequencies. The default is 100 Hz.
Upper PB is the higher of the two passband frequencies. The default is 0.
Lower SB is the lower of the two stopband frequencies. The default is 200 Hz.
Upper SB is the higher of the two stopband frequencies. The default is 0.
PB Gain is the gain at the passband frequencies. Gain may be specified in linear terms or dB. The default is –3dB.
SB Gain is the gain at the stopband frequencies. Gain may be specified in linear terms or dB. The default is –60dB.
Scale determines how the Passband and Stopband gain parameters are interpreted.
signal out is the generated waveform.
filter information contains the magnitude and phase responses of the filter in a cluster that is ready to graph. filter information also contains the order of the filter.
magnitude H(w) is the magnitude response of the filter. You can wire this cluster to a graph.
f0 is the start frequency of the magnitude response.
df is the spacing between elements of the magnitude response in hertz.
Mag H(w) is an array of values containing the magnitude response of the filter.
phase H(w) is the phase response of the filter.
f0 is the start frequency of the phase response.
df is the spacing between elements of the magnitude response in hertz.
Phase H(w) is an array of values containing the phase response of the filter, expressed in degrees.
order is the order of the filter.
error out contains error information. This output provides standard error out functionality.

IIR Filter for N Chan (CDB)

reset filters forces the filter coefficients to be redesigned and the internal filter states to be reset to zero for each input waveform when it is TRUE.
signal(s) in is an array of waveforms containing the signals to filter.
filter structure option specifies the order of the IIR cascade filter.

0IIR 2nd Order—Returns IIR second-order filter stages.
1IIR 4th Order—Returns IIR fourth-order filter stages.
2Auto Select (default)—Returns either IIR second-order or IIR fourth-order filter stages according to the type. If type is Lowpass or Highpass, the VI returns IIR second-order filter stages. If type is Bandpass or Bandstop, the VI returns IIR fourth-order filter stages.
error in describes error conditions that occur before this node runs. This input provides standard error in functionality.
IIR filter specifications is the cluster containing design parameters for an IIR filter.
Topology determines the design type of the filter.

0Off
1Butterworth
2Chebyshev
3Inverse Chebyshev
4Elliptic
5Bessel
Type specifies the passband of the filter according to the following values.

0Lowpass
1Highpass
2Bandpass
3Bandstop
Order is the filter order. If Order 0, the filter uses optional IIR filter specification to compute the order.
Lower Fc is the low cutoff frequency and must observe the Nyquist criterion. The Nyquist criterion is 0 < fl < 0.5fs, where fl is the cutoff frequency, and fs is the sampling frequency. If Lower Fc is less than zero or greater than half the sampling frequency, the VI sets the signal out waveform to be empty and returns an error. The default is 100.
Upper Fc is the high cutoff frequency. This parameter is ignored when Type is 0 (lowpass) or 1 (highpass).
PB Ripple must be greater than zero, and you must express it in decibels. If PB Ripple is less than or equal to zero, the VI sets the signal out waveform to be empty and returns an error. The default is 1.0.
SB Attenuation specifies the stopband attenuation. SB Attenuation must be greater than zero and expressed in decibels. If SB Attenuation is less than or equal to zero, the VI sets the signal output to zero or an empty array and returns an error. The default is 60.0.
optional IIR filter specifications is a cluster containing information necessary to compute the order of an IIR filter.
Lower PB is the lower of the two passband frequencies. The default is 100 Hz.
Upper PB is the higher of the two passband frequencies. The default is 0.
Lower SB is the lower of the two stopband frequencies. The default is 200 Hz.
Upper SB is the higher of the two stopband frequencies. The default is 0.
PB Gain is the gain at the passband frequencies. Gain may be specified in linear terms or dB. The default is –3dB.
SB Gain is the gain at the stopband frequencies. Gain may be specified in linear terms or dB. The default is –60dB.
Scale determines how the Passband and Stopband gain parameters are interpreted.
signal(s) out is an array of signals that have been filtered according to the filter specifications controls.
filter information contains the magnitude and phase responses of the filter in a cluster that is ready to graph. filter information also contains the order of the filter.
magnitude H(w) is the magnitude response of the filter. You can wire this cluster to a graph.
f0 is the start frequency of the magnitude response.
df is the spacing between elements of the magnitude response in hertz.
Mag H(w) is an array of values containing the magnitude response of the filter.
phase H(w) is the phase response of the filter.
f0 is the start frequency of the phase response.
df is the spacing between elements of the magnitude response in hertz.
Phase H(w) is an array of values containing the phase response of the filter, expressed in degrees.
order is the order of the filter.
error out contains error information. This output provides standard error out functionality.

IIR Filter by N Specs for N Chan (CDB)

reset filters forces the filter coefficients to be redesigned and the internal filter states to be reset to zero for each input waveform when it is TRUE.
signal(s) in is an array of waveforms containing the signals to filter.
filter structure option specifies the order of the IIR cascade filter.

0IIR 2nd Order—Returns IIR second-order filter stages.
1IIR 4th Order—Returns IIR fourth-order filter stages.
2Auto Select (default)—Returns either IIR second-order or IIR fourth-order filter stages according to the type. If type is Lowpass or Highpass, the VI returns IIR second-order filter stages. If type is Bandpass or Bandstop, the VI returns IIR fourth-order filter stages.
error in describes error conditions that occur before this node runs. This input provides standard error in functionality.
IIR filter specifications is an array of filter parameters. The size of this array must be the same as the number of waveforms in the signal(s) in array. The default is an empty array.
IIR filter specifications is the cluster containing design parameters for an IIR filter.
Topology determines the design type of the filter.

0Off
1Butterworth
2Chebyshev
3Inverse Chebyshev
4Elliptic
5Bessel
Type specifies the passband of the filter according to the following values.

0Lowpass
1Highpass
2Bandpass
3Bandstop
Order is the filter order. If Order 0, the filter uses optional IIR filter specification to compute the order.
Lower Fc is the low cutoff frequency and must observe the Nyquist criterion. The Nyquist criterion is 0 < fl < 0.5fs, where fl is the cutoff frequency, and fs is the sampling frequency. If Lower Fc is less than zero or greater than half the sampling frequency, the VI sets the signal out waveform to be empty and returns an error. The default is 100.
Upper Fc is the high cutoff frequency. This parameter is ignored when Type is 0 (lowpass) or 1 (highpass).
PB Ripple must be greater than zero, and you must express it in decibels. If PB Ripple is less than or equal to zero, the VI sets the signal out waveform to be empty and returns an error. The default is 1.0.
SB Attenuation specifies the stopband attenuation. SB Attenuation must be greater than zero and expressed in decibels. If SB Attenuation is less than or equal to zero, the VI sets the signal output to zero or an empty array and returns an error. The default is 60.0.
optional IIR filter specifications is an array of additional filter parameters. This array must either be empty or must have the same size as the IIR filter specifications array.
optional IIR filter specifications is a cluster containing information necessary to compute the order of an IIR filter.
Lower PB is the lower of the two passband frequencies. The default is 100 Hz.
Upper PB is the higher of the two passband frequencies. The default is 0.
Lower SB is the lower of the two stopband frequencies. The default is 200 Hz.
Upper SB is the higher of the two stopband frequencies. The default is 0.
PB Gain is the gain at the passband frequencies. Gain may be specified in linear terms or dB. The default is –3dB.
SB Gain is the gain at the stopband frequencies. Gain may be specified in linear terms or dB. The default is –60dB.
Scale determines how the Passband and Stopband gain parameters are interpreted.
signal(s) out is an array of signals that have been filtered according to the filter specifications controls.
filter information contains the magnitude and phase responses of the filter in a cluster that is ready to graph. filter information also contains the order of the filter.
magnitude H(w) is the magnitude response of the filter. You can wire this cluster to a graph.
f0 is the start frequency of the magnitude response.
df is the spacing between elements of the magnitude response in hertz.
Mag H(w) is an array of values containing the magnitude response of the filter.
phase H(w) is the phase response of the filter.
f0 is the start frequency of the phase response.
df is the spacing between elements of the magnitude response in hertz.
Phase H(w) is an array of values containing the phase response of the filter, expressed in degrees.
order is the order of the filter.
error out contains error information. This output provides standard error out functionality.

Digital IIR Filter Details

The Digital IIR Filter VI filters the signal(s) in a waveform array according to the IIR filter specifications and optional IIR filter specifications arrays. If you are filtering multiple waveforms, the VI applies a different filter to each of the input waveforms and maintains a separate filter state for each waveform. The VI uses optional IIR filter specifications only if Filter Order is less than or equal to zero. You do not need to wire reset filter. This VI resets itself the first time it is called.

Note  In general, IIR second-order stages provide more stable results than the IIR fourth-order stages. National Instruments recommends that you specify IIR 2nd Order as the filter structure option with Bandpass or Bandstop as the Type for extreme IIR filter specifications, such as very narrow passband or stopband.

The Digital IIR Filter VI can perform single-channel measurements in both one-shot mode (single call) and continuous mode (multiple calls with history). It can perform multichannel measurements only in one-shot mode. If you want to make multiple-channel measurements in continuous mode, either use the multi-channel instance of this VI or use one instance of this VI per channel.

The single-channel instance of this VI is intended primarily for continuous processing of a single channel. Do not generalize this behavior to the multi-channel case, typically by using this single-channel VI in a For Loop to continuously process multiple channels by indexing an array of waveforms.

The single-channel instance of this VI maintains internal state information for a single channel only. Calling this VI to process another channel without clearing the history using the reset filter control results in an unexpected behavior of this VI because the internal state information is passed from one channel to another.

Related Information

Passband Ripple and Stopband Attenuation

Examples

Refer to the following VIs for examples of using the Digital IIR Filter VI: