Owning Palette: Filters VIs
Requires: Full Development System
Generates a bandstop FIR digital filter with equiripple characteristics using the ParksMcClellan algorithm and higher pass freq, lower pass freq, # of taps, lower stop freq, higher stop freq, and sampling freq: fs. The EquiRipple BandStop VI then applies a linearphase, bandstop filter to the input sequence X using the Convolution VI to obtain Filtered X. Wire data to the X input to determine the polymorphic instance to use or manually select the instance.
Use the pulldown menu to select an instance of this VI.
higher pass freq must be greater than higher stop freq and observe the Nyquist criterion. The default is 0.4 Hz. If higher pass freq is less than or equal to higher stop freq or does not meet the Nyquist criterion, the VI sets Filtered X to an empty array and returns an error through the ParksMcClellan VI.  
lower pass freq must be greater than zero and observe the Nyquist criterion. The default is 0.2 Hz. If lower pass freq is less than or equal to zero or does not meet the Nyquist criterion, the VI sets Filtered X to an empty array and returns an error through the ParksMcClellan VI.  
X is the input signal to filter.  
# of taps must be greater than 2. The default is 33. If # of taps is less than or equal to 2, the VI sets Filtered X to an empty array and returns an error through the ParksMcClellan VI.


lower stop freq must be greater than lower pass freq and observe the Nyquist criterion. The default is 0.25 Hz. If lower stop freq is less than or equal to lower pass freq or does not meet the Nyquist criterion, the VI sets Filtered X to an empty array and returns an error through the ParksMcClellan VI.  
higher stop freq must be greater than lower stop freq and observe the Nyquist criterion. The default is 0.35 Hz. If higher stop freq is less than or equal to lower stop freq or does not meet the Nyquist criterion, the VI sets Filtered X to an empty array and returns an error through the ParksMcClellan VI.  
sampling freq: fs is the frequency in Hz at which you want to sample X and must be greater than 0. The default is 1.0 Hz.  
Filtered X contains the result of filtering the input sequence X by convolution. This VI calculates the number of elements, k, in Filtered X using the following equation:
k = n + m – 1, where n is the number of elements in X and m is the number of taps.This VI also calculates the delay associated with the output sequence using the following equation: 

error returns any error or warning from the VI. You can wire error to the Error Cluster From Error Code VI to convert the error code or warning into an error cluster. 
higher pass freq must be greater than higher stop freq and observe the Nyquist criterion. The default is 0.4 Hz. If higher pass freq is less than or equal to higher stop freq or does not meet the Nyquist criterion, the VI sets Filtered X to an empty array and returns an error through the ParksMcClellan VI.  
lower pass freq must be greater than zero and observe the Nyquist criterion. The default is 0.2 Hz. If lower pass freq is less than or equal to zero or does not meet the Nyquist criterion, the VI sets Filtered X to an empty array and returns an error through the ParksMcClellan VI.  
X is the input signal to filter.  
# of taps must be greater than 2. The default is 33. If # of taps is less than or equal to 2, the VI sets Filtered X to an empty array and returns an error through the ParksMcClellan VI.


lower stop freq must be greater than lower pass freq and observe the Nyquist criterion. The default is 0.25 Hz. If lower stop freq is less than or equal to lower pass freq or does not meet the Nyquist criterion, the VI sets Filtered X to an empty array and returns an error through the ParksMcClellan VI.  
higher stop freq must be greater than lower stop freq and observe the Nyquist criterion. The default is 0.35 Hz. If higher stop freq is less than or equal to lower stop freq or does not meet the Nyquist criterion, the VI sets Filtered X to an empty array and returns an error through the ParksMcClellan VI.  
sampling freq: fs is the frequency in Hz at which you want to sample X and must be greater than 0. The default is 1.0 Hz.  
Filtered X contains the result of filtering the input sequence X by convolution. The number of elements, k, in Filtered X is given by the following equation.
k = n + m – 1, where n is the number of elements in X and m is the number of taps.A delay is also associated with the output sequence, as given by the following equation. 

error returns any error or warning from the VI. You can wire error to the Error Cluster From Error Code VI to convert the error code or warning into an error cluster. 
The first passband region of the filter goes from zero (DC) to the lower pass freq. The stopband region goes from the lower stop freq to the higher stop freq. The second passband region goes from the higher pass freq to the Nyquist frequency.
The values of the stop and pass frequencies must observe the following relationship.
0 < f_{0} < f_{1} < f_{2} < f_{3} < 0.5f_{s}
where f_{0} is lower pass freq, f_{1} is lower stop freq, f_{2} is higher stop freq, f_{3} is higher pass freq, and f_{s} is sampling freq: fs. If you violate any of these conditions, this VI sets Filtered X to an empty array and returns an error through the ParksMcClellan VI.