given a discrete-time sinusoid x[n]=10cos(200*pi*t+1.2) where n is between 0 and 100 (including 0 and 100)
With the use of the fft command, i attempted to develop the MATLAB function to compute the follwing equation. Also use the command max in the peak search to determine the peak freqency.
t = 0:0.001:0.1-0.001; x = 10*cos(200*pi*t+1.2); function X = dtft(x, 200*pi) [L1, L] = size(x); z = exp(-j*w); X = 0; for n = L-1:-1:0, X = x(n+1) + z .* X; end Y=(X^2)/N p = max(X)
no outputs return at all. please help correct. thank u!
Best Answer