One of the most fundamental ways of representing signals is using sinusoidals waves. A basic sine wave of frequency @@0@@, amplitude @@1@@, phase @@2@@ and displacement @@3@@ can be represented by:
Let's plot a sine wave of @@0@@, @@1@@ and sample frequency @@2@@ hertz
Note that the unit of @@0@@ is @@1@@ radians
Now let's define a function to return the signal of a generic sine wave
Let's also define a funciton to return the values for a generic time line. Remember that sample period @@0@@, giving in terms of the sampling frequency @@1@@.
In the plot above, we have a sine wave of @@0@@ hz sampled at @@1@@ hz. In this section we will introduce the Nyquist Theorem intuitively. This theorem states that the maximum frequency that can be properly represented is half of the sampling frequency, i.e.,
Note that this theorem holds for continuous values. When dealing with discretized values we need to sample the signal by a factor greater than 2. Let's observe how the plot behaves when decreasing the sampling frequency, @@3@@.
As we observe bellow, the @@0@@ hz is the smallest frequency that is able to represent properly the sine wave of @@1@@ hz. This is because the sampling periodicity has to match, i.e. be in phase with, the maximum and minimum points of the maximum frequency to be measured in order to properly capture its magnetude.
If the sampling starts in phase with the maximum and minimum points of the maximum frequency to be measured, its possible to fully capture a signal by sampling it with double of the frequency of its maximum frequecy. See the plots bellow.
In both cases, we observed that a @@0@@ hz sine wave is not properly represented when sampling with @@1@@ Hz, though @@2@@ didn't reproduced the actual values for the maximum and minimus of the original signal. Hence, in order to ensure the signal will be accurately represented, the signal needs to be sampled over the Nyquest Frequency. The oversampling of the signal might depend on the application.
Suggested ways are