Hi, I have a question regarding FFT: If I want to calculate the FFT of a signal I would extend the signal to the next power-of-2 length to exploit the properties of the FFT. This is done using a simple zero-padding. If I window my signal to reduce leakage, when should this be done? Before or after the zero-padding? Thanks! Kind regards Marc
FFT: Zero-padding, Windowing - What order?
Started by ●January 5, 2014
Reply by ●January 5, 20142014-01-05
Am 05.01.2014 19:57, schrieb Marc Jenkins:> Hi, > > I have a question regarding FFT: > > If I want to calculate the FFT of a signal I would extend the signal to > the next power-of-2 length to exploit the properties of the FFT. This is > done using a simple zero-padding. If I window my signal to reduce > leakage, when should this be done? Before or after the zero-padding?Before.
Reply by ●January 5, 20142014-01-05
Reply by ●January 5, 20142014-01-05
On Sunday, January 5, 2014 1:57:41 PM UTC-5, Marc Jenkins wrote:> Hi, > > > > I have a question regarding FFT: > > > > If I want to calculate the FFT of a signal I would extend the signal to > > the next power-of-2 length to exploit the properties of the FFT. This > > is done using a simple zero-padding. If I window my signal to reduce > > leakage, when should this be done? Before or after the zero-padding? > > > > Thanks! > > > > Kind regards > > MarcWhat "properties" are you looking to exploit? The FFT doesn't require a power of two, although some FFT implementations, mainly embedded/VHDL, are resricted to powers of two. John
Reply by ●January 5, 20142014-01-05
On 1/5/14 2:57 PM, Marc Jenkins wrote:> On 2014-01-05 19:38:59 +0000, sg said: > >> Before. > > Thank you! >also, Marc, you can (and, in my opinion, should) think of this windowing and zero-padding as one single operations. before the operation you have x[n] for -inf < n < +inf after the operation you have x[n] * w[n] for the same n. both the truncation of x[n] to a specific length and the zero padding can be modeled as zeros in the same w[n]. then it doesn't matter what the order is. -- r b-j rbj@audioimagination.com "Imagination is more important than knowledge."
Reply by ●January 7, 20142014-01-07
On Sunday, January 5, 2014 1:57:41 PM UTC-5, Marc Jenkins wrote:> Hi, I have a question regarding FFT: If I want to calculate the FFT of a signal I would extend the signal to the next power-of-2 length to exploit the properties of the FFT. This is done using a simple zero-padding. If I window my signal to reduce leakage, when should this be done? Before or after the zero-padding? Thanks! Kind regards MarcRemember that windowing is only used if your signal length is a subset of a longer signal and you want the best approximation to the Fourier Transform of the longer signal. If your signal is just naturally short (for example, if it's the impulse response of some linear system), then you don't want to apply a window at all; the FFT output represents samples of the continuous Fourier Transform of the signal. There's no concept of speactral leakage in that case. By zero-stuffing you just get more densly-spaced samples of the continuous FT. Bob
Reply by ●January 7, 20142014-01-07
On 2014-01-06 03:06:17 +0000, robert bristow-johnson said:> also, Marc, you can (and, in my opinion, should) think of this > windowing and zero-padding as one single operations. > > before the operation you have x[n] for -inf < n < +inf > > after the operation you have x[n] * w[n] for the same n. > > both the truncation of x[n] to a specific length and the zero padding > can be modeled as zeros in the same w[n]. > > then it doesn't matter what the order is.But why is there a tremendous difference in the FFT-result when changing the order? Marc
Reply by ●January 7, 20142014-01-07
Reply by ●January 7, 20142014-01-07
On Tue, 7 Jan 2014 17:06:41 +0100, Marc Jenkins <marc.jenkins@noreply.com> wrote:>On 2014-01-06 03:06:17 +0000, robert bristow-johnson said: > >> also, Marc, you can (and, in my opinion, should) think of this >> windowing and zero-padding as one single operations. >> >> before the operation you have x[n] for -inf < n < +inf >> >> after the operation you have x[n] * w[n] for the same n. >> >> both the truncation of x[n] to a specific length and the zero padding >> can be modeled as zeros in the same w[n]. >> >> then it doesn't matter what the order is. > >But why is there a tremendous difference in the FFT-result when >changing the order? > >MarcIf you change the length of the shaped window it'll change the response in the frequency domain. Say that one is padding a length-M data vector up to length-N. Applying a shaped window with length-M to the data portion will yield a different response than if a longer, length-N tapered window is applied to the entire transform. Applying the length-M shaped window provides a frequency response that is the transform of the window convolved with the ideal transform of the data. Applying the length-N shaped window provides a frequency response that is the transform of the length-N shaped window convolved with the transform of a length-M rectangular window convolved with the ideal transform of the data. Eric Jacobsen Anchor Hill Communications http://www.anchorhill.com
Reply by ●January 7, 20142014-01-07
On 1/7/14 11:06 AM, Marc Jenkins wrote:> On 2014-01-06 03:06:17 +0000, robert bristow-johnson said: > >> also, Marc, you can (and, in my opinion, should) think of this >> windowing and zero-padding as one single operations. >> >> before the operation you have x[n] for -inf < n < +inf >> >> after the operation you have x[n] * w[n] for the same n. >> >> both the truncation of x[n] to a specific length and the zero padding >> can be modeled as zeros in the same w[n]. >> >> then it doesn't matter what the order is. > > But why is there a tremendous difference in the FFT-result when changing > the order? >make sure it's the same w[n]. -- r b-j rbj@audioimagination.com "Imagination is more important than knowledge."