2 deleted 26 characters in body
source | link

The size of $y$ is 201. So frequency bin of fft is not 1 Hz. Change code for calculating $t$ and $y$:

Fs=200.
F=50.
t = [i*1./Fs for i in range(200)]
y = sin(2*pi*t*F)

Now you have only 1 peak on 50 Hz.

P.S.

  • Plot magnitude spectrum
  • Try to modify F (49, 49.5, 49.67). Enjoy!

Welcome to DSP and new questions!

The size of $y$ is 201. So frequency bin of fft is not 1 Hz. Change code for calculating $t$ and $y$:

Fs=200.
F=50.
t = [i*1./Fs for i in range(200)]
y = sin(2*pi*t*F)

Now you have only 1 peak on 50 Hz.

P.S.

  • Plot magnitude spectrum
  • Try to modify F (49, 49.5, 49.67). Enjoy!

Welcome to DSP and new questions!

The size of $y$ is 201. So frequency bin of fft is not 1 Hz. Change code for calculating $t$:

Fs=200.
F=50.
t = [i*1./Fs for i in range(200)]

Now you have only 1 peak on 50 Hz.

P.S.

  • Plot magnitude spectrum
  • Try to modify F (49, 49.5, 49.67). Enjoy!

Welcome to DSP and new questions!

1
source | link

The size of $y$ is 201. So frequency bin of fft is not 1 Hz. Change code for calculating $t$ and $y$:

Fs=200.
F=50.
t = [i*1./Fs for i in range(200)]
y = sin(2*pi*t*F)

Now you have only 1 peak on 50 Hz.

P.S.

  • Plot magnitude spectrum
  • Try to modify F (49, 49.5, 49.67). Enjoy!

Welcome to DSP and new questions!