[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [sc-users] [DSP] zero padding = interpolation ?



The sines in your proof are already more than a bin apart though (15 cycles vs 16.5), so my understanding of what's happening here is that the zero padding is making the peaks clearer, but it has not increased the resolution available from your original signal. If this result is what you meant by better resolution, then yes it is true.

I'd be interested to see exactly what JOS said though, as there may be something I'm misunderstanding. By noise I imagine he means any signal with significant energy in the same region as the peaks you are trying to distinguish?

S.

On 18 Jun 2009, at 11:26, Zlatko Baracskai wrote:

Hi All,

Continuing on this debate, I have contacted Julius Smith and on the second occasion sent him the demo that is more accurate
than the previous one as it does windowing and actually looks at the magnitude spectrum (duh).
It clearly shows that two closely spaced sine waves may appear as a single magnitude peak,
but with some zeropadding they will form two distinct peaks.
Julius has commented that my observation is correct in the absence of noise.
Anyone interested can find more detail in:

@ARTICLE{AbeAndSmith04,
 AUTHOR = "Mototsugu Abe and Julius O. " # Smith3,
 TITLE = "Design Criteria for Simple Sinusoidal
       Parameter Estimation based on Quadratic
       Interpolation of {FFT} Magnitude Peaks",
 JOURNAL = "Audio Engineering Society Convention, San Francisco",
 NOTE = "Preprint 6256",
 PUBLISHER = "Audio Engineering Society",
 ADDRESS = "New York",
 YEAR = 2004
}

The actual proof follows:

s = Signal.newClear(512);
w = Signal.hammingWindow(512);
s.waveFill({ arg x, i; sin(x*10)+sin(x*11) }, 0, 3pi);
s=s*w;
s.plot;

c = s.fft(Signal.newClear(512), Signal.fftCosTable(512));
e = Signal.newClear(4096).
overWrite(s,0);
d = e.fft(Signal.newClear(4096), Signal.fftCosTable(4096));
c.magnitude.copyRange(10,30).plot;
d.magnitude.copyRange(100,200).plot;


Cheers

Zlatko