I am learning DFT and I am not sure I understand it correctly. I am just going to write out the process of DFT and I am asking you to tell me if I am thinking the right way.
Suppose we have a signal on which we run DFT to get the frequencies incorporated in the signal. We use a window of size N samples and calculate DFT on it. The result are frequencies which occur in this chunk of audio. Now we can display the spectrum (like Winamp does). But we would like to display the spectrum while the song is playing thus calculating DFT for many such windows. Because it would take a long time to do this with all the windows, we say we have a timestep (dt)
between windows. This way we loose some frequencies (not all samples are processed) but we gain in computing time and this way it is possible to display spectrum "realtime" while the audio is playing.
Again, I am not sure if what I wrote is correct so please shed a light.
Even if everything what I wrote above is true indeed, where does the frequency resolution (df)
step in? My first answer would be the window size (N) because that way we can test more samples.
Answer
The "timestep" $dt$ (using your nomenclature) between DFT windows can really be anything you choose. There are a few different cases to consider:
$dt < N$: In this case, there is overlap between successive windows of samples that you input to the DFT. This can be used if you would like to get answers more frequently than every $N$ samples. It's quite common to see something like 50% overlap between windows being used.
$dt = N$: In this case, there is no overlap; you just take successive blocks of $N$ samples and use those as inputs to the DFT. This would give you the minimum processing load while not skipping any input data.
$dt > N$: As you noted, in this case, you're skipping data between windows (sometimes called "underlap"). This can reduce your processing load further, but since you're skipping data, you run the risk of missing the analysis of some feature in that portion of data that was discarded.
The frequency spacing of the DFT is related to the sample rate and the DFT length. Specifically:
$$ df = \frac{f_s}{N} $$
where $f_s$ is the sample rate of the input data. $df$ in the equation above corresponds to the frequency spacing between each output (i.e. with $f_s$ measured in Hz, the outputs will have a spacing of $df$ Hz).
No comments:
Post a Comment