Hacker News new | ask | show | jobs
by lumb63 1160 days ago
Signals and systems was a tough course for me. It was what crushed my 4.0 GPA. Nyquist frequency was a concept I could not wrap my head around. I’ve improved, but it still doesn’t click as I’d like it to.

When I took the course, it made no sense to me that you could sample at twice the frequency of the signal and reconstruct it. Consider a sine wave at 1 Hz. If you sample at 2 Hz, you’d get readings of 0, 1, 0, -1, etc. If you graph that, it’s a perfect triangle wave, not a sine wave! That’s what I couldn’t not get past. I thought you’d need an infinite sampling rate to accurately capture the sine wave.

As I type this out, I’m realizing that a critical component of this that I wasn’t taught (or I didn’t grasp) is the need for the signal to be bandlimited. Returning to my sine example from above, what bothered me was, if I don’t sample more points, how do I know that it’s only a sine wave, and nothing more? That only works if you pretend there are no higher frequencies (or filter them out, though an ideal filter is impossible in practice). If there aren’t higher frequencies, there can’t be anything you “can’t capture” by sampling at the Nyquist frequency.

4 comments

A triangle wave at 1Hz would have many higher frequency components. If you know a priori that the highest frequency of the signal is 1Hz, sampling at 2Hz is enough to infer 0, 1, 0, -1, ... came from a sine wave.
I've had an open GSoC project for some years to create a library that makes a handful of these audio misconceptions true. So the student would design an oscillator or oscillator bank where the closer you get to Nyquist, the more some "bad thing" happens to the corresponding output. Morphing into a triangle would be one way to do it.
What you are saying is generally correct, but: If you sample a 1 Hz sine at 2 Hz, you wouldn't get readings of 0, 1, 0, -1, etc.; you would get readings of 1, -1, 1, -1, etc., or if you're very unlucky, 0, 0, 0, 0, …! The _exact_ case is of Fs/2 is, well, an edge case.
You get the original sine wave back from 0, 1, 0, -1 not by plotting it linearly (which gives you the triangle) but by using a sinc interpolation function.