> please explaine how it occures even if i dont generate frequecys above Nyquist?
Let’s say my sample rate is 20kHz and I want to generate a sawtooth at 700 Hz. I use the following code:
x += 700.0 / 20000.0
if (x >= 1.0) x-= 1.0
You think that x has no aliasing because its frequency is below Nyquist? Well x has an infinite number of harmonics at 700 Hz, 1400, 2100, 2800, etc. Its 15th harmonic is at 10500 Hz and will be aliased. Another way to realize that is to consider the point at which the waveform resets: the spacing between these points is either 28 or 29 samples. 20000 / 700 = 0.57142857. The fractional phase when a reset occurs will be 0.57142857, 0.14285714, 0.71428571, 0.28571428, 0.857142, 0.42857142, 0.0 - a pattern that repeats every 7th reset… So there’ll be a subharmonic at 100 Hz.
That’s why we strive to generate band-limited waveforms which do not have harmonics above Nyquist. In the code above, x is certainly not band-limited.