![]() |
![]() ![]() ![]() ![]() ![]()
|
next newest topic | next oldest topic |
Author | Topic: Correct Windowing for FFT Sounds |
David McClain Member |
![]() ![]() ![]() Ahhh... after doing some research into polyphase filtering, I found the solution to the problem plaguing the Kyma FFT Sound examples that want to utilize windowing on both input and output.... Using any of the available Kyma window files, under this dual windowing, introduces artifacts that can be quite noticeable and objectionable. However there is strong reason to wish to perform windowing on both input and output FFT blocks. Failing to window the input data causes numerous spectral artifacts due to the abrupt edges of the default window -- a square window defined by the duration of the FFT input blocks. At the same time, performing any spectral modifications by design, between the input and output FFT blocks will likewise produce artifacts, even if you have carefully windowed the input blocks. Hence the wish for windowing the FFT output to stitch together the overlapping blocks in such a way as to minimize these edge artifacts (the temporal aliasing artifacts). What to do?.... Ogg Vorbis to the rescue... Some clever individuals, well versed in "perfect reconstruction" (PR) filters dreamed up the very window we need. It is such that its square, when overlapped, sums perfectly to unity over the overlap region. Here is this fabulous window function: w[j] = Sin[Pi/2*Sin^2(Pi*(j+1/2)/N] where index j = 0, 1, ... N-1, for window length N. That is, the sine of a squared sine argument. This window is such that w[j]*w[j] + w[j+N/2]*w[j+N/2] = 1, for all index values j. which is exactly what we need. We also need it to taper to zero at the edges of the window interval, and peak near unity at the center of the window interval. This window does just that.
Cheers, - DM IP: Logged |
pete Member |
![]() ![]() ![]() Hi David I've been giving this some thought as well. As it stands we use two windowed overlapping FFTs half a frame apart but if we instead used eight overlapping FFTs (one eigth of a frame apart)but the same width as before, and with simple hann windows on both the inputs and the outputs, the the overall modulation due to windowing, adds up to DC again. This may make a better clean signal. Pete [This message has been edited by pete (edited 20 June 2005).] IP: Logged |
David McClain Member |
![]() ![]() ![]() Hi Pete! Yes, indeed! You are absolutely correct on both counts! The Hann, or any other conventional, window does produce horrific amounts of AM on the output with double windowing. And yes! you are correct that if you could somehow work with 1/2-length windows in the window interval then you could achieve perfect matching and avoid all the temporal aliasing artifacts. ( I just measured the effects of this window here and find that it tends to produce sidelobes down about 60 dB from the main carrier, when you pass a sinewave or a chirp through the FFT window combo. That isn't too bad, and to be honest, with peak carrier amplitudes at around -12 dBFS, I can't hear those sidebands. They are spaced at the sample rate divided by half-window size (so 48 KHz fsamp with 512 sample FFT's would produce sidebands at +/- 187.5 Hz). That degree of nearness to the main carrier, and with an amplitude so far down, means that your ears are masking their presence and so they are inaudible, even if I can see them on the scope here...) Now the MP3 players, and Ogg Vorbis, using these kinds of windows are attempting to reconstruct, as nearly as possible, a signal with bit corrupted spectral samples. That is their equivalent to our mucking with the spectrum between the FFT blocks, only we hope to do even more damage than they ever hope to see! But these kinds of windows, while not quite a square root of a Hann, per se, are developed from the theory of perfect reconstruction filters used for polyphase filtering and wavelet analysis (the two are very closely related, it turns out...). And in some general sense they are a kind of square root window since they have to be squared to work right. Cheers! [BTW -- you can use all kinds of degrees of overlap and with conventional windows you still get AM artifacts with double windowing. It's just that by using so much overlap you end up averaging these artifacts down. Hann windows, no matter how much overlap, will always give rise to AM artifacts along with the residual temporal aliasing artifacts. The Vorbis window described above does away with AM at all overlap factors, but still leaves a bit of temporal aliasing....]
[This message has been edited by David McClain (edited 20 June 2005).] IP: Logged |
All times are CT (US) | next newest topic | next oldest topic |
![]() ![]() |
This forum is provided solely for the support and edification of the customers of Symbolic Sound Corporation.