23 comments

[ 2.3 ms ] story [ 64.7 ms ] thread
Hmmmm i am still missing something. Are you analysing in real time or testing chunks of the wave? It would seem like chunks
Real time with DFT is a bit sketchy. Just view it as a matrix vector multiplication. The vector is the sampled signal at discrete time steps of equal spacing, the matrix is the DFT of fixed size.

You need to fill your vector before the multiplication. This time needs to pass. You might shift it by just one value in time to create a sliding DFT, but nonetheless you will need to sample your time vector first.

The length of each chunk is fixed by the size of the DFT.

Let's say it is 1 millisecond long, each sample is 1 microsecond spaced, so it has a length of 1000. You may then create a spectrogram that captures 1 millisecond and then advances by 1 microsecond every step and this will be as close as real time as you can get.

The initial delay of your analysis vector, then advancing by one sample, plus all the time you need for the calculations included cause a delay. Although this is sometimes called real time DFT. Since you may observe the change in the signal basically in real time, but after some delay.

It is always done in chunks. Hope this helps.

short loops made from single chunks, actually. since frequencies are in a limited band, signal must be infinite and repeating. That is the reason analysis usually multiplies signal by window function before FFT, to "fade out" discontinuity at the loop point
https://www.dspguide.com/ is a great, general introduction to digital signal processing and includes coverage of the Fourier Transform. I'd recommend checking it out for anyone struggling to grok DSP concepts.

This article seems to have the right intent, but I felt the quality of the writing would need to improve for it to become truly useful for learners.

I think the writing was poor, but also there are some things that are just wrong. Like most of the time people sample at 10x Nyquist. That would be a huge waste of processing given that it doesn't give you any more information about the signal than just Nyquist.
Almost by definition, it does give you more information about the signal than sampling at the Nyquist frequency though?

If you have any noise at all, oversampling will be very helpful to improve the signal to noise ratio.

for band limited signals the snr is not increased by oversampling
That's true but sampling beyond your target domain bounds seems pointless, right? If, say, you're sampling audio oversampling will just give you a bunch of frequencies you'd end up throwing away regardless. It's extra work for no benefit if the domain already has well-prescribed bounds.

I guess it could be useful in cases where you don't have bounds to work against.

This comes back to the poor writing, though, as I believe the author meant to indicate that the industry standard for sampling audio is 10x their cited sampling rate of 2000HZ in the text (though this is incorrect, too. Audio is sampled at 44100HZ because the general upper bound on hearing is 22000HZ, so by Nyquist's theorem, sampling at 44100 gives you enough range to avoid aliasing within the 0-22000 band).

Here's what I've never understood, isn't Nyquist sampling discrete in time but continuous in amplitude? If the amplitude is instead (as is normal in digital) being sampled discretely (in steps), wouldn't that introduce errors, and wouldn't more samples make up for these errors?

what would Nyquist in amplitude, continuous in time look like? that's sort of a class D amplifier, and even sort of CVSD.

There are Sigma Delta ADCs, which sample quantised to one bit at a higher frequency. They need to do some processing in the analogue domain though. IIRC you need to multiply the sample rate by 4*N to get the equivalent of an N but DAC
This is a way better explaination. Thank you! I do agree my writing could be better.
I wouldn't say over sampling is wrong. Inefficiency and inaccuracy has different consequences in my opinion. Maybe I'm missing something idk.
Thank you. I read a lot of papers drive equations from Euler's formula, which helped with result, but I didn't have any intuitive understanding, but when I watched geometric breakdown of it, it suddenly made sense. It's just my attempt to share my excitement. I do agree my writing could definitely be improved.
For me this produced more confusion than it explained anything.
Yes, This reads more like someones notes to self, than an article written with a general audience in mind.
Sorry it didn't hit the mark for you. It's my attempt to explain it with geometry, but I clearly need to improve my writing.
(comment deleted)