Main Content

Variable Bandwidth FIR Filter

Design tunable bandwidth FIR filter

  • Variable Bandwidth FIR Filter block

Libraries:
DSP System Toolbox / Filtering / Filter Designs

Description

TheVariable Bandwidth FIR Filterblock filters each channel of the input signal over time using the 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 specified in the block dialog box. The output port properties, such as datatype, complexity, and dimension, are identical to the input port properties.

This block also supports SIMD code generation. For details, seeCode Generation.

Ports

Input

expand all

Specify the data input as a vector or a matrix. The block treats each column of the input signal 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 the block interprets it as having a single channel.

The block accepts variable-size input signals, that is, you can change the size of each input channel during simulation but you cannot change the number of channels.

这个港口是不知名的,直到你选择其中的一个parameters:

  • Specify cutoff frequency from input port

  • Specify center frequency from input port

  • Specify bandwidth from input port

Data Types:single|double
Complex Number Support:Yes

Specify the cutoff frequency of the FIR filter as a real positive scalar in Hzor in normalized frequency units(since R2023a).

Dependencies

To enable this port, select theSpecify cutoff frequency from input portparameter.

Data Types:single|double

Specify the center frequency of the FIR filter as a real positive scalar in Hzor in normalized frequency units(since R2023a).

Dependencies

To enable this port, select theSpecify center frequency from input portparameter.

Data Types:single|double

Specify the bandwidth of the FIR filter as a real positive scalar in Hzor in normalized frequency units(since R2023a).

Dependencies

To enable this port, select theSpecify bandwidth from input portparameter.

Data Types:single|double

Output

expand all

Filtered output, returned as a vector or a matrix. The size, data type, and complexity of the output signal matches that of the input signal.

Data Types:single|double
Complex Number Support:Yes

Parameters

expand all

Specify the order of the FIR filter as a positive integer scalar.

Specify the type of FIR filter. You can set this parameter to:

  • Lowpass

  • Highpass

  • Bandpass

  • Bandstop

When you select this check box, specify the cutoff frequency through theFcutport. When you clear this check box, specify the cutoff frequency in the block dialog box through theFilter cutoff frequencyparameter.

Dependency

To enable this parameter, setFilter typetoLowpassorHighpass.

Specify the cutoff frequency of the FIR filter as a real positive scalar in Hzor in normalized frequency units(since R2023a).

If you set theSample rate modeparameter to:

  • Specify on dialogorInherit from input port——滤波器截止频率的值Hz and must be less than half the value of the input sample rate.

  • Use normalized frequency (0 to 1)——滤波器截止频率的值normalized frequency units. The value must be a positive scalar less than1.0.

(since R2023a)

Tunable:Yes

Dependencies

To enable this parameter:

  • SetFilter typetoLowpassorHighpass.

  • Clear theSpecify cutoff frequency from input portparameter.

When you select this check box, specify the center frequency through theFcport. When you clear this check box, specify the center frequency in the block dialog box through theFilter center frequencyparameter.

Dependencies

To enable this parameter, setFilter typetoBandpassorBandstop.

Specify the center frequency of the FIR filter as a real positive scalar in Hzor in normalized frequency units(since R2023a).

If you set theSample rate modeparameter to:

  • Specify on dialogorInherit from input port–– The value of the filter center 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 filter center frequency is in normalized frequency units. The value must be a positive scalar less than1.0.

(since R2023a)

Tunable:Yes

Dependencies

To enable this parameter:

  • SetFilter typetoBandpassorBandstop.

  • Clear theSpecify center frequency from input portparameter.

When you select this check box, specify the filter bandwidth through theBWport. When you clear this check box, specify the filter bandwidth in the block dialog box through theFilter bandwidthparameter.

Dependency

To enable this parameter, setFilter typetoBandpassorBandstop.

Specify the bandwidth of the FIR filter as a real positive scalar in Hzor in normalized frequency units(since R2023a).

If you set theSample rate modeparameter to:

  • Specify on dialogorInherit from input port–– The value of the filter bandwidth 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 filter bandwidth is in normalized frequency units. The value must be a positive scalar less than1.0.

(since R2023a)

Tunable:Yes

Dependencies

To enable this parameter:

  • SetFilter typetoBandpassorBandstop.

  • Clear theSpecify bandwidth from input portparameter.

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

  • Hann

  • Hamming

  • Chebyshev

  • Kaiser

Specify the sidelobe attenuation of the Chebyshev window as a real positive scalar.

Dependencies

To enable this parameter, setWindow functiontoChebyshev.

Specify the Kaiser window parameter as a real scalar.

Dependencies

To enable this parameter, setWindow functiontoKaiser.

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 theInput sample rate (Hz)parameter.

  • Inherit from input port–– The block inherits the sample rate from the input signal asN/Ts, whereNis the frame size of the input signal andTsis the sample time of the input signal.

  • Use normalized frequency (0 to 1)–– Specify the filter cutoff frequency, center frequency, and the filter bandwidth in normalized frequency units (0 to 1).

Specify the sample rate of the input signal as a positive scalar in Hz.

Dependencies

To enable this parameter, set theSample rate modeparameter toSpecify on dialog.(since R2023a)

Open the dynamic filter visualizer and display the magnitude response of the variable bandwidth FIR filter. The response is based on the parameters you select in the block dialog box. To update the magnitude response while the dynamic filter visualizer is running, modify the parameters in the dialog box and clickApply.

You can configure the plot settings and the signal measurements from the interface of the visualizer.

On thePlottab, theConfigurationsection allows you to modify the plot settings.

Plot tab contains legend, magnitude phase button, and settings. Generate script, copy display and print sections are also in this tab.

On theMeasurementstab, you can measure the signal statistics, place data cursors, and display the peak values of the selected signal.

Measurements tab contains 3 sections - select channel, modify data cursor settings, and modify peak finder settings.

For more details on the dynamic filter visualizer interface and its tools, seedsp.DynamicFilterVisualizer.

Specify the 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 thanInterpreted execution.

  • Interpreted execution

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

Block Characteristics

Data Types

double|single

Multidimensional Signals

No

Variable-Size Signals

Yes

Algorithms

expand all

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.

Extended Capabilities

Version History

Introduced in R2015a

expand all