フィルターのクリア

why are the peaks of FFT of generated signal slighty off?

2 ビュー (過去 30 日間)
Viktor von den Brincken
Viktor von den Brincken 2017 年 12 月 4 日
回答済み: Christoph F. 2017 年 12 月 4 日
I want to generate a signal of fixed length with two dampened frquency components 2 and 8. Then I would like to identify these frequencies using fft. Unfortunately, regarding the magnitude-frequency domain, the determined frequencies seem slightly off.
my code:
close
clear
clc
fs = 800; %sampling frequency
ts = 10; %signal length
efq1 = 2; %frequencies 2 and 8
efq2 = 8;
t = 0:1/fs:ts; %vector length
w1 = 2*pi*efq1; %pulsatances
w2 = 2*pi*efq2;
x = exp(-0.1.*w1.*t).*20.*sin(w1.*t)+exp(-0.2.*w2.*t).*50.*sin(w2.*t);
figure;
subplot(1,2,1)
plot (t,x);
grid on;
nfft=8192;
Y = fft(x,nfft);
Y = Y(1:nfft/2);
mY=abs(Y);
f1 = (0:nfft/2-1)*fs/nfft;
subplot(1,2,2);
plot(f1,mY);
grid on;
in the attached image you see the amplitude-time domain and the magnitude-frequency domain, zoomed in to visualize the deviation. can you tell me why this is and how to eliminate the deviation?

回答 (1 件)

Christoph F.
Christoph F. 2017 年 12 月 4 日
Multiplying a function with another function can change the frequency content, as this corresponds to convolving the two image functions in the frequency domain.

カテゴリ

Help Center および File ExchangeAI for Signals についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by