Altera_Forum
Honored Contributor
13 years agodft problem
greetings,
hi i have typed followin code to verify samplng theorem but the answer is coming something different.may i know the reason. clc; fs=800; t=0:1/fs:1 x=cos(2*pi*400*t); xm=(fft(x)); k=0:length(xm)-1; subplot(2,2,1); stem(k,xm) xlabel('hertz') ylabel('magnitude') title('sampling') the result should come at only one frequency(i.e one line at frequency of cosine) as the signal is cosine but spectrum is continious. why ? the spectrum (o/p)is attached here thanks in advance