How to find RMS bandwidth of the below signal

11 ビュー (過去 30 日間)
Yogesh
Yogesh 2024 年 6 月 21 日
コメント済み: Yogesh 2024 年 7 月 4 日
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
  1 件のコメント
Yogesh
Yogesh 2024 年 7 月 4 日
hey Chandrika , thank you!!...
Have a good day..

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeFourier Analysis and Filtering についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by