fft tool - amplitude dependence vs. frequency
Show older comments
Hi,
I am trying to test a signal in the frequency domain. For the test I have tried a continuous wave, a sinus. I have noticed that the spectral amplitude of my signal change in function of its frequency (F1 in my example).
I have my Pin1_dBm only for F1 very low...
is it linked to the time windowing too long that we see a sort of sincardinal in the frequency domain?
thanks
here is the script :
%declarations
Fs = 1e3; %sample frequency
F1=0.42e3; %signal frequency
Tstop=2.54e6/Fs; %time window - duration of my simulation
t = 0:1/Fs:Tstop; %time step
Pin1_dBm=10; %power level of my signal
nbre_step=Tstop*Fs; %number of time steps during my time window
x = sqrt(2*10^((Pin1_dBm-30)/10))*cos(2*pi*F1*t); % my signal (Continuous wave)
In_spectrum_2sided_W=(abs(fft(x))/nbre_step).^2; %spectrum 2 sided in Watts
In_spectrum_1sided_W=In_spectrum_2sided_W(1:nbre_step/2+1);
In_spectrum_1sided_W(2:end-1)=2*In_spectrum_1sided_W(2:end-1); %spectrum 2 sided->1sided in Watts
In_spectrum_dBm=10*log10(1000*In_spectrum_1sided_W); %spectrum in dBm
freq=Fs*(0:(nbre_step/2))/nbre_step;
plot(freq,In_spectrum_dBm);
2 Comments
Paul
on 22 Sep 2021
Can you provide two plots with different values of F1 and show the difference that you are asking about?
David Lopez
on 23 Sep 2021
Accepted Answer
More Answers (0)
Categories
Find more on Spectral Measurements in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!


