suru
Full Member level 3
plz help me . refer the following program,
....main aim. i want to generate 2000hz frequncy and plotting time and frequncy spectrum for the same. i have got all the result but frequncy plot result is not correct.
% Calculate data
n1=2000;
n2=500;
t=0:0.1:50
x = sin(2*pi*n1*t) + sin(2*pi*n2*t);
y = fft(x,512);
m = y.*conj/512;
f = 1000*(0:256)/512;
% Create frequency plot
plot(f,m(1:257))
grid on
response should be correct. i got plot but showing wrong values.
....main aim. i want to generate 2000hz frequncy and plotting time and frequncy spectrum for the same. i have got all the result but frequncy plot result is not correct.
% Calculate data
n1=2000;
n2=500;
t=0:0.1:50
x = sin(2*pi*n1*t) + sin(2*pi*n2*t);
y = fft(x,512);
m = y.*conj/512;
f = 1000*(0:256)/512;
% Create frequency plot
plot(f,m(1:257))
grid on
response should be correct. i got plot but showing wrong values.