필터 지우기
필터 지우기

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

채택된 답변

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 CenterFile Exchange에서 Spectral Measurements에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by