Documentation

Lowpass Filter

Design FIR or IIR lowpass filter

Library

Filtering / Filter Designs

dspfdesign

Description

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 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 block supports fixed-point operations, HDL code generation, and ARM® Cortex® code generation. To learn more about ARM Cortex code generation, see ARM Cortex-M and ARM Cortex-A Optimization

Algorithm

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.

Dialog Box

Main Tab

Parameters

Filter type

Type of lowpass filter.

  • FIR (default) — Design an FIR lowpass filter.

  • IIR — Design an IIR lowpass filter.

Design minimum order 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

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 (Hz)

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 (Hz)

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 passband ripple (dB)

Maximum ripple of the filter response in the passband, specified as a real positive scalar in dB. The default is 0.1.

Minimum stopband attenuation (dB)

Minimum attenuation in the stopband, specified as a real positive scalar in dB. The default is 80.

Inherit sample rate from input

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 (Hz)

Input sample rate, specified as a scalar in Hz. The default is 44100.

View Filter Response

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.

Simulate using

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.

Data Types Tab

Rounding mode

Rounding method for the output fixed-point operations. The rounding methods are Ceiling, Convergent, Floor, Nearest, Round, Simplest, and Zero. The default is Floor.

Coefficients

Fixed-point data type of the coefficients, specified as one of the following:

  • fixdt(1,16) (default) — Signed fixed-point 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 fixed-point 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.

Supported Data Types

PortSupported Data Types

Input

  • Double-precision floating point

  • Single-precision floating point

  • Fixed point (signed or unsigned)

Output

  • Double-precision floating point

  • Single-precision floating point

  • Fixed point (signed or unsigned)

See Also

dsp.HighpassFilterDSP System Toolbox
dsp.LowpassfilterDSP System Toolbox
Highpass FilterDSP System Toolbox

Introduced in R2015b

Was this topic helpful?