timeFilters

filterDesign

Description

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.

timeFilters.filterDesign <result=results> <status=rc> / casOut={ caslib="string", compress=TRUE | FALSE, indexVars={"variable-name-1" <, "variable-name-2", ...>}, label="string", lifetime=64-bit-integer, maxMemSize=64-bit-integer, memoryFormat="DVR" | "INHERIT" | "STANDARD", name="table-name", promote=TRUE | FALSE, replace=TRUE | FALSE, replication=integer, tableRedistUpPolicy="DEFER" | "NOREDIST" | "REBALANCE", threadBlockSize=64-bit-integer, timeStamp="string", where={"string-1" <, "string-2", ...>} }, * filterCutoff1=double, filterCutoff2=double, * filterName="string", * filterOrder=double, filterOutTable={ caslib="string", label="string", lifetime=64-bit-integer, memoryFormat="DVR" | "INHERIT" | "STANDARD", name="table-name", promote=TRUE | FALSE, replace=TRUE | FALSE, tableRedistUpPolicy="DEFER" | "NOREDIST" | "REBALANCE" }, filterRp=double, filterRs=double, * filterType="string", inputVarName="string", smoothedVarName="string";
Settings
ParameterDescription
filterNameSpecifies the name of the filter family to be designed. Valid values are 'butter' (Butterworth), 'cheby1' (Chebyshev Type I), and 'cheby2' (Chebyshev Type II).
filterTypeSpecifies the type of filter to design. Valid values are 'lowpass', 'highpass', 'bandpass', and 'bandstop'.
filterOrderSpecifies the order of the filter as a positive integer. The maximum value is 200.
filterCutoff1Specifies the low cutoff frequency. The value must be between 0 and 1, representing the normalized Nyquist frequency.
filterCutoff2Specifies the high cutoff frequency. Required only for 'bandpass' or 'bandstop' filter types. Value must be between 0 and 1.
filterOutTableSpecifies the output CAS table that will contain the designed filter definitions and coefficients.
filterRpSpecifies the passband ripple in decibels (dB). Required only for Chebyshev Type I filters.
filterRsSpecifies the stopband attenuation in decibels (dB). Required only for Chebyshev Type II filters.
casOutSpecifies an optional output table for the filter parameters summary.
inputVarNameSpecifies the name of the input variable in the target time series data. This is metadata stored in the filter output table.
smoothedVarNameSpecifies the name of the output variable for the smoothed series. This is metadata stored in the filter output table.
Data Preparation View data prep sheet
CAS Session Initialization

Initialize the CAS session to prepare for filter design.

Copied!
1PROC CAS;
2 SESSION casauto;
3 RUN;

Examples

Designs a 4th-order Butterworth lowpass filter with a cutoff frequency of 0.5 and saves it to the 'butter_low' table.

SAS® / CAS Code Code awaiting community validation
Copied!
1PROC 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;
Result :
The table 'butter_low' is created containing the filter coefficients.

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.

SAS® / CAS Code Code awaiting community validation
Copied!
1PROC 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;
Result :
The table 'cheby_band' is created containing the coefficients for the specified bandpass filter.

FAQ

What is the primary purpose of the filterDesign action?
What are the supported filter types available in the filterDesign action?
Which specific filter names can be used?
What is the valid range and maximum value for the filterOrder parameter?
Under what conditions is the filterCutoff2 parameter required?
How are the cutoff frequency values normalized?
Which parameters are specific to the design of Chebyshev filters?
What are the default names for the input and smoothed output variables?
What is the function of the filterOutTable parameter?