Discrete Fourier Transform = Correlation?

DSP, Plugin and Host development discussion.
Post Reply New Topic
RELATED
PRODUCTS

Post

Yes indeed, it's a Dirac comb ;)

Post

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?

Post

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.

Post

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.

Post

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??

Post

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).

Post

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?

Post

Yes, of course, but why would you want to do that??

Post

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

Post

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).

Post

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?

Post

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.

Post

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.

Post

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.
That's what the DFT definition of the full signal means indeed!

Post

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

Post Reply

Return to “DSP and Plugin Development”