How to plot the actual frequency range for the FFT plot?
23 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Suppose I have a complex linear frequency modulated signal, where the frequency of it sweeps from 9.975 GHz to 10.025 GHz with 50 MHz bandwidth and the time duration is 10 . As my sampling frequency is fixed as 51.2 MHz, the FFT plot of the signal is shown below,
The corresponding code is given below.
clear all;
close all;
clc;
%% Signal parameter
c = 3e8; % speed of light
fc= 10e9; % carrier frequency
lambda = c/fc; % wave length
B = 50e6; % bandwidth
Tchirp = 1e-5; % duration time
slope = B / Tchirp; % slope
Nr = 513; % number
fs = (Nr-1)/Tchirp; % sampling frequency
t = linspace(0,Tchirp,Nr);
t(Nr)=[];
St = exp(1j*2*pi*((fc-B/2)*t + (slope*t.^2)/2)); % signal
St_all = [St];
figure; % check fft plot
plot(abs(fft(St_all)));
As my signal ranges from 9.975 GHz to 10.025 GHz. What is the actual frequency for x axis here? Why the FFT plot will include the current period of signal and an adjacent period here? Meanwhile, is there any way to present the whole 50 MHz of signal in a single FFT plot?
0 Kommentare
Antworten (2)
Star Strider
am 16 Apr. 2023
One approach —
%% Signal parameter
c = 3e8; % speed of light
fc= 10e9; % carrier frequency
lambda = c/fc; % wave length
B = 50e6; % bandwidth
Tchirp = 1e-5; % duration time
slope = B / Tchirp; % slope
Nr = 513; % number
fs = (Nr-1)/Tchirp; % sampling frequency
t = linspace(0,Tchirp,Nr);
t(Nr)=[];
St = exp(1j*2*pi*((fc-B/2)*t + (slope*t.^2)/2)); % signal
St_all = [St];
L = numel(St_all)
FT_St = fft(St_all)/L;
Fv = linspace(0, 1, fix(L/2)+1)*fs/2; % Frequency Vector
Iv = 1:numel(Fv); % Index Vector
figure; % check fft plot
plot(Fv, abs(fft(St_all(Iv))));
xlabel('Frequency (Hz)')
ylabel('Magnitude (units)')
xlim([min(Fv) max(Fv)])
The code for ‘Fv’ originates in the documentation for fft in R2015b. I have used it since, although other ways to calculate the frequency for a one-sided fft that produce the same result are equally valid. The ‘Iv’vector simply make subsequent addressing easier. It is not required.
.
7 Kommentare
Paul
am 16 Apr. 2023
Bearbeitet: Paul
am 16 Apr. 2023
clear all;
close all;
clc;
%% Signal parameter
c = 3e8; % speed of light
fc= 10e9; % carrier frequency
lambda = c/fc; % wave length
B = 50e6; % bandwidth
Tchirp = 1e-5; % duration time
slope = B / Tchirp; % slope
Nr = 513; % number
fs = (Nr-1)/Tchirp; % sampling frequency
t = linspace(0,Tchirp,Nr);
t(Nr)=[];
St = exp(1j*2*pi*((fc-B/2)*t + (slope*t.^2)/2)); % signal
St_all = [St];
Frequency vector corresponding to St_all
N = numel(St_all);
f = (0:(N-1))/N*fs;
figure; % check fft plot
plot(f,abs(fft(St_all)));
xlabel('Hz')
The reason that all the action is around 4.22e7 Hz is because the sampling frequency
fs
is way too small relative the base sinusoidal frequency
fc - B/2
The 4.22e7 result is the aliased frequency.
If we make the sampling frequency more than two times larger than the base frequency
fs = (fc - B/2)*5 % sampling frequency
then we get this result:
t = linspace(0,Tchirp,round(Tchirp*fs));
St = exp(1j*2*pi*((fc-B/2)*t + (slope*t.^2)/2)); % signal
St_all = [St];
Frequency vector corresponding to St_all
N = numel(St_all);
f = (0:(N-1))/N*fs;
figure; % check fft plot
plot(f,abs(fft(St_all)))
xlabel('Hz')
xlim([9e9 11e9])
xline(fc-B/2,'r')
Siehe auch
Kategorien
Mehr zu Pulsed Waveforms finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!