Design FIR or IIR lowpass filter
Filtering / Filter Designs
dspfdesign
The Lowpass Filter block independently filters each channel of the input signal over time using the given design specifications.
You can set the Filter type parameter of the block to implement the block as an FIR or IIR lowpass filter. The block design the filter based on the parameters specified in the block dialog box.
The input signal can be a real or complexvalued column vector or matrix. If the input signal is a matrix, each column of the matrix is treated as an independent channel. The block supports fixedpoint operations, HDL code generation, and ARM^{®} Cortex^{®} code generation. To learn more about ARM Cortex code generation, see ARM CortexM and ARM CortexA Optimization
This block brings the capabilities of the dsp.LowpassFilter
System object™ to
the Simulink^{®} environment.
For information on the algorithms used by this block, see the Algorithms section
of dsp.LowpassFilter
system object.
Parameters
Type of lowpass filter.
FIR
(default) —
Design an FIR lowpass filter.
IIR
— Design an
IIR lowpass filter.
When you select this check box, the block designs a filter with the minimum order that the specified passband, stopband frequency, passband ripple, and stopband attenuation. Set these specifications using the corresponding parameters. When you clear this check box, specify the order of the filter in Filter order.
By default, this check box is selected.
Filter order of lowpass filter, specified as a positive scalar
integer. You can specify the filter order is only when Design
minimum order filter check box is cleared. The default
is 50
.
Passband edge frequency of the lowpass filter, specified as
a real positive scalar in Hz. The passband edge frequency must be
less than half the value of the Input sample rate (Hz).
The default is 8e3
.
Stopband edge frequency of the lowpass filter, specified as
a real positive scalar in Hz. The stopband edge frequency must be
less than half the value of the Input sample rate (Hz).
You can specify the stopband edge frequency only when the Design
minimum order filter is selected. The default is 12e3
.
Maximum ripple of the filter response in the passband, specified
as a real positive scalar in dB. The default is 0.1
.
Minimum attenuation in the stopband, specified as a real positive
scalar in dB. The default is 80
.
When you select this check box, the block inherits its sample rate from the input signal. When you clear this check box, you specify the sample rate in Input sample rate (Hz).
Input sample rate, specified as a scalar in Hz. The default
is 44100
.
Opens the Filter Visualization Tool FVTool and displays the magnitude/phase response of the Lowpass Filter. The response is based on the block dialog box parameters. Changes made to these parameters update FVTool.
To update the magnitude response while FVTool is running, modify the dialog box parameters and click Apply.
Type of simulation to run. You can set this parameter to:
Interpreted execution
(default)
Simulate model using the MATLAB^{®} interpreter. This
option shortens startup time but has slower simulation speed than Code
generation
.
Code generation
Simulate model using generated C code. The first time you run
a simulation, Simulink generates C code for the block. The C
code is reused for subsequent simulations, as long as the model does
not change. This option requires additional startup time but provides
faster simulation speed than Interpreted execution
.
Rounding method for the output fixedpoint operations. The rounding
methods are Ceiling
, Convergent
, Floor
, Nearest
, Round
, Simplest
,
and Zero
. The default is Floor
.
Fixedpoint data type of the coefficients, specified as one of the following:
fixdt(1,16)
(default)
— Signed fixedpoint data type of word length 16
,
with binary point scaling. The block determines the fraction length
automatically from the coefficient values in such a way that the coefficients
occupy maximum representable range without overflowing.
fixdt(1,16,0)
—
Signed fixedpoint data type of word length 16
and
fraction length, 0
. You can change the fraction
length to any other integer value.
<data type expression>
—
Specify the data type using an expression that evaluates to a data
type object, for example, numeric type (fixdt
([
]
,16
, 15
)). Specify
the sign mode of this data type as [ ]
or true
.
Refresh Data Type
— Refresh
to the default data type.
Click the Show data type assistant button to display the data type assistant, which helps you set the stage input parameter.
See Specify Data Types Using Data Type Assistant for more information.
Port  Supported Data Types 

Input 

Output 

dsp.HighpassFilter  DSP System Toolbox 
dsp.Lowpassfilter  DSP System Toolbox 
Highpass Filter  DSP System Toolbox 