Switch filter specification between normalized frequency and absolute frequency
the frequency specifications in filter specifications object
By default, the
is set to
true when you create a design object.
You provide the design specifications in normalized frequency units.
not affect filters that already use normalized frequency.
If you use this syntax when
d does not use
normalized frequency specifications, all of the frequency specifications
are normalized by
fs/2 so they lie between 0 and
fs is specified in the object. Included
in the normalization are the filter properties that define the filter
pass and stopband edge locations by frequency:
F3 dB— Used by IIR filter specifications objects to describe the passband cutoff frequency
Fcutoff— Used by FIR filter specifications objects to describe the passband cutoff frequency
Fpass— Describes the passband edges
Fstop— Describes the stopband edges
In this syntax,
fs when you created
d to use absolute frequency specifications.
specifies whether the
false and therefore
whether the filter normalizes the sampling frequency
other related frequency specifications.
to 1 for this syntax.
When you do not provide the input argument
it defaults to
true. If you set
affected frequency specifications are multiplied by
to remove the normalization. Use this syntax to switch your filter
between using normalized frequency specifications and not using normalized
you specify a new sampling frequency
fs when you
NormalizedFrequency property to
Normalize the Frequency Specifications of a Filter
These examples demonstrate using
normalizefreq in both of the major syntax applications-setting the design object frequency specifications to use absolute frequency (normalizefreq(hd,false,fs)) and resetting a design object to using normalized frequencies (normalizefreq(d)).
Construct a highpass filter specifications object by specifying the passband and stopband edges and the desired attenuations in the bands. By default, provide the frequency specifications in normalized values between 0 and 1.
d = fdesign.highpass(0.35, 0.45, 60, 40);
Fpass are in normalized form, and the property
NormalizedFrequency is true.
Now use normalizedfreq to convert to absolute frequency specifications, with a sampling frequency of 1000 Hz.
Both of the attenuation specifications remain the same. The passband and stopband edge definitions now appear in Hz, where the new value represents the normalized values multiplied by Fs/2, or 500 Hz.
Converting to using normalized frequencies consists of using
normalizefreq with the design object d.
For bandstop, bandpass, and multiple band filter specifications objects, normalizefreq works the same way for all band edge definitions. When you do not provide the sampling frequency Fs as an input argument and you are converting to absolute frequency specifications, normalizefreq sets Fs to 1, as shown in this example.