This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English version of the page.

Note: This page has been translated by MathWorks. Click here to see
To view all translated materials including this page, select Country from the country navigator on the bottom of this page.

Variable Bandwidth FIR Filter

Design tunable bandwidth FIR filter

Library

Filtering / Filter Designs

dspfdesign

Description

The Variable Bandwidth FIR Filter block filters each channel of the input signal over time using specified FIR filter specifications. This block offers tunable filter design parameters, which enable you to tune the filter characteristics while the simulation is running.

The block designs the FIR filter according to the filter parameters set in the block dialog box. The output port properties, such as datatype, complexity, and dimension, are identical to the input port properties.

Each column of the input signal is treated as a separate channel. If the input is a two-dimensional signal, the first dimension represents the channel length (or frame size) and the second dimension represents the number of channels. If the input is a one-dimensional signal, then it is interpreted as a single channel.

This block supports variable-size input, enabling you to change the channel length during simulation. To enable variable-size input, clear the Inherit sample rate from input check box. The number of channels must remain constant.

Algorithms

This block brings the capabilities of dsp.VariableBandwidthFIRFilter System object™ to the Simulink® environment.

The FIR filter is designed using the window method. For information on the algorithms used by the Variable Bandwidth FIR Filter block, see the Algorithms section of dsp.VariableBandwidthFIRFilter.

Parameters

FIR filter order

Order of the FIR filter, specified as a positive integer scalar. The default is 30. This parameter is nontunable.

Filter type

Type of FIR filter. You can set this parameter to:

  • Lowpass (default)

  • Highpass

  • Bandpass

  • Bandstop

This parameter is nontunable.

Specify cutoff frequency from input port

When you select this check box, the cutoff frequency is input through the Fcut port. When you clear this check box, the cutoff frequency is specified on the block dialog through the Filter Cutoff frequency (Hz) parameter.

This parameter applies when you set Filter type to Lowpass or Highpass.

Filter Cutoff frequency (Hz)

Cutoff frequency of the FIR filter, specified as a real positive scalar that is less than half the sample rate of the input signal. This parameter applies when you set Filter type to Lowpass or Highpass, and clear the Specify cutoff frequency from input port parameter. The default is 1000. This parameter is tunable.

Specify center frequency from input port

When you select this check box, the center frequency is input through the Fc port. When you clear this check box, the center frequency is specified on the block dialog through the Filter center frequency (Hz) parameter.

This parameter applies when you set Filter type to Bandpass or Bandstop.

Filter center frequency (Hz)

Center frequency of the FIR filter, specified as a real positive scalar that is less than half the sample rate of the input signal. This parameter applies when you set Filter type to Bandpass or Bandstop, and clear the Specify center frequency from input port parameter. The default is 10000. This parameter is tunable.

Specify bandwidth from input port

When you select this check box, the filter bandwidth is input through the BW port. When you clear this check box, the filter bandwidth is specified on the block dialog through the Filter bandwidth (Hz) parameter.

This parameter applies when you set Filter type to Bandpass or Bandstop.

Filter bandwidth (Hz)

Bandwidth of the FIR filter, specified as a real positive scalar that is less than half the sample rate of the input signal. This parameter applies when you set Filter type to Bandpass or Bandstop, and clear the Specify bandwidth from input port parameter. The default is 2000. This parameter is tunable.

Window function

Window function used to design the FIR filter. You can set this parameter to:

  • Hann (default)

  • Hamming

  • Chebyshev

  • Kaiser

This parameter is nontunable.

Chebyshev window sidelobe attenuation (dB)

Sidelobe attenuation of chebyshev window, specified as a real positive scalar. This parameter applies when you set Window function to Chebyshev. The default is 60. This parameter is nontunable.

Kaiser window parameter

Kaiser window parameter, specified as a real scalar. This parameter applies when you set Window function to Kaiser. The default is 0.5. This parameter is nontunable.

Inherit sample rate from input

When you select this check box, the block’s sample rate is computed as N / Ts, where N is the frame size of the input signal and Ts is the sample time of the input signal. When you clear this check box, the block’s sample rate is the value specified in Input sample rate (Hz). By default, this check box is selected.

Input sample rate (Hz)

Sample rate of the input signal, specified as a positive scalar. The default is 44100. This parameter applies when you clear the Inherit sample rate from input check box. This parameter is nontunable.

View Filter Response

Opens the Filter Visualization Tool FVTool and displays the magnitude/phase response of the Variable Bandwidth FIR 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:

  • Code generation (default)

    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.

  • Interpreted execution

    Simulate model using the MATLAB®  interpreter. This option shortens startup time but has slower simulation speed than Code generation.

Supported Data Types

PortSupported Data Types

Input

  • Double-precision floating point

  • Single-precision floating point

Output

  • Double-precision floating point

  • Single-precision floating point

References

[1] Jarske, P., Y. Neuvo, and S. K. Mitra. "A Simple Approach to the Design of Linear Phase FIR Digital Filters with Variable Characteristics." Signal Processing 14, no. 4 *(1988): 313-326.

See Also

Biquad FilterDSP System Toolbox
Variable Bandwidth IIR FilterDSP System Toolbox
dsp.VariableBandwidthFIRFilterDSP System Toolbox
dsp.VariableBandwidthIIRFilterDSP System Toolbox

Extended Capabilities

C/C++ Code Generation
Generate C and C++ code using Simulink® Coder™.

Introduced in R2015a