(To be removed) Tunable second-order parametric equalizer filter
dsp.ParametricEQFilter object will be removed in a
future release. Existing instances of the object will continue to run. For new code, use
designParamEQ function from Audio Toolbox™ instead. For more information, see Compatibility Considerations.
ParametricEQFilter object is a tunable, second-order parametric
To apply the filter to each channel of the input:
Starting in R2016b, instead of using the
method to perform the operation defined by the System
object™, you can call the object with arguments, as if it were a function. For
y = step(obj,x) and
y = obj(x) perform
H = dsp.ParametricEQFilter returns a second-order parametric
equalizer filter that independently filters each channel of the input over time, using the
default values for
center frequency and
bandwidth are specified in Hz and are tunable. The
gain (dip) is specified in dB and is also tunable. The
bandwidth is measured at the arithmetic mean between the
peak gain in absolute power units and one.
H = dsp.ParametricEQFilter('Specification', 'Quality
factor and center frequency')
specifies the quality factor (Q factor) of the filter. The
Q factor is
defined as the center frequency/bandwidth. A higher
Q factor corresponds
to a narrower peak/dip. The Q factor should be a scalar value greater than 0. The Q factor
H = dsp.ParametricEQFilter('Specification', 'Coefficients')
specifies the gain values for the bandwidth and center frequency. This removes the
trigonometry calculations involved when the properties are tuned. The
CenterFrequencyCoefficient should be a scalar between -1 and 1, with
-1 corresponding to 0 Hz, and 1 corresponding to the Nyquist frequency. The
BandwidthCoefficient should be a scalar between -1 and 1, with -1
corresponding to the largest bandwidth, and 1 corresponding to the smallest bandwidth. In
this mode, the peak gain is specified in linear units rather than dB.
H = dsp.ParametricEQFilter('Name', Value, ...) returns a parametric
equalizer filter with each specified property name set to the specified value. You can
specify several name-value pair arguments in any order as
Design parameters or coefficients that specify the filter
Choose one of the following
The default value is
bandwidth of filter
Specify the bandwidth of the filter as a finite positive numeric scalar that is
less than half the sample rate of the input signal, in Hz. This property is
Coefficient for bandwidth of filter
Specify the value that determines the filter's bandwidth as a finite numeric
scalar in the range
This property is only applicable if
Center frequency of the filter
Specify the filter's center frequency as a finite positive numeric scalar that
is less than half the sample rate of the input signal, in Hz. This property is
only applicable if
Coefficient for center frequency of filter
Specify the value that determines the filter's center frequency as a finite numeric scalar between -1 and 1:
This property is only applicable if
This property is tunable.
Peak or dip gain of the filter in linear units
Specify the filter’s peak or dip gain in linear units. A value greater than one boosts the signal. A value less than one attenuates the signal. The default is 2 (6.0206 dB). This property is tunable.
Peak or dip gain of the filter in dB
Specify the filter’s peak or dip gain in dB. A positive value boosts the
signal. A negative value attenuates the signal. The default is
Quality factor of the parametric EQ filter
Specify the Quality factor (Q factor) of the filter. The Q factor is defined as
the center frequency divided by the bandwidth. A higher Q factor corresponds to a
narrower peak or dip. This property is only applicable if
Input sample rate
Specify the sample rate of the input as a finite numeric scalar, in Hz. The
|getBandwidth||Convert quality factor or bandwidth coefficient to bandwidth in Hz|
|getCenterFrequency||Convert center frequency coefficient to frequency in Hz|
|getOctaveBandwidth||Measure bandwidth of parametric equalizer filter in octaves|
|getPeakGain||Convert peak or notch gain from dB to absolute units|
|getPeakGaindB||Convert peak or notch gain from absolute units to dB|
|getQualityFactor||Convert bandwidth to quality factor|
|reset||Reset states of |
|step||Filter input with |
|tf||Compute transfer function|
|Common to All System Objects|
Allow System object property value changes
ParametricEQFilter object where the center
frequency and bandwidth of the equalizer filter are 5000 Hz and 500 Hz
respectively. The sample rate for the filter is the default, 44,100 Hz.
h = dsp.ParametricEQFilter('CenterFrequency',5000,... 'Bandwidth',500);
Create objects to estimate and display the transfer function of the filter.
htf = dsp.TransferFunctionEstimator('FrequencyRange','onesided',... 'SpectralAverages',50); hplot = dsp.ArrayPlot('PlotType','Line','YLimits',[-15 15],... 'SampleIncrement',44100/1024);
Generate a random signal and filter the signal.
for i=1:1000 x = randn(1024,1); % Random signal y = h(x); % Filter signal H = htf(x,y); % Estimate transfer function magdB = 20*log10(abs(H));% Convert to dB hplot(magdB); % Display transfer function if (i==1) % Pause to display initial transfer function pause; end if (i==500) % Tune filter h.CenterFrequency = 10000; h.Bandwidth = 2000; h.PeakGaindB = -10; end end
The software displays the initial transfer function estimate.
To continue, press any key.
i=500, the filter is tuned. The center frequency,
bandwidth, and peak gain of the filter now have different values. The software
displays the new transfer function.
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.
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:
G is the parametric equalizer gain, and GB is the bandwidth gain, that is, the gain level at which the bandwidth Δω is measured.
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.
 Orfanidis, Sophocles J. Introduction to Signal Processing Upper Saddle River, NJ: Prentice-Hall, 1996
dsp.ParametricEQFilterSystem object will be removed
Warns starting in R2019a
object will be removed in a future release. Existing instances of the object
continue to run. For new code, use the
function from Audio Toolbox instead.
This table shows typical usage of the System object and explains how to update existing code to use the equivalent function.
|Discouraged Usage||Recommended Replacement|
eq = dsp.ParametricEQFilter;
eq = dsp.ParametricEQFilter('Specification',... 'Quality factor and center frequency');
eq = dsp.ParametricEQFilter('Specification',... 'Bandwidth and center frequency');
Bandwidth is the ratio of the center frequency to the quality factor.
%% Parameters Fs = 44100; Fo = 11025; Bw = 2205; G = 6.0206; N = 2; Wo = Fo/(Fs/2); BW = Bw/(Fs/2); %% Design [B, A] = designParamEQ(N,G,Wo,BW, 'fos'); fos = dsp.FourthOrderSectionFilter(B.',A.');