%% Oversample Audio Signal
% Reduce warping by specifying your multibandParametricEQ object to perform oversampling before equalization.
% Create a one-band equalizer. Visualize the equalizer band as its center frequency approaches the Nyquist rate.

mPEQ = multibandParametricEQ( ...
    'NumEQBands',1, ...
    'Frequencies',9.5e3, ...
    'PeakGains',10);
visualize(mPEQ)

%
%

for i = 1:1000
    mPEQ.Frequencies = mPEQ.Frequencies + 8;
end

%
% The equalizer band is warped.
%
% Create a one-band equalizer with Oversample set to true. Visualize the equalizer band as its center frequency approaches the Nyquist rate.

mPEQOversampled = multibandParametricEQ( ...
    'NumEQBands',1, ...
    'Frequencies',9.5e3, ...
    'PeakGains',10, ...
    'Oversample',true);
visualize(mPEQOversampled)

%
%

for i = 1:1000
    mPEQOversampled.Frequencies = mPEQOversampled.Frequencies + 8;
end

%
% Warping is reduced.
% Copyright 2012 The MathWorks, Inc.