Highpass filter specification object
D = fdesign.highpass
D = fdesign.highpass(
D = fdesign.highpass(SPEC,specvalue1,specvalue2,...)
D = fdesign.highpass(specvalue1,specvalue2,specvalue3,
D = fdesign.highpass(...,Fs)
D = fdesign.highpass(...,MAGUNITS)
D = fdesign.highpass constructs
a highpass filter specification object
default values for the specification,
D = fdesign.highpass( constructs
D and sets the
SPEC. Entries in the
various filter response features, such as the filter order, that govern
the filter design. Valid entries for
SPEC are shown
below. These entries are not case sensitive.
Note: Specification entries marked with an asterisk require the DSP System Toolbox™ software.
The filter specifications are defined as follows:
Ap — amount of ripple allowed
in the pass band in decibels (the default units). Also called Apass.
Ast — attenuation in the
stop band in decibels (the default units). Also called Astop.
F3db — cutoff frequency
for the point 3 dB point below the passband value. Specified in normalized
Fc — cutoff frequency for
the point 6 dB point below the passband value. Specified in normalized
Fp — frequency at the start
of the pass band. Specified in normalized frequency units. Also called
Fst — frequency at the end
of the stop band. Specified in normalized frequency units. Also called
N — filter order.
the order of the denominator and numerator.
Graphically, the filter specifications look similar to those shown in the following figure.
Regions between specification values like
transition regions where the filter response is not explicitly defined.
The filter design methods that apply to a highpass filter specification
object change depending on the
designmethods to determine which design
method applies to an object and its specification.
designopts to determine
which design options are valid for a given design method. For detailed
information on design options for a given design method,
help(D,METHOD) at the MATLAB® command
D = fdesign.highpass(SPEC,specvalue1,specvalue2,...) constructs
d and sets its specification values at
D = fdesign.highpass(specvalue1,specvalue2,specvalue3, constructs an object
Specification property and the values
you enter for
D = fdesign.highpass(...,Fs)
provides the sampling frequency for the filter specification object.
in Hz and must be specified as a scalar trailing the other numerical
values provided. If you specify a sampling frequency, all other frequency
specifications are in Hz.
D = fdesign.highpass(...,MAGUNITS) specifies
the units for any magnitude specification you provide in the input
MAGUNITS can be one of
'linear' — specify the magnitude
in linear units
'dB' — specify the magnitude
in dB (decibels)
'squared' — specify the
magnitude in power units
When you omit the
that all magnitudes are in decibels. Note that
all magnitude specifications in decibels (converting to decibels when
necessary) regardless of how you specify the magnitudes.
Highpass filter a discrete-time signal consisting of two sine waves.
Create a highpass filter specification object. Specify the passband frequency to be 0.25π rad/sample and the stopband frequency to be 0.15π rad/sample. Specify 1 dB of allowable passband ripple and a stopband attenuation of 60 dB.
d = fdesign.highpass('Fst,Fp,Ast,Ap',0.15,0.25,60,1);
Query the valid design methods for your filter specification object.
Design Methods for class fdesign.highpass (Fst,Fp,Ast,Ap): butter cheby1 cheby2 ellip equiripple ifir kaiserwin
Create an FIR equiripple filter and view the filter magnitude response with FVTool.
Hd = design(d,'equiripple'); fvtool(Hd)
Create a signal consisting of the sum of two discrete-time sinusoids with frequencies of π/8 and π/4 rad/sample and amplitudes of 1 and 0.25 respectively. Filter the discrete-time signal with the FIR equiripple filter object.
n = 0:159; x = cos(pi/8*n)+0.25*sin(pi/4*n); y = filter(Hd,x);
Plot the original and filtered signals in the frequency domain.
freq = 0:(2*pi)/160:pi; xdft = fft(x); ydft = fft(y); plot(freq/pi,abs(xdft(1:length(x)/2+1))) hold on plot(freq/pi,abs(ydft(1:length(y)/2+1)),'r','linewidth',2) hold off legend('Original Signal','Lowpass Signal','Location','NorthEast') ylabel('Magnitude') xlabel('Normalized Frequency (\times\pi rad/sample)')
Create a filter of order 10 with a 6-dB frequency of 9.6 kHz and a sample rate of 48 kHz. Look at the available design methods.
Design Methods for class fdesign.highpass (N,Fc): window
The only available method is the FIR window method. Design the filter and display its magnitude response.
Hd = design(d); fvtool(Hd)
You can specify the shape of the stopband and the rate at which the stopband decays.
Create two FIR equiripple filters with different linear stopband slopes. Specify the passband frequency to be 0.3π rad/sample and the stopband frequency to be 0.35π rad/sample. Specify 1 dB of allowable passband ripple and a stopband attenuation of 60 dB. Design one filter with a 20 dB/(rad/sample) stopband slope and another filter with a slope of 40 dB/(rad/sample).
D = fdesign.highpass('Fst,Fp,Ast,Ap',0.3,0.35,60,1); Hd1 = design(D,'equiripple','StopBandShape','linear','StopBandDecay',20); Hd2 = design(D,'equiripple','StopBandShape','linear','StopBandDecay',40);
Visualize the magnitude responses of the filters.
hfvt = fvtool([Hd1 Hd2]); legend(hfvt,'20 dB/rad/sample','40 dB/rad/sample')