Main Content

setspecs

Specifications for filter specification object

Syntax

setspecs(D,specvalue1,specvalue2,...)
setspecs(D,Specification,specvalue1,specvalue2,...)
setspecs(...Fs)
setspecs(...,MAGUNITS)

Description

setspecs(D,specvalue1,specvalue2,...) sets the specifications in filter specification object, D, in the same order they appear in the Specification property.

setspecs(D,Specification,specvalue1,specvalue2,...) changes the specifications for an existing filter specification object and sets values for the new Specification property.

setspecs(...Fs) specifies the sampling frequency, Fs, in Hz. The sampling frequency must be a scalar trailing all other specifications. Entering a sampling frequency causes all other frequency specifications to be in Hz.

setspecs(...,MAGUNITS) specifies the units for any magnitude specifications. MAGUNITS can be one of the following: 'linear', 'dB', or 'squared'. The default is 'dB'. The magnitude specifications are always converted and stored in dB regardless of how the units are specified.

Use SET(D,'SPECIFICATION') to get the list of all available specification types for the filter specification object, D.

Examples

collapse all

Construct a lowpass filter with specifications for the filter order and cutoff frequency (-6 dB). Use setspecs after construction to set the values of the filter order and cutoff frequency. Display the values in the MATLAB® command window.

D = fdesign.lowpass('N,Fc');
setspecs(D,10,0.2);
D.FilterOrder
ans = 
10
D.Fcutoff
ans = 
0.2000

Construct a highpass filter with specifications for the numerator order, denominator order, and 3-dB frequency. Assume the sampling frequency is 1 kHz. Use setspecs to set the numerator and denominator orders to 6. Set the 3-dB frequency to 250 Hz. In order to use frequency specifications in Hz, specify the sampling frequency as a trailing scalar.

D = fdesign.highpass('Nb,Na,F3dB');
setspecs(D,6,6,250,1000);

Version History

Introduced in R2011b