# Aliasing correspondance with respect to DFT

Given a sampling frequency Fs lets say we plot the magnitude of the fft of a temporal signal $$x$$, for different frequencies above the Nyquist frequency, to show the effect of aliasing:

Fs=10;
t=0:1/Fs:1-(1/Fs);
f=6;%7,8,9, ... to see aliasing starting a 6 since 6 is just above the Nyquist freq
x=sin(2*pi*f*t);
freq_range=Fs*((0:length(x)-1)/length(x));
plot(freq_range,abs(fft(x)));


Can someone help to formulate mathematically to which lower frequencies a given freqency f > Fs/2 will be aliased to?

Experimentally, we can see that (for integer frequencies, dont know if it really makes sense to use fractionnal ones?):

6 -> 4

7 -> 3

8 -> 2

9 -> 1

10 -> 0 <- should be zero? but the spectrum goes crazy and there are peaks everywhere.

Why? Then one would think that this would be periodic i.e. f=11 -> f_aliased=1, etc. back to zero in decreasing order, then again some strange things happens at 15 then it goes on cyclically etc. What is the relation?

Also, w.r.t. spectral resolution ($$\Delta f = F_s/N$$, let $$N$$ be the nb of samples, i.e. length(x)), one could ask if the next frequency abouve the Nyquist is in fact $$f_{Nyq}+\Delta f = (F_s/2)+\Delta f$$ ? But in this example the spectral resolution $$\Delta f$$ = 1 right?

2. Look at your y axis and make sure your graphs are properly scaled. $$f=10$$ aliases indeed back to $$f=0$$. All you see is numerical noise and your y-scale is $$10^{-15}$$. This would be different if you choose a a different phase, cosine instead of sine.