FFT - basic understanding question


    May 07 2019 | 12:11 am
    Hi All,
    I have been enjoying the past year of learning audio DSP techniques through MaxMSP, but have come to a slight hurdle in terms of my understanding of FFT's and thought I would ask a question here.
    I can't see how the process of moving from the time domain to the frequency domain retain the timing information. I can create an FFT of 1024 bins, which will process 1024 samples worth of audio, and return 1024 complex numbers, one set per frequency bin (46.875Hz), from which I can calculate the amplitude and phase for each given frequency bin.
    What confuses me is that I can then convert this back with an iFFT and am left with the exact same audio I started with. However, my FFT length essentially created 48.875 discrete snapshots of the frequency/phase components per second. So how is the timing information retained within each FFT window?
    I know that there is a similar question here on the boards, but the answers didn't appear to reveal the answer.
    Thanks in advance for your thoughts,
    tdc

    • May 07 2019 | 3:01 am
      I believe it's answered in here somewhere towards the beginning of the series
    • May 07 2019 | 11:44 pm
      8:00 - 10:00 in the video kind of explains it: there is no higher resolution of time than whole fft frames.
    • May 08 2019 | 6:15 am
      Hi Max, Roman, thanks for your responses. I have gone through Tims videos yet again ( awesome resources) but couldn't find anything that helped me make this leap.
      I recall reading that FFT and iFFT allows you to move freely from time to frequency domains and back again without any negative effects to the original audio signal. So I built a quick patch to test this, and I can indeed completely null out an audio signal with the correct delay amount.
      Am I completely off the track on this?
    • May 08 2019 | 2:16 pm
      no you are correct. for my part, i am not able to explain "where" or how the time domain is repesented in fft bins. but you can not access it anyway, so it doesnt matter much. :)
    • May 08 2019 | 5:28 pm
      Maybe this video gives you more insights...

      But what is the Fourier Transform? A visual introduction.

      Basically the Fourier bins can be thought of the amplitudes and phases of sine waves that are summed up. This is what the inverse FFT does. The time is hidden in the sine waves.
    • May 08 2019 | 10:56 pm
      Thanks Martin, I have also watched this series, but will dive in again over the next few days and see if the neurons have solidified. Am sure I will be back with another question.
    • May 10 2019 | 11:24 am
      So, I have done a lot of reading, watching and discussing my confusion and but no further clarity. I feel that the answer is in the complex numbers being able to represent the phase, thus the timing, but cant form this solution in my mind.
      I have created a modified patch to explore this it only goes to further astound me. By having a long FFT 8192, and a rapid pulse of 1kHz, the results are still being reconstructed. Somehow, within that one bin that represents the energy at 1k, there is information that can show that the 1k turns on and off...
    • May 10 2019 | 9:57 pm
      It's a transform, not a reduction of information. I think you are thinking of the FFT like its a set of magically extracted numbers. It's not :)
    • May 11 2019 | 12:18 pm
      Thats actually issue James! Whilst I accept its a transform, the formula is still mysterious and beautiful.
      I spent a few hours today exploring the process further and have made another patch to explore the FFT, this time using a jit.matrix and jit.fft to allow for much more detailed adjustments to the source. Its interesting to see how a single cycle of a sine followed by silence within an FFT frame causes different results in the fit output complex number.
    • May 11 2019 | 2:55 pm
      i totally understand your wish to get a picture about where the time domain hides in the bins. for my part i gave up on it long ago, i just accept that it is there.
    • May 11 2019 | 5:44 pm
      I highly recommend this book if you want to better understand the math behind FFTs.
    • May 12 2019 | 12:53 am
      "for my part i gave up on it long ago, i just accept that it is there. " :-) I completely understand.
      Jesse - thanks that's perfect. Book ordered.
      I really appreciate everyones assistance in this.
    • May 12 2019 | 2:39 pm
      For me the most useful insight was to realise that frequency happens in time, so "frequency domain" is not like a different dimension of a signal, it is just a different way to think about the time.
    • May 12 2019 | 5:16 pm
      >>Its interesting to see how a single cycle of a sine followed by silence>> countercheck: send "pulse followed by silence" reversed in the fft, then compare the bins against the forward version.
    • May 20 2019 | 4:02 am
      To follow up on my original question, I wanted to pass on my thanks to those who assisted my understanding. I am very pleased to say that I know have my answer and the fast Fourier transform is no longer a mysterious process to me.
      For those who find this post in the future and wonderful what it was that helped me, I found that breaking the problem down to a small dataset (8 bins) and the calculating the FFT manually. This allowed me to change input values (time domain) and then see the results in the Freq domain.
      After building various Max Patches, and using a spreadsheet, I found a fantastic java-applet on a great website that did exactly the same thing but much more elegantly. I was able to enter values to represent a time based signal and see how the resulting values of the 8 bins interacted, either cancelling or reinforcing.
      We all learn differently, and for me, the moment of clarity came when I realised that the results of the transform actually represented the amplitude and phase of a collection of sines that use these values to interact (sum and cancel) which can then be reformed to the original time domain signal. Obvious, I can see now, but at the start go this learning process, I totally missed this.
      So - thanks to Cycling74 for the wonderful tools, and to the community for the guidance.
    • May 23 2019 | 8:30 am
      > However, my FFT length essentially created 48.875 discrete snapshots of the frequency/phase components per second. So how is the timing information retained within each FFT window?
      > there is no higher resolution of time than whole fft frames
      Just to add (because no-one else has referenced this in the thread) that this is part of the reason that most fft implementations use overlapping frames with a windowing function, so your time domain resolution increases. If you have a hop size of 256 samples with your 1042 sample fft, you now have 195 snapshots per second. pfft~ does this, and you apply the windowing function with ifft~
    • May 23 2019 | 10:10 am
      Yes. Tim's in-depth videos are fantastic in show the impact and process of overlapping.