[music-dsp] RE: constant Q EQ
Bob Cain
arcane at arcanemethods.com
Fri Feb 20 13:56:14 EST 2004
Angelo Farina wrote:
> This way You still get a "symmetric" impulse response, hich means
> pre-ringing.
Yes, look at a recorded bass drum hit, for example, which
begins with a sharp percussive smack. After linear phase
filtering which gives any signifigant bass boost you'll
find that the low frequency output of the drum begins well
before the smack that in fact drives the drum. I find this
audible. Linear phase filters preserve the relative phase
of a component at the expense of smearing it symmetrically
in time.
> I can explain my own trick for avoiding this problem:
> 1) Compute a symmetric inverse filter (what is usually called "linear
> phase")
> 2) Remove all the samples before the maximum one (the "peak")
> 3) Double the amplitude of all the samples after the maximum one
> This way You get a FIR filter which is not anymore "linear phase", but still
> has quite accurately the same magnitude frequency response initially
> specified, and has very sharp attack and smooth release. And requires half
> the number of coefficient as the original symmetric one...
My appoach is to do 1) and then pass it through a variation
of Matlab's rceps() function which yields the minimum phase
FIR with the same magnitude function. I am going to
compare that with what you suggest to see what the
differences are. BTW, Angelo, it would be a nice function
for Aurora to calculate either the linear or minimum phase
equivalent of a selected signal (usually an IR.)
FWIW, my variation on rceps is:
function y = minphase(x)
%minphase - minimum phase from mixed phase impulse responses
% minphase(x) returns minumum phase version of signal x
% y = minphase(x) returns the minimum phase signal
% derived from x.
% References:
% [1] A.V. Oppenheim and R.W. Schafer, Digital Signal
% Processing, Prentice-Hall, 1975.
% [2] Programs for Digital Signal Processing
% IEEE Press
% John Wiley & Sons, 1979, algorithm 7.2.
%
% Adapted from the Matlab rceps() function by Bob Cain
% arcane at arcanemethods.com
%Double the impulse response lengths with zeros
x = [x; zeros(size(x))];
%Number of impulse responses
m = size(x,2);
%Size of each
n = size(x,1);
%The weighting function
wn = [ones(1,m); 2*ones(n/2-1,m); ones(1,m); zeros(n/2-1,m)];
%The work
y = real(ifft(exp(fft(wn.*real(ifft(log(abs(fft(x)))))))));
%Return half the result
y = y(1:n/2;);
The initial doubling and final halving of the length leave
it not quite minimum phase but I found an odd discontinuity
in middle of the IR without it.
Bob
--
"Things should be described as simply as possible, but no
simpler."
A. Einstein
More information about the music-dsp
mailing list