function [y_log]=Lorentz_gl_gain(v,f)
global L
P=v(1);         % P_pump
gamma=v(2);     % width 
f0=v(3);        % peak center
y0=v(4);        % baseline
mm=v(5);        % m value
dd=v(6);        % d value

g0=0.2;                                                    % (Wm)^(-1)
alpha_log=0.2;                                             % fiber logarithm attenuation, unit: dB/km
alpha_lin=alpha_log/4.343;                                 % fiber linear attenuation, unit: /km
L_eff=(1-exp(-alpha_lin*L))/alpha_lin;                     % effective length, unit: km

G_complex=0.5*g0*P*L_eff./(1-2*i*(f-f0)/gamma)...
    -0.5*g0*P*mm*L_eff./(1-2*i*((f-f0)-dd*gamma)/gamma)...
    -0.5*g0*P*mm*L_eff./(1-2*i*((f-f0)+dd*gamma)/gamma);    % complex SBS loss coefficient
y_lin=real(exp(G_complex));
y_log=y0+10*log10(real(exp(G_complex)));                      % real part: amplitude gain
end