I can't place the fft curve at the signal frequency exactly. There's been a slight deviation of the fft peak at that frequency
1 回表示 (過去 30 日間)
古いコメントを表示
clear all
close all
clc
L=10;
n=1.45;
c=2.9979e8;
dt=6e-12;
T=10*2*L*n/c;
fmax = 1e9;
fs=80*fmax;
TA=-T/2:dt:T/2;
%t = (-T/2/dt:1:T/2/dt)*dt;
Nt=round(T/dt);
vsine = 1;
phi = vsine*sin(2*pi*fmax*TA);
EL1t=1.274e7*exp(1i*phi);
plot(TA,(EL1t));
%FA = ((0:Nt-1)-floor(Nt/2))/Nt*fs;
FA = (-Nt/2:Nt/2-1)/Nt*fs*2;
FP=fft(phi);
%fs=1/dt/Nt;
figure;
Z=plot(FA,fftshift(abs(fft(EL1t/Nt))));
xline(1e9);
xlim([-2e9 2e9]);
As per the logic , each peak should have been at the multiples of 1GHz like the first peak should have been at 1GHz and the next at 2GHz and so on.
But evidently there has been a slight devition.
0 件のコメント
回答 (1 件)
Paul
2024 年 5 月 5 日
The code has
fs = 80*fmax;
but the TA vector is space by dt, so fs should be
fs = 1/dt;
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Fourier Analysis and Filtering についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!