Nyquist frequency - Plasmatree/PID-Analyzer GitHub Wiki

You have probably often heard the phrase: "If you want to look at noise at 500hz, you have to set your log rate to 1khz." Or something similar. Statements like this are based on a confusion of the Nyquist frequency fN and Nyquist–Shannon sampling theorem.

It is true that the max resolvable frequency of a digital signal is half the sampling rate fN. But when we look at the spectrum, we want to get a suitable representation of the vibrations in our system and these also consist of frequencies >fN. The resulting effect is called "aliasing" and basically maps vibrations with >fN to frequencies <fN.

An analogy: Think of a rotating wheel and a strobe light. The rotation of the wheel is the vibration in our system. The flash frequency of the strobe is the sampling rate and is constant. As the wheel speeds up, you see it rotating forward. As it approaches a certain speed (frot = fstrobe/2 = fN) it suddenly looks like it's slowing down, stopping and accelerating backwards. This happens at each multiple of fN as the wheel is going faster and faster. That's aliasing.

In a 2d spectrum this can easily fool you. In 3d spectrograms it might be more obvious:
Aliasing from too slow sampling The prominent motor noise cannot be resolved as it exceeds ~500hz. The aliased result looks like it is reflected at the upper edge of the spectrograms. Even though it's only visible at the motor noise, it happens everywhere! The bigger the difference of sample frequency vs. gyro frequency, the more often this "reflection" happens, and aliased noise is "folded" into the result.

Logging 32khz gyro at 2khz means 16 "reflections" --> even low-level noise adds up and results in a way higher baseline than the system really experiences.

⚠️ **GitHub.com Fallback** ⚠️