DSPRelated.com
Forums

Hann windowed FFT from 'rectangular' one ?

Started by prze...@wp.pl August 19, 2006
Hello,

This is my first post in this group so let me say hi to everybody :)

... and of course I have a question, probably simple but ...

(how) can I get hann-windowed complex FFT values from the plain (unwindowed) complex FFT ?

In other words, having complex spectra X = fft(x, N), can I get hann-windowed complex spectra Xh from X ?

Thanks in advance,

Best regards,
PrzeM
Prze-

> This is my first post in this group so let me say hi to everybody :)
>
> ... and of course I have a question, probably simple but ...
>
> (how) can I get hann-windowed complex FFT values from the plain
> (unwindowed) complex FFT ?
>
> In other words, having complex spectra X = fft(x, N), can I get
> hann-windowed complex spectra Xh from X ?

Since windowing is a time-domain multiplication, in the frequency domain
you could convolve the window and input data to get the same result.

But that's a lot of work -- what happened to your original time domain
data? Why not just window it and take another FFT? A lot less processing
required.

-Jeff
Hi Prze,
Let me confirm what I have understood from ur mail is same as u wanted to convey.
x(t) - time domain
X(w) - freq domain

present case
x(t) -> rectanguler window ->fft -> X(w) Eqn(A)

now instead of rectanguler window u want to use hann window
x(t) -> Hann window ->fft -> X(w) Eqn(B)

I think if u take fft of Han window & convlove it with X(w) of Eqn(A)
u will get X(w) of Eqn(B)

BVL

p...@wp.pl wrote:
Hello,

This is my first post in this group so let me say hi to everybody :)

... and of course I have a question, probably simple but ...

(how) can I get hann-windowed complex FFT values from the plain (unwindowed) complex FFT ?

In other words, having complex spectra X = fft(x, N), can I get hann-windowed complex spectra Xh from X ?

Thanks in advance,

Best regards,
PrzeM
PrzeM,

Allow me a go at your problem. And "Hi" to everybody as well ;)

Firstly, from the properties of the FFT, multiplication in one domain is
equivalent to convolution in the other domain and vice versa.

Now since the application of a window is essentially multiplication in
the time domain, the result is a convolution in the frequency domain by
the FFT of the window function. Therefore, you need to find the FFT of
your hann-window (if it's the standard Hanning window, you'll shouldn't
have much trouble finding a suitable reference) and convolve the result
with your complex FFT values. Convolution is mathematically hard
however, so you may be better off going back to x(t) from X(f), applying
the hann-window through multiplication, and reapplying fft(x, N).

Regards,
Heath

p...@wp.pl wrote:
> Hello,
>
> This is my first post in this group so let me say hi to everybody :)
>
> ... and of course I have a question, probably simple but ...
>
> (how) can I get hann-windowed complex FFT values from the plain (unwindowed) complex FFT ?
>
> In other words, having complex spectra X = fft(x, N), can I get hann-windowed complex spectra Xh from X ?
>
> Thanks in advance,
>
> Best regards,
> PrzeM
Everyone - thanks for the quick replies :)

I think some details can be helpful : My main motivation is to avoid
calculating two FFT's (with the rectangular and the hann window - namely,
X(k) & Xh(k)). I know that I have to compute the first one - X(k) because I
need it for further processing. So I was wondering if I can quickly compute
the hann-widnowed version Xh(k) from the X(k).

The tips with the convolution are quite nice (thx) but I was thinking of
something much easier. There is the paper by Harris ("On the Use of Windows
for Harmonic Analysis with the Discrete Fourier Transform", IEEE 66, no.1,
Jan 1978 - old but still nice) where he presents this nice formula:

Xh(k) = 0.5 * [ X(k) - 0.5* [ X(k-1) + X(k+1)] ]

where :
X(k) - is the k-th bin of the unwindowed (rectangular) DFT
Xh(k) - is the k-th bin of the hann-windowed DFT

