Lowpass Filter
Design FIR or IIR lowpass filter
- Library:
DSP System Toolbox / Filtering / Filter Designs
Description
The Lowpass Filter block independently filters each channel of the input signal over time using the filter design specified by the block parameters. You can control whether the block implements an IIR or FIR lowpass filter using the Filter type parameter.
This block supports ARM® Cortex® code generation. Under specific conditions, this block also supports SIMD code generation. For details, see Code Generation.
Ports
Input
Port_1
— Input signal to filter
column vector | matrix
Input signal, specified as a real- or complex-valued column vector or matrix. If the input signal is a matrix, each column of the matrix is treated as an independent channel. The number of rows in the input signal denotes the channel length.
Data Types: single
| double
| int8
| int16
| int32
| int64
| uint8
| uint16
| uint32
| uint64
| fixed point
Complex Number Support: Yes
Output
Port_1
— Filtered signal
vector | matrix
Filtered signal, specified as a vector or matrix. The output has the same size, data type, and complexity characteristics as the input.
Data Types: single
| double
| int8
| int16
| int32
| int64
| uint8
| uint16
| uint32
| uint64
| fixed point
Complex Number Support: Yes
Parameters
Main
Filter type
— FIR or IIR filter
FIR
(default) | IIR
Specify whether the block implements an FIR lowpass filter or an IIR lowpass filter.
Design minimum order filter
— Design filter with minimum order
on
(default) | off
When you select this check box, the block designs a filter with the minimum order and the specified passband, stopband frequency, passband ripple, and stopband attenuation.
When you clear this check box, you can specify the Filter order as a positive integer.
Filter order
— Order of lowpass filter
50
(default) | positive integer
Filter order of lowpass filter, specified as a positive scalar integer.
Dependencies
To enable this parameter, clear the Design minimum order filter check box.
Passband edge frequency (Hz)
— Passband edge frequency
8e3
(default) | real positive scalar
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).
Stopband edge frequency (Hz)
— Stopband edge frequency
12e3
(default) | real positive scalar
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).
Dependencies
To enable this parameter, select the Design minimum order filter check box.
Maximum passband ripple (dB)
— Maximum passband ripple
0.1
(default) | real positive scalar
Maximum ripple of the filter response in the passband, specified as a real positive scalar in dB.
Minimum stopband attenuation (dB)
— Minimum stopband attenuation
80
(default) | real positive scalar
Minimum attenuation in the stopband, specified as a real positive scalar in dB.
Inherit sample rate from input
— Inherit sample rate from input
off
(default) | on
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 using the Input sample rate (Hz) parameter.
Input sample rate (Hz)
— Input sample rate
44100
(default) | scalar
Input sample rate, specified as a scalar in Hz.
Dependencies
To enable this parameter, clear the Inherit sample rate from input check box.
Simulate using
— Type of simulation to run
Interpreted
execution
(default) | Code generation
Type of simulation to run:
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
.
View Filter Response
— Open Filter Visualization Tool
button
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.
Data Types
Rounding mode
— Rounding method
Floor
(default) | Ceiling
| Convergent
| Nearest
| Round
| Simplest
| Zero
Rounding method for the output fixed-point operations.
Coefficients
— Coefficient data type
fixdt(1,16)
(default) | fixdt(1,16,0)
| <data type expression>
Fixed-point data type of the coefficients, specified as one of the following:
fixdt(1,16)
— Signed fixed-point data type of word length16
, 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 fixed-point data type of word length16
and fraction length0
. 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[ ]
ortrue
.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 data type. For more information, see Specify Data Types Using Data Type Assistant (Simulink).
Model Examples
Block Characteristics
Data Types |
|
Direct Feedthrough |
|
Multidimensional Signals |
|
Variable-Size Signals |
|
Zero-Crossing Detection |
|
Algorithms
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 the
dsp.LowpassFilter
System object.
Extended Capabilities
C/C++ Code Generation
Generate C and C++ code using Simulink® Coder™.
The Lowpass Filter block supports ARM Cortex code generation. To learn more about ARM Cortex code generation, see Code Generation for ARM Cortex-M and ARM Cortex-A Processors.
The Lowpass Filter block also supports SIMD code generation using Intel AVX2 technology under these conditions:
Filter type is set to
FIR
.Input signal has a data type of
single
ordouble
.
The SIMD technology significantly improves the performance of the generated code.
Fixed-Point Conversion
Design and simulate fixed-point systems using Fixed-Point Designer™.
Version History
Introduced in R2015b
See Also
Blocks
Objects
Commande MATLAB
Vous avez cliqué sur un lien qui correspond à cette commande MATLAB :
Pour exécuter la commande, saisissez-la dans la fenêtre de commande de MATLAB. Les navigateurs web ne supportent pas les commandes MATLAB.
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list:
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)