How to find RMS bandwidth of the below signal
7 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
L=10;
n=1.45;
c=2.9979e8;
dt=6e-12;
T=10*2*L*n/c;
fmax =2.5e9
%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))));
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1719921/image.png)
1 Kommentar
dpb
am 22 Jun. 2024
Bearbeitet: dpb
am 22 Jun. 2024
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?
Akzeptierte Antwort
Chandrika
am 4 Jul. 2024
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
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Fourier Analysis and Filtering 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!