Contents

Peak-Notch Filter

Design peak or notch filter

Library

Filtering / Filter Designs

dspfdesign

Description

This block brings the filter design capabilities of the filterbuilder function to the Simulink® environment.

Dialog Box

See Peak/Notch Filter Design Dialog Box — Main Pane for more information about the parameters of this block. The Data Types and Code Generation panes are not available for blocks in the DSP System Toolbox™ Filter Designs library.

Parameters of this block that do not change filter order or structure are tunable.

View filter response

This button opens the Filter Visualization Tool (fvtool) from the Signal Processing Toolbox™ product. You can use the tool to display:

  • Magnitude response, phase response, and group delay in the frequency domain.

  • Impulse response and step response in the time domain.

  • Pole-zero information.

The tool also helps you evaluate filter performance by providing information about filter order, stability, and phase linearity. For more information on FVTool, see the Signal Processing Toolbox documentation.

Filter Specifications

In this area you can specify whether you want to design a peaking filter or a notching filter, as well as the order of the filter.

Response

Select Peak or Notch from the drop-down list. The rest of the parameters that specify are equivalent for either filter type.

Order

Enter the filter order. The order must be even.

Frequency Specifications

This group of parameters allows you to specify frequency constraints and units.

Frequency Constraints

Select the frequency constraints for filter specification. There are two choices as follows:

  • Center frequency and quality factor

  • Center frequency and bandwidth

Frequency units

The frequency units are normalized by default. If you specify units other than normalized, the block assumes that you wish to specify an input sampling frequency, and enables this input box. The choice of frequency units are: Normalized (0 to 1), Hz, kHz, MHz, GHz.

Input Fs

This input box is enabled if Frequency units other than Normalized (0 to 1) are specified. Enter the input sampling frequency.

Center frequency

Enter the center frequency in the units specified previously.

Quality Factor

This input box is enabled only when Center frequency and quality factor is chosen for the Frequency Constraints. Enter the quality factor.

Bandwidth

This input box is enabled only when Center frequency and bandwidth is chosen for the Frequency Constraints. Enter the bandwidth.

Magnitude Specifications

This group of parameters allows you to specify the magnitude constraints, as well as their values and units.

Magnitude Constraints

Depending on the choice of constraints, the other input boxes are enabled or disabled. Select from four magnitude constraints available:

  • Unconstrained

  • Passband ripple

  • Stopband attenuation

  • Passband ripple and stopband attenuation

Magnitude units

Select the magnitude units: either dB or squared.

Apass

This input box is enabled if the magnitude constraints selected are Passband ripple or Passband ripple and stopband attenuation. Enter the passband ripple.

Astop

This input box is enabled if the magnitude constraints selected are Stopband attenuation or Passband ripple and stopband attenuation. Enter the stopband attenuation.

Algorithm

The parameters in this group allow you to specify the design method and structure of your filter.

Design Method

Lists all design methods available for the frequency and magnitude specifications you entered. When you change the specifications for a filter the methods available to design filters changes as well.

Scale SOS filter coefficients to reduce chance of overflow

Selecting this parameter directs the design to scale the filter coefficients to reduce the chances that the inputs or calculations in the filter overflow and exceed the representable range of the filter. Clearing this option removes the scaling. This parameter applies only to IIR filters.

Filter Implementation

Structure

Specify filter structure. Choose from:

  • Direct-form I SOS

  • Direct-form II SOS

  • Direct-form I transposed SOS

  • Direct-form II transposed SOS

Use basic elements to enable filter customization

Select this check box to implement the filter as a subsystem of basic Simulink blocks. Clear the check box to implement the filter as a high-level subsystem. By default, this check box is cleared.

The high-level implementation provides better compatibility across various filter structures, especially filters that would contain algebraic loops when constructed using basic elements. On the other hand, using basic elements enables the following optimization parameters:

  • Optimize for zero gains — Terminate chains that contain Gain blocks with a gain of zero.

  • Optimize for unit gains — Remove Gain blocks that scale by a factor of one.

  • Optimize for delay chains — Substitute delay chains made up of n unit delays with a single delay by n.

  • Optimize for negative gains — Use subtraction in Sum blocks instead of negative gains in Gain blocks.

Optimize for unit-scale values

Select this check box to scale unit gains between sections in SOS filters. This parameter is available only for SOS filters.

Input processing

Specify how the block should process the input. The available options may vary depending on he settings of the Filter Structure and Use basic elements for filter customization parameters. You can set this parameter to one of the following options:

  • Columns as channels (frame based) — When you select this option, the block treats each column of the input as a separate channel.

  • Elements as channels (sample based) — When you select this option, the block treats each element of the input as a separate channel.

    Note:   The Inherited (this choice will be removed — see release notes) option will be removed in a future release. See Frame-Based Processing in the DSP System Toolbox Release Notes for more information.

Rate options

When the Filter type parameter specifies a multirate filter, select the rate processing rule for the block from following options:

  • Enforce single-rate processing — When you select this option, the block maintains the sample rate of the input.

  • Allow multirate processing — When you select this option, the block adjusts the rate at the output to accommodate an increased or reduced number of samples. To select this option, you must set the Input processing parameter to Elements as channels (sample based).

Use symbolic names for coefficients

Select this check box to enable the specification of coefficients using MATLAB® variables. The available coefficient names differ depending on the filter structure. Using symbolic names allows tuning of filter coefficients in generated code. By default, this check box is cleared.

Supported Data Types

PortSupported Data Types

Input

  • Double-precision floating point

  • Single-precision floating point

Output

  • Double-precision floating point

  • Single-precision floating point

Was this topic helpful?