Main Content

iirparameq

(Removed) IIR biquad digital parametric equalizer filter

The iirparameq function has been removed. Use the designParamEQ (Audio Toolbox) function instead. For more information on how to update your existing code, see Version History.

Description

[SOS,SV] = iirparameq(N,G,Wo,BW) returns the coefficients of an Nth order IIR biquad digital parametric equalizer with gain G, center frequency Wo, and bandwidth BW. The coefficients are returned in a second-order section matrix, SOS, and a vector of scale values between each biquad stage, SV.

example

[SOS,SV,B,A] = iirparameq(N,G,Wo,BW) additionally returns a matrix of numerator fourth-order sections, B, and a matrix A of denominator fourth-order sections, A. These can be used in lieu of a biquad implementation and are useful for the case Wo = 0.5.

example

Examples

collapse all

Compute the second-order section matrix and scale values of a parametric equalizer.

[SOS,SV] = iirparameq(6,5,0.0042,0.0028)
SOS =

    1.0000   -1.9892    0.9894    1.0000   -1.9911    0.9912
    1.0000   -1.9926    0.9929    1.0000   -1.9941    0.9944
    1.0000   -1.9964    0.9965    1.0000   -1.9967    0.9968

SV =

    1.0009
    1.0000
    1.0009
    1.0000

Compute the numerator and denominator coefficients of the fourth-order sections of the parametric equalizer.

[SOS,SV,B,A] = iirparameq(6,5,0.0042,0.0028)
SOS =

    1.0000   -1.9892    0.9894    1.0000   -1.9911    0.9912
    1.0000   -1.9926    0.9929    1.0000   -1.9941    0.9944
    1.0000   -1.9964    0.9965    1.0000   -1.9967    0.9968

SV =

    1.0009
    1.0000
    1.0009
    1.0000

B =

    1.0009   -1.9911    0.9903         0         0
    1.0009   -3.9927    5.9729   -3.9715    0.9903

A =

    1.0000   -1.9911    0.9912         0         0
    1.0000   -3.9908    5.9729   -3.9733    0.9912

Design two equalizers centered at 100 Hz and 1000 Hz respectively, both with a gain of 5 dB and a Q-factor of 1.5, for a system running at 48 kHz.

Fs  = 48e3;
N   = 6;
G   = 5;
Q   = 1.5;
Wo1 = 100/(Fs/2);
Wo2 = 1000/(Fs/2);
% Obtain the bandwidth of the equalizers from the center frequencies and
% Q-factors.
BW1 = Wo1/Q;
BW2 = Wo2/Q;
% Design the equalizers and obtain their SOS and SV values.
[SOS1,SV1] = iirparameq(N,G,Wo1,BW1);  
[SOS2,SV2] = iirparameq(N,G,Wo2,BW2);

Design biquad filters using the obtained SOS and SV values.

BQ1 = dsp.BiquadFilter('SOSMatrix',SOS1,'ScaleValues',SV1);
BQ2 = dsp.BiquadFilter('SOSMatrix',SOS2,'ScaleValues',SV2);

Plot the magnitude response of both filters using a log scale.

fvtool(BQ1,BQ2,'Fs',Fs,'FrequencyScale','Log');
legend('Equalizer centered at 100 Hz','Equalizer centered at 1000 Hz');

Design an eighth-order notch filter and compare it to a traditional second-order notch filter designed with IIRNOTCH.

Fs  = 44.1e3;
N   = 8;
G   = -inf;
Q   = 1.8;
Wo  = 60/(Fs/2); % Notch at 60 Hz
BW  = Wo/Q; % Bandwidth occurs at -3 dB for this special case
[SOS1,SV1] = iirparameq(N,G,Wo,BW);  
[NUM,DEN]  = iirnotch(Wo,BW); 
SOS2 = [NUM,DEN];

Design the notch filters using the SOS and SV values.

BQ1 = dsp.BiquadFilter('SOSMatrix',SOS1,'ScaleValues',SV1);
BQ2 = dsp.BiquadFilter('SOSMatrix',SOS2);

Plot the magnitude response of both filters. The filters intersect at -3 dB point.

FVT = fvtool(BQ1,BQ2,'Fs',Fs,'FrequencyScale','Log');
legend(FVT,'8th order notch filter','2nd order notch filter');

Input Arguments

collapse all

Order of the parametric equalizer, specified as an even positive integer.

Example: 6

Example: 10

Data Types: single | double

Gain of the parametric equalizer in dB, specified as a real scalar.

Example: 2

Example: -2.2

Data Types: single | double

Center frequency of the parametric equalizer, specified as a real scalar in the range [0.0 1.0]. A value of 1.0 corresponds to π radians/sample.

Example: 0.0

Example: 1.0

Data Types: single | double

Bandwidth of the parametric equalizer, specified as a real scalar in the range [0.0 1.0]. A value of 1.0 corresponds to π radians/sample.

Example: 0.0

Example: 1.0

Data Types: single | double

Output Arguments

collapse all

Second-order section matrix, returned as a real-valued L-by-6 matrix, where L is the number of second-order sections of the filter.

Scale values between each biquad stage, returned as a real-valued vector of length L + 1.

Numerator coefficients of the fourth-order sections of the parametric equalizer, returned as a real-valued M-by-5 matrix. M is the number of fourth-order sections of the filter.

Denominator coefficients of the fourth-order sections of the parametric equalizer, returned as a real-valued M-by-5 matrix. M is the number of fourth-order sections of the filter.

Algorithms

collapse all

References

[1] Sophocles J. Orphanidis. "High-Order Digital Parametric Equalizer Design." J. Audio Eng. Soc. Vol. 53, November 2005, pp. 1026–1046.

Version History

Introduced in R2015a

expand all

See Also

(Audio Toolbox)