フィルターのクリア

fourier transform of sine wave help

2 ビュー (過去 30 日間)
yuvi
yuvi 2014 年 10 月 19 日
コメント済み: Star Strider 2014 年 10 月 19 日
hi everyone,
i have this simple code of a wave in time domain and frequency domain.
can someone pls help me understand this line ???
ff = Fs*(-0.5:1/length(t):0.5-1/length(t)); <-----------
thanks !
the code :
f0 = 10;
Fs = 10*f0;
t = 0:1/Fs:1;
x = cos(2*pi*f0*t);
X = abs(fftshift(fft(x)));
ff = Fs*(-0.5:1/length(t):0.5-1/length(t));
plot(t,x);
plot(ff,X);

回答 (1 件)

Star Strider
Star Strider 2014 年 10 月 19 日
It is coding for a two-sided (symmetric) Fourier series of the signal created in x. That is in keeping with the use of the fftshift function to define ‘X’.
  2 件のコメント
yuvi
yuvi 2014 年 10 月 19 日
Thanks Star Strider for your answer !
I need to understand this line particularly.
What is the meaning of 0.5 and -0.5 and length of t....
Thanks !
Star Strider
Star Strider 2014 年 10 月 19 日
My pleasure!
Putting this in context, ‘Fs’ is 100, ‘t’ goes from 0 to 1 in increments of 0.01 with a length of 101. The 0.5 (actually Fs*0.5) defines ‘ff’ to go from -50 to +50 in increments of 1/101.

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

カテゴリ

Help Center および File ExchangeProgramming についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by