FFT/iFFT + signal vector


    Jun 03 2016 | 11:27 pm
    Hi, hope some nice DSP guru can help me out with these questions :)
    I was wondering if a short time windowed DFT could be reversed to restore the exact bitwise data of the original file, so I made a little patch to check it (attached below). In order to check it I substracted the original signal from the pfft~ signal to see the difference. Obviously I had to delay the original signal and here is my first question:
    (1) If i set the delay amount to the size of the FFT window (2048), then it's not working, but setting that to (2048- signal vector size (64) = 1984) mutes the output signal nicely. Why is this happening?
    On the other hand although it seems the signal is muted, I thought to doubleCheck the zeroing in a GEN object and it seems it's not a perfectly muted signal. While capturing the OUT1 of the GEN object shows 0.0 everywhere the capture of OUT2 should be always 1.0 if the 0.0 is really 0.0!
    (2) is this small difference is due to the floating point operation errors or is it some kind of theoretical difference introduced by the dft/idft or windowing? (3) is a non-windowed DFT reversible? (4) is an analog domain transformation reversible and this error is introduced by the digital domain only?
    Thanks in advance, Kevin

    • Jun 04 2016 | 7:55 pm
      Hi! Just some thoughts, no solution: Why is the gen [== 0] not working? Because you don't get 0, there is a difference. The difference seems to be an input amplitude dependent signal. The difference also seems frequency dependent. If there is a lot of high frequency content in the input signal, the error signal becomes larger. Also the error seems have the same spectrum as the input signal + a much bigger spike at Nyquist. I think all this comes from the windowing actually.. have you tried different windows and observed any differences?
    • Jun 04 2016 | 8:04 pm
      oh and some guesses(!) on your questions: 1 i don't know 2 I would believe this is a practical error (floating poit issues as you said) 3 Yes, I think so, depending on what you mean by that. You will introduce a lot of high frequencies when doing the dft since you essentially amplitude modulate with a rectangular window, which has a lopt broader spectrum that usual windows (hann etc.) if you do that and do the iDFT, the DFT is still "reversible" but you will also get back the high frequency content you generated, 4 if by analog you mean a theoretical continuos FFT/iFFT I would say yes since I would say this is the same questions as 2. But maybe I misunderstand you.
    • Jun 06 2016 | 9:42 am
      Thanks a lot on your thoughts. I didn't do further experiments as I thought it's more a theoretical topic. Regarding question (3) though you say Yes but you also say the iDFT will introduce (because of the lack of a window what means a rectangular window) some additional high frequency content. so the answer is really "no, it's not reversible as we won't get back the original data" if I understand you right.
      and thanks again!
    • Jun 06 2016 | 11:02 am
      having the urge to correct myself: on 3: Yes you do understand me right. But: Depends what you mean by non-windowed: If you mean a STFT, so, realtime, essentially windowed DFT but without a window, you are ending up with a rectangular window(producing the problems described above). If on the other hand you mean a non-windowed DFT, so, transforming the *whole signal*, non-realtime, without any framing/windowing, you don't have these problems.
    • Jun 06 2016 | 6:19 pm
      ah yeah, you are right I meant STFT and didn't think of the whole signal. But get you know, thanks!
    • Jun 06 2016 | 9:31 pm
      Regarding the sidelobes from windowing functions, I've found the diagrams on the Wikipedia page for window functions to be pretty helpful in illustrating this. Check out the one for the rectangular (aka boxcar) window to see this.
    • Jun 06 2016 | 9:39 pm
      true, great page! And speaking about window function: I'm a big fan of the tuckey window, I mean, you can crossfade between rectangular and hann, how great is that? Especially for granular synthesis.. Also it's not too hard to implement