I am given a task to do sampling on the function $$f(t) = 1.3 \sin(2\pi \cdot 10 \cdot t)$$ with sampling frequency 4 Hz and start at time t_start = 0.0877s, so there should be aliasing and in the frequency spectrum, the amplitude should be at the perceived frequency. The perceived frequency is 2 Hz as the folding frequency.

I chose to take $N=128$ data points.

enter image description here

Then after completing FFT with sampled $f(t)$, I wanted to plot frequency spectrum, however I have a peak of 1.815 at 2 Hz, however the height of peak should be around 1.3. Here I attached this spectrum.

enter image description here

Is there any explanation to this? Usually due to the leakage, the peak should be less than the actual amplitude, however I got higher peak. It seems quite strange for me.

Here is also a Matlab code, if you find it more convenient to check.

t = 0.0877:0.25:32.087;
signal = 1.3.*sin(2.*pi.*10.*t);

y = fft(signal);

%65th data point corresponds to fft at 2 Hz

Thank you in advance.


2 Answers 2


10 Hz aliasing down to two Hz which is the Nyquist frequency.

When you sample a Nyquist frequency signal, you only get two samples per period and the two samples are exactly 180 degree apart, i.e. you always get the same numbers with alternating sines.

Which number you get depends on the relative phase fo your sample clock and the signal.If you sample a consine you samle at the peaks and you get [1 -1 1 -1 ...] . If you sample a sine wave , you sample at the zeros and you get [0, 0, 0, 0 ...]. For any other phase, you get something in between.

Keep in mind that the sampling theorem requires the signal the be bandlimit to "less than half the sample rate" not to "equal or less than half the sample rate".

  • $\begingroup$ Thank you for your answer, but I wonder why the peak is 1.83 when he should be 1.3 or less? $\endgroup$ Commented Nov 8, 2020 at 13:35
  • $\begingroup$ Why should it be 1.3? It'll be anywhere between 1.3*sqrt(2) and 0 depending on the relative phase between your sine wave and the sampling clock. You are violating the sampling theorem, so standard rules do not apply. $\endgroup$
    – Hilmar
    Commented Nov 8, 2020 at 16:33
  • $\begingroup$ oh, I see. Thank you! $\endgroup$ Commented Nov 10, 2020 at 11:24

In your MATLAB code, dividing the maximum spectral magnitude sample by 'numel(t)/2' is only valid (correct) when the aliased spectral component is at a DFT bin center and less than half the sample rate.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.