Parametric EQ Filter (Obsolete)
(Removed) Model secondorder parametric equalizer filter
Note
The Parametric EQ Filter block requires Audio Toolbox™. Existing models using the Parametric EQ Filter block continue to run. For new models, use the Parametric EQ block from Audio Toolbox.
Library
dspobslib
Description
The Parametric EQ Filter block filters each channel of the input signal over time using a specified center frequency, bandwidth, and peak (dip) gain. This block offers tunable filter design parameters, which enable you to tune the filter characteristics while the simulation is running.
The block designs the 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 twodimensional 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 onedimensional signal, then it is interpreted as a single channel.
This block supports variablesize input, enabling you to change the channel length during simulation. To enable variablesize input, clear the Inherit sample rate from input check box. The number of channels must remain constant.
Parameters
 Filter specification
Parameters or coefficients used to design the filter, specified as one of the following:
Bandwidth and center frequency
(default) — Design the filter using Filter bandwidth (Hz), Equalizer center frequency (Hz), and Gain (dB).Coefficients
— Design the filter using Bandwidth coefficient, Center frequency coefficient, and Gain (Linear Units).Quality factor and center frequency
— Design the filter using Equalizer center frequency (Hz), Gain (dB), and Quality factor.
This parameter is nontunable.
 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 specification to
Bandwidth and center frequency
. Filter bandwidth (Hz)
Bandwidth of the filter, specified as a finite positive numeric scalar that is less than half the sample rate of the input signal. This parameter applies when you set Filter specification to
Bandwidth and center frequency
and clear the Specify bandwidth from input port parameter. The default is2205
. This parameter is tunable. Specify center frequency from input port
When you select this check box, the equalizer center frequency is input through the Fc port. When you clear this check box, the equalizer center frequency is specified on the block dialog through the Equalizer center frequency (Hz) parameter.
This parameter applies when you set Filter specification to
Bandwidth and center frequency
orQuality factor and center frequency
. Equalizer center frequency (Hz)
Center frequency of the filter, specified as a finite positive scalar that is less than half the sample rate of the input signal. This parameter applies when you set Filter specification to
Bandwidth and center frequency
orQuality factor and center frequency
, and clear the Specify center frequency from input port parameter. The default is11025
. This parameter is tunable. Specify gain (dB) from input port
When you select this check box, the peak or dip gain of the filter in dB is input through the PGaindB port. When you clear this check box, the filter gain is specified on the block dialog through the Gain (dB) parameter.
This parameter applies when you set Filter specification to
Bandwidth and center frequency
orQuality factor and center frequency
. Gain (dB)
Peak or dip gain of the filter, specified as a real scalar in dB. A value greater than zero corresponds to a peak. A value less than zero corresponds to a dip. This parameter applies when you set Filter specification to
Bandwidth and center frequency
orQuality factor and center frequency
, and clear the Specify gain (dB) from input port parameter. The default is6.0206
. This parameter is tunable. Specify bandwidth coefficient from input port
When you select this check box, the bandwidth coefficient is input through the BWCoeff port. When you clear this check box, the bandwidth coefficient is specified on the block dialog through the Bandwidth coefficient parameter.
This parameter applies when you set Filter specification to
Coefficients
. Bandwidth coefficient
Coefficient that determines the filter bandwidth, specified as a finite numeric scalar in the range
[1 1]
.1
corresponds to the maximum bandwidth (onefourth the sample rate of the input signal).1
corresponds to the minimum bandwidth (0 Hz, that is, an allpass filter).
This parameter applies when you set Filter specification to
Coefficients
and clear the Specify bandwidth coefficient from input port parameter. The default is0.72654
. This parameter is tunable. Specify center frequency coefficient from input port
When you select this check box, the center frequency coefficient is input through the FcCoeff port. When you clear this check box, the center frequency coefficient is specified on the block dialog through the Center frequency coefficient parameter.
This parameter applies when you set Filter specification to
Coefficients
. Center frequency coefficient
Coefficient that determines the center frequency of the filter, specified as a finite numeric scalar in the range
[1 1]
.1
corresponds to the minimum center frequency (0
Hz).1
corresponds to the maximum center frequency (half the sample rate of the input signal).
This parameter applies when you set Filter specification to
Coefficients
and clear the Specify center frequency coefficient from input port parameter. The default is0
, which corresponds to onefourth the sample rate of the input signal. This parameter is tunable. Specify gain from input port
When you select this check box, the peak or dip gain of the filter in linear units is input through the PGain port. When you clear this check box, the filter gain is specified on the block dialog through the Gain (Linear Units) parameter.
This parameter applies when you set Filter specification to
Coefficients
. Gain (Linear Units)
Peak or dip gain of the filter, specified as a real positive scalar in linear units. A value greater than one boosts the input signal. A value less than one attenuates the input signal. This parameter applies when you set Filter specification to
Coefficients
and clear the Specify gain from input port parameter. The default is2
. This parameter is tunable. Specify quality factor from input port
When you select this check box, the quality factor is input through the Q port. When you clear this check box, the quality factor is specified on the block dialog through the Quality factor parameter.
This parameter applies when you set Filter specification to
Quality factor and center frequency
. Quality factor
Quality factor of the filter, specified as a real positive scalar. The quality factor is defined as Equalizer center frequency (Hz) / Filter bandwidth (Hz). A higher quality factor corresponds to a narrower peak or dip. This parameter applies when you set Filter specification to
Quality factor and center frequency
and clear the Specify quality factor from input port parameter. The default is5
. This parameter is tunable. 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 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 value. 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 Parametric EQ 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
Port  Supported Data Types 

Input 

Output 

References
[1] Orfanidis, Sophocles J. Introduction to Signal Processing . Upper Saddle River, NJ: PrenticeHall, 1996.
Algorithms
The parametric equalizer is formed by a linear combination of a peak and a notch
filter. See the Algorithm section of dsp.NotchPeakFilter
for details.
$$H(z)={H}_{notch}(z)+G{H}_{peak}(z)$$
Here is a graph of the two cases (boost and cut) of the magnitude squared of the transfer functions:
The transfer function can be written as:
$$\begin{array}{l}H(z)=\frac{(\frac{1+G\gamma}{1+\gamma})2(\frac{\mathrm{cos}{\omega}_{0}}{1+\gamma}){z}^{1}+(\frac{1G\gamma}{1+\gamma}){z}^{2}}{12(\frac{\mathrm{cos}{\omega}_{0}}{1+\gamma}){z}^{1}+(\frac{1\gamma}{1+\gamma}){z}^{2}}\\ where\\ \gamma =\mathrm{tan}(\frac{\Delta \omega}{2})\\ and\\ {G}_{B}{}^{2}=\frac{1+{G}^{2}}{2}\end{array}$$
G is the parametric equalizer gain, and G_{B} is the bandwidth gain, that is, the gain level at which the bandwidth Δω is measured.
The dsp.NotchPeakFilter
that does most of the
work is implemented in a decoupled way so that the center frequency can be tuned
independently from the bandwidth. Note that the Q factor is defined as center
frequency/bandwidth.
Extended Capabilities
Version History
Introduced in R2015a