I'm trying to write a simple script that should plot the spectrum in scilab, to test it I use a sinus function with 440hz so that I get my dirac in this position , my problem is that it doesn't work and I don't understand why? here's the code :
Fs = 8000;
f = 440;
t= 0:1/Fs:1;
y = sin(2*%pi*f*t);
nf = 1024; // number of point in the DFT
Y = fft(y)
f = Fs/2 * linspace(0,1,nf/2+1);
clf();
plot(f,abs(Y(1:nf/2+1)));
and this is what I get :
any idea why I get this ?