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
%program to find the fft of sine function of frequency 1GHz
%Available information , frquency=1GHz
clear all
close all
clc
fmax=1e9; %maximun frequency of the signal
fs=60*fmax;
ts=1/fs; %time increment
T=10e-9; %total time signal exists
TA=(-T/2:ts:T/2); %time axis
N=numel(TA);
f=1e9; %frequency of the signal
Y=sin(2*pi*f*TA); %sine function
plot(TA,Y);
FA=(-N/2:N/2-1)*fs/N; %frequency axis
FFT=fft(Y); %fourier transform of the signal
figure;
plot(FA,fftshift(abs(FFT)));
xlim([-2e9 2e9]);
xline(-1e9);
As shown below there’s a slight deviation at the peak of the fft curve, I can’t figure why there is deviation at the peak
Isn’t the peak supposed to be at exactly at 1GHz.
xline(1e9);%program to find the fft of sine function of frequency 1GHz
%Available information , frquency=1GHz
clear all
close all
clc
fmax=1e9; %maximun frequency of the signal
fs=60*fmax;
ts=1/fs; %time increment
T=10e-9; %total time signal exists
TA=(-T/2:ts:T/2); %time axis
N=numel(TA);
f=1e9; %frequency of the signal
Y=sin(2*pi*f*TA); %sine function
plot(TA,Y);
FA=(-N/2:N/2-1)*fs/N; %frequency axis
FFT=fft(Y); %fourier transform of the signal
figure;
plot(FA,fftshift(abs(FFT)));
xlim([-2e9 2e9]);
xline(-1e9);
As shown below there’s a slight deviation at the peak of the fft curve, I can’t figure why there is deviation at the peak
Isn’t the peak supposed to be at exactly at 1GHz.
xline(1e9); %program to find the fft of sine function of frequency 1GHz
%Available information , frquency=1GHz
clear all
close all
clc
fmax=1e9; %maximun frequency of the signal
fs=60*fmax;
ts=1/fs; %time increment
T=10e-9; %total time signal exists
TA=(-T/2:ts:T/2); %time axis
N=numel(TA);
f=1e9; %frequency of the signal
Y=sin(2*pi*f*TA); %sine function
plot(TA,Y);
FA=(-N/2:N/2-1)*fs/N; %frequency axis
FFT=fft(Y); %fourier transform of the signal
figure;
plot(FA,fftshift(abs(FFT)));
xlim([-2e9 2e9]);
xline(-1e9);
As shown below there’s a slight deviation at the peak of the fft curve, I can’t figure why there is deviation at the peak
Isn’t the peak supposed to be at exactly at 1GHz.
xline(1e9); fft, plot MATLAB Answers — New Questions