Discrete Fourier Transform = Correlation?
-
- KVRian
- 1379 posts since 26 Apr, 2004 from UK
-
- KVRist
- Topic Starter
- 64 posts since 31 May, 2016
I have another question,dont want to spam another new thread.
what we call FFT,isnt really what we do Short-time Fourier Transform rather than Fast Fourier Transform?
The Short Fourier chops the signal into windows along the time axis,then calculates FFT on each window separately.
so this extra step,chopping long signal into short windows,that is this https://en.wikipedia.org/wiki/Short-tim ... _transform so when we talk on this forum about FFT pluggins and programing,we really mean Short time-Fourier,right?
what we call FFT,isnt really what we do Short-time Fourier Transform rather than Fast Fourier Transform?
The Short Fourier chops the signal into windows along the time axis,then calculates FFT on each window separately.
so this extra step,chopping long signal into short windows,that is this https://en.wikipedia.org/wiki/Short-tim ... _transform so when we talk on this forum about FFT pluggins and programing,we really mean Short time-Fourier,right?
-
- KVRian
- 1379 posts since 26 Apr, 2004 from UK
Not necessarily separately. You can have overlaps, depending on what you want to do.
And yes, FFT is more often than not a variation of SFFT.
And yes, FFT is more often than not a variation of SFFT.
-
- KVRAF
- 3080 posts since 17 Apr, 2005 from S.E. TN
I think the STFT is just taking the Fourier transform of a time-delimited "snapshot" of signal. Because the Fourier transform assumes that signals last forever, stretching in time from minus infinity to plus infinity-- It treats the finite "little piece" of the signal as a perfectly repeating waveform, exactly duplicated forever into the future and past.
Musical signals and most things in the real world don't last forever, so the Fourier transform results can "fool you" with answers which assume that each individual little analyzed chunk of signal repeats forever exactly the same. The windowing is one of the ways to make the results "more applicable" to analyzing a little piece of a long non-repeating waveform.
The "repeating forever" assumption could bite you even if you do a non-windowed STFT on a "perfectly repeating" waveform. For instance, if you do a 512 sized STFT on a perfectly repeating sine wave with a period of 511 samples, then the underlying signal isn't changing, but if you do the 512 sized STFT from different locations in the file, you will get different results because the STFT assumes that the signal has a wave period of 512 samples. The windowing smooths off the edges of each analyzed block, reducing errors caused by the "infinitely repeating" assumption.
FFT is just a fast way to do a STFT. There are many variations on how to calculate the STFT, theoretically giving about the same result. Doing it the slow way ought to work as good as a faster way, except that it is slower. The FFT is a cunning way to get 'er done pretty fast by breaking a single big transform into a bunch of tiny transforms and then unscrambling the results.
Musical signals and most things in the real world don't last forever, so the Fourier transform results can "fool you" with answers which assume that each individual little analyzed chunk of signal repeats forever exactly the same. The windowing is one of the ways to make the results "more applicable" to analyzing a little piece of a long non-repeating waveform.
The "repeating forever" assumption could bite you even if you do a non-windowed STFT on a "perfectly repeating" waveform. For instance, if you do a 512 sized STFT on a perfectly repeating sine wave with a period of 511 samples, then the underlying signal isn't changing, but if you do the 512 sized STFT from different locations in the file, you will get different results because the STFT assumes that the signal has a wave period of 512 samples. The windowing smooths off the edges of each analyzed block, reducing errors caused by the "infinitely repeating" assumption.
FFT is just a fast way to do a STFT. There are many variations on how to calculate the STFT, theoretically giving about the same result. Doing it the slow way ought to work as good as a faster way, except that it is slower. The FFT is a cunning way to get 'er done pretty fast by breaking a single big transform into a bunch of tiny transforms and then unscrambling the results.
-
- KVRist
- Topic Starter
- 64 posts since 31 May, 2016
thank you,both of you
I also want to ask,what does that FFT number mean,like 512,or 4096... that means the width,or lenght of the windows that the original long signal is cut into? so higher number means longer window??
I also want to ask,what does that FFT number mean,like 512,or 4096... that means the width,or lenght of the windows that the original long signal is cut into? so higher number means longer window??
-
- KVRian
- 1379 posts since 26 Apr, 2004 from UK
Yes, that's the number of samples you are taking.
As the DFT means that the signal is periodic (period = number of samples), the SFT is an arangement that allows you to have a non stationary signal.
And no, FFT is a fast way of doing a DFT. Then, the SFT itself can also be expressed as doing several DFTs on different subset of the input (hence also the fact that you may want to overlap, time-frequency transforms can do that).
As the DFT means that the signal is periodic (period = number of samples), the SFT is an arangement that allows you to have a non stationary signal.
And no, FFT is a fast way of doing a DFT. Then, the SFT itself can also be expressed as doing several DFTs on different subset of the input (hence also the fact that you may want to overlap, time-frequency transforms can do that).
-
- KVRist
- Topic Starter
- 64 posts since 31 May, 2016
I want to do this unusual thing
I want to do FFT on whole audio file and then I want it to export every sine and cosine that make up that signal as individual audio file,can such thing even be programed in Python?
I want to do FFT on whole audio file and then I want it to export every sine and cosine that make up that signal as individual audio file,can such thing even be programed in Python?
-
- KVRian
- 1379 posts since 26 Apr, 2004 from UK
Yes, of course, but why would you want to do that??
-
- KVRist
- Topic Starter
- 64 posts since 31 May, 2016
becose I want to examine each sine and cosine individualy,I want to experiment I have some innovative cool ideas that would follow after I can do this thing
-
- KVRian
- 1379 posts since 26 Apr, 2004 from UK
In that case, you will have indeed as many sines + cosines as the number of samples in your original data (as you will get values between integer Hz).
-
- KVRist
- Topic Starter
- 64 posts since 31 May, 2016
Miles 1981
can I do FFT so there isnt as many sine and cosines as number of samples,imagine that the original data doesnt contain any freqency lower than 20hz and its 420 second long,can I then make FFT out of it skipping the 20hz to one cycle from start to end of file low freqency bottom area?
can I do FFT so there isnt as many sine and cosines as number of samples,imagine that the original data doesnt contain any freqency lower than 20hz and its 420 second long,can I then make FFT out of it skipping the 20hz to one cycle from start to end of file low freqency bottom area?
-
- KVRAF
- 3080 posts since 17 Apr, 2005 from S.E. TN
For arbitrary long lengths of signal, analyzed one frequency at a time, as best I recall the Goertzel algorithm may be useful. It was years since I used it, but so far as I recall you can send as many samples as you want thru the algorithm.
Here is a "complicated explanation"-- https://en.wikipedia.org/wiki/Goertzel_algorithm
Here is "fairly simple code"-- http://www.musicdsp.org/showone.php?id=107
If you analyze for instance an entire four minute song for a single frequency of 50 Hz, and then if you convert back to signal and listen to it, I think you would hear a boring non-changing 50 Hz sine wave lasting for four minutes. If you analyze the entire song for 2000 Hz, you would hear a boring non-changing 2000 Hz sine lasting for four minutes.
If you analyze the song in one second sections for a single frequency of 50 Hz and then play it back, I think you would hear a four-minute 50 Hz sine wave, except the amplitude and phase of the sine wave would change one time per second.
Here is a "complicated explanation"-- https://en.wikipedia.org/wiki/Goertzel_algorithm
Here is "fairly simple code"-- http://www.musicdsp.org/showone.php?id=107
If you analyze for instance an entire four minute song for a single frequency of 50 Hz, and then if you convert back to signal and listen to it, I think you would hear a boring non-changing 50 Hz sine wave lasting for four minutes. If you analyze the entire song for 2000 Hz, you would hear a boring non-changing 2000 Hz sine lasting for four minutes.
If you analyze the song in one second sections for a single frequency of 50 Hz and then play it back, I think you would hear a four-minute 50 Hz sine wave, except the amplitude and phase of the sine wave would change one time per second.
-
- KVRian
- 1379 posts since 26 Apr, 2004 from UK
You can by pass elements, but what you are looking for is also the data below 20Hz and above 20kHz, because all of makes up your signal, even if you can't here it. Only SFT can "show" you want frequencies cqn be heard at some point in time.
-
- KVRian
- 1379 posts since 26 Apr, 2004 from UK
That's what the DFT definition of the full signal means indeed!JCJR wrote:If you analyze for instance an entire four minute song for a single frequency of 50 Hz, and then if you convert back to signal and listen to it, I think you would hear a boring non-changing 50 Hz sine wave lasting for four minutes. If you analyze the entire song for 2000 Hz, you would hear a boring non-changing 2000 Hz sine lasting for four minutes.
If you analyze the song in one second sections for a single frequency of 50 Hz and then play it back, I think you would hear a four-minute 50 Hz sine wave, except the amplitude and phase of the sine wave would change one time per second.
-
- KVRist
- Topic Starter
- 64 posts since 31 May, 2016
I have one question,once I do Fourier Transform on original signal,it will split it into bunch of sines and cosines.If I ADD these sines and cosines together,I will get exactly the original signal like it was before I done DFT to it?
I mean the kind of Discrete Fourier Transform that doesnt use the windowing
I mean the kind of Discrete Fourier Transform that doesnt use the windowing