main content

design fir or iir lowpass filter -凯发k8网页登录

design fir or iir lowpass filter

  • lowpass filter block

libraries:
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. you can specify the passband and stopband edge frequencies in hz or in normalized frequency units (since r2023a).

this block supports arm® cortex® code generation. under certain conditions, this block also supports simd code generation. for details, see code generation.

examples

ports

input

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

filtered signal, returned 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

specify whether the block implements an fir lowpass filter or an iir lowpass filter.

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.

specify the filter order of the lowpass filter as a positive integer.

dependencies

to enable this parameter, clear the design minimum order filter check box.

specify the passband edge frequency of the lowpass filter as a real positive scalar in hz or in normalized frequency units (since r2023a).

if you set the sample rate mode parameter to:

  • specify on dialog or inherit from input port –– the value of the passband edge frequency is in hz and must be less than half the value of the input sample rate.

  • use normalized frequency (0 to 1) –– the value of the passband edge frequency is in normalized frequency units. the value must be a positive scalar less than 1.0.

(since r2023a)

specify the stopband edge frequency of the lowpass filter as a real positive scalar in hz or in normalized frequency units (since r2023a).

if you set the sample rate mode parameter to:

  • specify on dialog or inherit from input port –– the value of the stopband edge frequency is in hz and must be less than half the value of the input sample rate.

  • use normalized frequency (0 to 1) –– the value of the stopband edge frequency is in normalized frequency units. the value must be a positive scalar less than 1.0.

(since r2023a)

dependencies

to enable this parameter, select the design minimum order filter check box.

specify the maximum ripple of the filter response in the passband as a real positive scalar in db.

specify the minimum attenuation in the stopband as a real positive scalar in db.

since r2023a

specify the input sample rate using one of these options:

  • specify on dialog –– specify the input sample rate in the block dialog box using the input sample rate (hz) parameter.

  • inherit from input port –– the block inherits the sample rate from the input signal.

  • use normalized frequency (0 to 1) –– specify the passband edge and the stopband edge frequencies in normalized frequency units (0 to 1).

specify the input sample rate as a scalar in hz.

dependencies

to enable this parameter, set the sample rate mode parameter to specify on dialog. (since r2023a)

opens the filter visualization tool () and displays the magnitude and 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:

  • 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

rounding method for the output fixed-point operations.

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

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

  • — 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 data type. for more information, see (simulink).

block characteristics

data types

double | fixed point | integer | single

direct feedthrough

no

multidimensional signals

no

variable-size signals

yes

zero-crossing detection

no

algorithms

extended capabilities

fixed-point conversion
design and simulate fixed-point systems using fixed-point designer™.

version history

introduced in r2015b

see also

blocks

objects

  • |

topics

    网站地图