フィルターのクリア

Single-Sided Amplitude Spectrum Plot

6 ビュー (過去 30 日間)
twig27
twig27 2016 年 11 月 28 日
回答済み: Star Strider 2016 年 11 月 28 日
Hello,
I have a question regarding the fourier spectrum of a signal. Below I've posted code in which I generated a sinusoidal signal with a frequency of 5 kHz. Then I plotted the single-sided amplitude spectrum as recommended in the MathWorks documentation. The plot however does not show a peak of height 1 at 5 kHz, but a slightly lower one plus more frequencies in the vicinity. What happened there? Since my sampling rate is 20 kHz I dont suppose to violate the Nyquist theorem. Thanks for any hints!
if true
delta = 50E-6;
fs = 1/delta;
time = 0:delta:1;
f = 5E3;
signal = sin(2*pi*f*time);
figure;
plot(time,signal);
x = signal;
y = fft(x);
L = length(x);
P2 = abs(y/L);
P1 = P2(1:L/2+1);
P1(2:end-1) = 2*P1(2:end-1);
freq = fs*(0:(L/2))/L;
figure;
%loglog(freq,P1);
%semilogy(freq,P1);
plot(freq,P1);
end
  1 件のコメント
twig27
twig27 2016 年 11 月 28 日

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

採用された回答

Star Strider
Star Strider 2016 年 11 月 28 日
‘The plot however does not show a peak of height 1 at 5 kHz, but a slightly lower one plus more frequencies in the vicinity. What happened there?’
In ‘sampling’ your signal, you are actually ‘heterodying’ it with (modulating it with) the sampling frequency. Like all amplitude-modulation processes, this creates sidebands, so you end up with a transmitted-carrier double-sideband signal. The discrete Fourier transform is by definition a nonlinear process as well, so the result displays the fundamental frequency and sidebands, with the energy distributed amongst them.

その他の回答 (0 件)

カテゴリ

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

Community Treasure Hunt

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

Start Hunting!

Translated by