how to use fft command to compute equation?

given a discrete-time sinusoid x[n]=10cos(200*pi*t+1.2) where n is between 0 and 100 (including 0 and 100)
how to use fft command to compute the following equation?
and how to use the command max in the peak search to determine the peak freqency?

1 件のコメント

Matt J
Matt J 2012 年 10 月 23 日
you probably want to edit this formula
x[n]=10cos(200*pi*t+1.2)
There is no dependence on n shown on the right hand side.

サインインしてコメントする。

回答 (1 件)

Matt J
Matt J 2012 年 10 月 23 日
編集済み: Matt J 2012 年 10 月 23 日

0 投票

Hint: Notice that the quantity inside the | |^2 is the formula for the FFT of x[n], up to some scale factor maybe.
As for using MAX, it should be very straightforward from the documentation.

3 件のコメント

modified covariance
modified covariance 2012 年 10 月 23 日
thanks for ur hint, but what i want is to use matlab code to compute. i am a matlab idot,sadly speaking. so could anyone help?
Matt J
Matt J 2012 年 10 月 23 日
No, nobody will help until you've shown some attempt at reading the documentation and informing yourself about MATLAB.
The tasks you say you want to perform are straightforward applications of the MATLAB commands FFT and MAX and the help documentation on these should make it very clear how to do what you need.
modified covariance
modified covariance 2012 年 10 月 23 日
編集済み: modified covariance 2012 年 10 月 23 日
i did try, but failed. pleas see what i did.
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
p = max(X)
no outputs return at all, and how to sub. | |^2 and 1/N into the code?

サインインしてコメントする。

カテゴリ

ヘルプ センター および File ExchangeFourier Analysis and Filtering についてさらに検索

質問済み:

2012 年 10 月 23 日

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by