using Plots , FFTW , PlutoUI
Effect of aliasing
Now let us fix a few parameters and examine the effect of aliasing. Recall that for accurately capturing the frequency characteristics, we need to sample at atleast twice the frequency of the highest frequency component in the signal. Let the original signal be the 4 Hz sinusoid and let us sample it at 12 Hz (so three times the Nyquist)
md"""### Effect of aliasing
Now let us fix a few parameters and examine the effect of aliasing. Recall that for accurately capturing the frequency characteristics, we need to sample at atleast twice the frequency of the highest frequency component in the signal. Let the original signal be the 4 Hz sinusoid and let us sample it at 12 Hz (so three times the Nyquist)
"""
Main.var"workspace#3".fixedParams
module fixedParams
using Plots , FFTW
ts1 = 0:(1/100):π
title = "Original = 4 Hz\nDots sampling at 12 Hz"
# signal = sin.(2π*fi*ts2) + sin.(2π*10*ts2)
ts3 = 0:(1/12):π
end
fixedParams.pp
The radio buttons below will add a different frequency sinewave to the original signal.
md"""The radio buttons below will add a different frequency sinewave to the original signal."""
begin
fs1 = 100
title = "Dots sampling at 12 Hz"
ts3 = 0:(1/12):π
end
As you can see things are okay when we addeed a 1 Hz or 2 Hz sinewave to the original signal. However, as soon as we add a 6 Hz sine wave, we hit the limits. We no longer detect a peak. Then when we add a 10 Hz wave, the frequency is folded back and erroneously reported at 12-10 = 2 Hz.
md"""As you can see things are okay when we addeed a 1 Hz or 2 Hz sinewave to the original signal. However, as soon as we add a 6 Hz sine wave, we hit the limits. We no longer detect a peak. Then when we add a 10 Hz wave, the frequency is folded back and erroneously reported at 12-10 = 2 Hz."""