The filterDesign action designs a digital filter. It supports standard filter families such as Butterworth, Chebyshev Type I, and Chebyshev Type II. You can calculate coefficients for Lowpass, Highpass, Bandpass, and Bandstop filters. The output of this action is a CAS table containing the filter definition (coefficients and metadata), which can be used by other time series processing actions to apply the filter to actual data.
| Parameter | Description |
|---|---|
| filterName | Specifies the name of the filter family to be designed. Valid values are 'butter' (Butterworth), 'cheby1' (Chebyshev Type I), and 'cheby2' (Chebyshev Type II). |
| filterType | Specifies the type of filter to design. Valid values are 'lowpass', 'highpass', 'bandpass', and 'bandstop'. |
| filterOrder | Specifies the order of the filter as a positive integer. The maximum value is 200. |
| filterCutoff1 | Specifies the low cutoff frequency. The value must be between 0 and 1, representing the normalized Nyquist frequency. |
| filterCutoff2 | Specifies the high cutoff frequency. Required only for 'bandpass' or 'bandstop' filter types. Value must be between 0 and 1. |
| filterOutTable | Specifies the output CAS table that will contain the designed filter definitions and coefficients. |
| filterRp | Specifies the passband ripple in decibels (dB). Required only for Chebyshev Type I filters. |
| filterRs | Specifies the stopband attenuation in decibels (dB). Required only for Chebyshev Type II filters. |
| casOut | Specifies an optional output table for the filter parameters summary. |
| inputVarName | Specifies the name of the input variable in the target time series data. This is metadata stored in the filter output table. |
| smoothedVarName | Specifies the name of the output variable for the smoothed series. This is metadata stored in the filter output table. |
Initialize the CAS session to prepare for filter design.
| 1 | PROC CAS; |
| 2 | SESSION casauto; |
| 3 | RUN; |
Designs a 4th-order Butterworth lowpass filter with a cutoff frequency of 0.5 and saves it to the 'butter_low' table.
| 1 | PROC CAS; |
| 2 | timeFilters.filterDesign / |
| 3 | filterName="butter", |
| 4 | filterType="lowpass", |
| 5 | filterOrder=4, |
| 6 | filterCutoff1=0.5, |
| 7 | filterOutTable={name="butter_low", replace=true}; |
| 8 | RUN; |
Designs a 5th-order Chebyshev Type I bandpass filter with normalized cutoff frequencies of 0.2 and 0.6, and a passband ripple of 0.5 dB. It also specifies metadata for input and output variable names.
| 1 | PROC CAS; |
| 2 | timeFilters.filterDesign / |
| 3 | filterName="cheby1", |
| 4 | filterType="bandpass", |
| 5 | filterOrder=5, |
| 6 | filterCutoff1=0.2, |
| 7 | filterCutoff2=0.6, |
| 8 | filterRp=0.5, |
| 9 | inputVarName="DailySales", |
| 10 | smoothedVarName="SmoothedSales", |
| 11 | filterOutTable={name="cheby_band", replace=true}; |
| 12 | RUN; |