How to find RMS bandwidth of the below signal

11 次查看(过去 30 天)
L=10;
n=1.45;
c=2.9979e8;
dt=6e-12;
T=10*2*L*n/c;
fmax =2.5e9
fmax = 2.5000e+09
%fs=80*fmax;
TA=-T/2:dt:T/2;
fs=1/dt;
%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;
FP=fft(phi);
%fs=1/dt/Nt;
Z=plot(FA,fftshift(abs(fft(EL1t/Nt))));
I want to find the RMS linewidth of the above signal and the formula for it is given here , but I am confused how to implement it in the code.
  1 个评论
dpb
dpb 2024-6-22
编辑:dpb 2024-6-22
Let's get a better picture of what the result actually is...
L=10;
n=1.45;
c=2.9979e8;
dt=6e-12;
T=10*2*L*n/c;
fmax =2.5e9;
fmax = 2.5000e+09;
%fs=80*fmax;
TA=-T/2:dt:T/2;
fs=1/dt;
%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;
FP=fft(phi);
%fs=1/dt/Nt;
Z=plot(FA,fftshift(abs(fft(EL1t/Nt))));
set(gca,'YScale','log')
OK, it is all positive; what have you tried so far to simply translate the formula into MATLAB code?
At least make an attempt here...it appears it should be about a two-three line exercise -- note the difference in MATLAB between the "dot" operator times, .* and mtimes, *

请先登录,再进行评论。

采纳的回答

Chandrika
Chandrika 2024-7-4
Hello Yogesh,
From your code, I could understand that 'FA' is the Frequency vector computed using sampling frequency 'fs' and the number of time samples 'Nt'
Further, in order to implement the formula to compute RMS linewidth in your given code, you may refer the sample code I am attaching below:
L=10;
n=1.45;
c=2.9979e8;
dt=6e-12;
T=10*2*L*n/c;
fmax =2.5e9;
fmax = 2.5000e+09;
TA=-T/2:dt:T/2;
fs=1/dt;
Nt=round(T/dt);
vsine = 1;
phi = vsine*sin(2*pi*fmax*TA);
EL1t=1.274e7*exp(1i*phi);
% Frequency vector computed
FA = (-Nt/2:Nt/2-1)/Nt*fs;
% FFT of the signal copmuted and normalized
EL1t_fft = fft(EL1t) / Nt;
% Power computed
Pow = abs(fftshift(EL1t_fft)).^2;
% Computing rms_linewidth as per the formula
rms_linewidth = 2*(sqrt(sum((FA).^2 .* Pow) / sum(Pow)));
Here, 'Pow' indicating the Power has been calculated premised upon the idea that Power is the squared magnitude of a signal's Fourier transform, normalized by the number of frequency samples as could be found in this documentation: https://in.mathworks.com/help/matlab/math/fourier-transforms.html
I hope you find the above provided workaround useful!
Regards,
Chandrika

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Fourier Analysis and Filtering 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by