a Nyquist series should look something like {...-1, 1, -1, 1, ... }, which i think means it is a sine wave sampled at the peaks and valleys exactly.

Now, given a sampling rate of 48 Hz, the Nyquist frequency should be 24 Hz.

If I am not mistaken, Nyquist series is basically the the dataset of a sine wave of frequency = Nyquist Frequency, sampled at the sampling rate given above.

in short, these are my matlab vars:

SR = 48;             //sampling rate (hz)
X  = 0:1/SR:2*pi;    //domain (time in general)
fNy= SR/2;           //nyquist frequency
Y1 = sin(2*pi*fNy*X);// a sine wave with freq = nyquist frequency.

when i plot X and Y1, i get a really messed up plot. (i think its zero since its so small in magnitude)

Nyq Fail

I believe that Y1 should be exactly = 1, -1, 1, -1, 1, -1 ... Where did I go wrong? thanks


1 Answer 1



Try Y1 = cos(2*pi*fNy*X);

(And think about the $x$-axis values at which you sampled the sine)

  • $\begingroup$ Thank you! Cosine works perfectly. Which i guess means i sampled the sine pi/2 out of phase. I am going to come back to you about the x-values $\endgroup$
    – zellwwf
    Jun 3, 2015 at 14:56
  • $\begingroup$ @zellwwf: You sampled the sine at $k\pi$, $k=0,1,\ldots$, i.e. exactly at its zeros, and what you saw was numerical noise. $\endgroup$
    – Matt L.
    Jun 3, 2015 at 15:01

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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