21 lines
513 B
Matlab
21 lines
513 B
Matlab
function NF_dB = noiseFigureFromOSNR(Pin_dBm, OSNR_dB, lambda_nm, Bref_nm)
|
|
|
|
if nargin < 4
|
|
Bref_nm = 0.1; % OSNR reference bandwidth
|
|
end
|
|
|
|
h = 6.62607015e-34; % Planck [J*s]
|
|
c = 299792458; % speed of light [m/s]
|
|
|
|
lambda = lambda_nm * 1e-9;
|
|
nu = c / lambda;
|
|
|
|
% convert reference bandwidth from nm to Hz
|
|
Bref_Hz = Bref_nm*1e-9 * c / lambda^2;
|
|
|
|
% ASE noise power density in dBm
|
|
Pn_dBm = 10*log10(h*nu*Bref_Hz) + 30;
|
|
|
|
NF_dB = Pin_dBm - OSNR_dB - Pn_dBm;
|
|
end
|