what does the notation ( ' ) in the time sample t = (0:dt:0.002-dt) ' mean ??and thanks in advance
古いコメントを表示
Fs = 800e3;
dt = 1/Fs;
t = (0:dt:0.002-dt)';
Fm = 5000;
y = cos(2*pi*Fm*t);
figure;
plot(t,y);
採用された回答
その他の回答 (1 件)
Wayne King
2013 年 12 月 17 日
編集済み: Wayne King
2013 年 12 月 17 日
What makes you say the spectrum is not correct?
Fs = 800e3;
dt = 1/Fs;
t = (0:dt:0.002-dt);
Fm = 5000;
y = cos(2*pi*Fm*t);
ydft = fft(y);
ydft = ydft(1:length(y)/2+1);
df = Fs/length(y);
freqvec = 0:df:Fs/2;
plot(freqvec,abs(ydft))
It is exactly what I would expect.
5 件のコメント
abdalrahman elhaw
2013 年 12 月 17 日
編集済み: abdalrahman elhaw
2013 年 12 月 17 日
Wayne King
2013 年 12 月 17 日
Well for one thing I see in the above you have the sampling frequency set to 1000 Hz. I don't know what values you eventually provide for all your input() statements, but I see from your xlabel() in kHz that you are way undersampling the signal -- you are going to alias the output. You can't have a carrier frequency in the kHz range when the sampling frequency is only 1 kHz.
abdalrahman elhaw
2013 年 12 月 17 日
Wayne King
2013 年 12 月 17 日
because you have called fftshift which centers the DC component in the middle so the spectrum runs from -Fs/2 to Fs/2 in increments of df
abdalrahman elhaw
2013 年 12 月 18 日
カテゴリ
ヘルプ センター および File Exchange で Parametric Modeling についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!