but Harris states that this only works for real transforms ( I have tried
this on complex DFTs but it seems that he was right :/ ).Whereas I am
looking for a similar formula for the complex DFT.

So If someone have any tips on this - please let me know.

Best regards,
PrzeM

PS. Please let me now if you need some additional details

-----Original Message-----
From: paulraj bob [mailto:b...@yahoo.com]
Sent: Monday, August 21, 2006 8:44 AM
To: p...@wp.pl; a...
Subject: Re: [audiodsp] Hann windowed FFT from 'rectangular' one ?

Yes you can.
regards
Bob
--- p...@wp.pl wrote:

> Hello,
>
> This is my first post in this group so let me say hi
> to everybody :)
>
> ... and of course I have a question, probably simple
> but ...
>
> (how) can I get hann-windowed complex FFT values
> from the plain (unwindowed) complex FFT ?
>
> In other words, having complex spectra X = fft(x,
> N), can I get hann-windowed complex spectra Xh from
> X ?
>
> Thanks in advance,
>
> Best regards,
> PrzeM
Yes you can.
regards
Bob
--- p...@wp.pl wrote:

> Hello,
>
> This is my first post in this group so let me say hi
> to everybody :)
>
> ... and of course I have a question, probably simple
> but ...
>
> (how) can I get hann-windowed complex FFT values
> from the plain (unwindowed) complex FFT ?
>
> In other words, having complex spectra X = fft(x,
> N), can I get hann-windowed complex spectra Xh from
> X ?
>
> Thanks in advance,
>
> Best regards,
> PrzeM
Prz-

> Everyone - thanks for the quick replies :)
>
> I think some details can be helpful : My main motivation is to avoid
> calculating two FFT's (with the rectangular and the hann window - namely,
> X(k) & Xh(k)). I know that I have to compute the first one - X(k)
> because I
> need it for further processing. So I was wondering if I can quickly
> compute the hann-widnowed version Xh(k) from the X(k).
>
> The tips with the convolution are quite nice (thx) but I was thinking of
> something much easier. There is the paper by Harris ("On the Use of
> Windows for Harmonic Analysis with the Discrete Fourier Transform", IEEE
> 66, no.1,
> Jan 1978 - old but still nice) where he presents this nice formula:
>
> Xh(k) = 0.5 * [ X(k) - 0.5* [ X(k-1) + X(k+1)] ]
>
> where :
> X(k) - is the k-th bin of the unwindowed (rectangular) DFT
> Xh(k) - is the k-th bin of the hann-windowed DFT
>
> but Harris states that this only works for real transforms ( I have tried
> this on complex DFTs but it seems that he was right :/ ).Whereas I am
> looking for a similar formula for the complex DFT.

The above equation holds only for delta function input. See this page:

http://www-ccrma.stanford.edu/~asmaster/fresnelanalpaper/fresnelanal/node24.html

Your initial query brought several replies that consistently suggested
convolution. After 50 some years of signal processing, there isn't going
to be a newly invented "fast way" frequency domain application of windows
against arbitrary time domain data.

-Jeff

> -----Original Message-----
> From: paulraj bob [mailto:b...@yahoo.com]
> Sent: Monday, August 21, 2006 8:44 AM
> To: p...@wp.pl; a...
> Subject: Re: [audiodsp] Hann windowed FFT from 'rectangular' one ?
>
> Yes you can.
> regards
> Bob
> --- p...@wp.pl wrote:
>
>> Hello,
>>
>> This is my first post in this group so let me say hi
>> to everybody :)
>>
>> ... and of course I have a question, probably simple
>> but ...
>>
>> (how) can I get hann-windowed complex FFT values
>> from the plain (unwindowed) complex FFT ?
>>
>> In other words, having complex spectra X = fft(x,
>> N), can I get hann-windowed complex spectra Xh from
>> X ?
>>
>> Thanks in advance,
>>
>> Best regards,
>> PrzeM