help-octave
[Top][All Lists]
Advanced

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

Re: How do YOU handle this disparity in fft?


From: Brian Kaczynski
Subject: Re: How do YOU handle this disparity in fft?
Date: Sun, 16 Feb 2014 19:06:35 +0100

Regarding the DC term in the FFT --

I have never worried about this term because usually the signals I'm concerned with contain no information at DC.

On the other hand, the DC bin DOES adhere to the strict definition of FFT, which for DC is simply the sum of all the terms in the time-domain sequence.

I actually don't see a discrepancy here.  You can shift a DC "tone" to any other frequency offset by multiplying in the time domain by x[n] = exp(j*2*pi*k/N) and in this case, the amplitude of the tone is preserved.

It's only when you are dealing with real signals that any apparent discrepancy appears.  But you can generally resolve this by decomposing a real signal into the sum of two complex signals -- for example:
cos(2*pi*t) = 0.5*(exp(j*2*pi*t) + exp(-j*2*pi*t))

I hope this makes sense!
-Brian


2014-02-16 17:44 GMT+01:00 Macy <address@hidden>:
Just as I wrote out the equation for the 'standard' hanning window what you said soaked in!

Yes, the hanning window is exactly symmetrical, but if you string a series of the built-ins along the waveform becomes NON-periodic! I think that's what the effect is.

Just like Cos(2*pi()*f*t) where 0<=t<=N-1 is NOT really symmetrical, but is periodic, so what you reccomend is that by slightly shifting the symmetrical waveform, it becomes periodic. Interesting.

Good point! thanks I'll try that new window on some waves and see what the differences are. Especially when sorting out those pesky AC mains intrusions.

Thanks again for reinforcing that it is not always prudent to accept on blind faith 'cookbook' solutions. One should ALWAYS examine.

Regarding calibration, yes, works for AC tones, but shift a bit of DC in there and you're off by that sqrt(2) term.

Do you know of any advantage of leaving in that 'error'?  after all, could be put in both the fft and the ifft. Oops, forgot, octave is a clone of MatLab and therefore MUST follow Matlab's conventions.


--- address@hidden wrote:

From: Brian Kaczynski <address@hidden>
To: Macy <address@hidden>
Cc: octave <address@hidden>
Subject: Re: How do YOU handle this disparity in fft?
Date: Sat, 15 Feb 2014 16:19:25 +0100

As an ADC designer, I recommend a slight modification to the Hanning
window.  It even works well for sigma-delta ADC sequences.

The standard Hanning window is:
w[n] = 0.5*(1-cos(2*pi*n/(N-1)));
where 0 <= n <= N-1

The problem is that this window is not periodic with a period of N so you
get smearing among the frequency bins.  I recommend this window:
w[n] = 0.5*(1-cos(2*pi*(n+0.5)/N));
where 0 <= n <= N-1

This window works much better when you have to resolve a deep null in the
noise spectrum of a signal (as with a sigma-delta ADC output).

I don't think it's possible to identify a single "best" FFT window for all
applications; rather, it's important to know about various windows and what
their weaknesses and strengths are to identify the best window for a given
application.

Generally I don't worry about the signal scaling after the window, since
I'm only interested in relative magnitudes.  It's a good idea to include a
signal of a known size in your time-domain vector so that you can use its
FFT magnitude to "calibrate" the rest of the FFT.

-Brian

_______________________________________________
Help-octave mailing list
address@hidden
https://mailman.cae.wisc.edu/listinfo/help-octave


reply via email to

[Prev in Thread] Current Thread [Next in Thread]