% Variable declaration
diameter_T= 4;
diameter_R=1;
c=3e8;
f=3e9;
 
lambda=c/f;         % wavelength in (meter)
p_transmit= 50;     % transmit power in (Watt) 
p_transmit_dB= 10 * log10(p_transmit);
n=[1,1.5];
path_loss= 20*log10((4*pi*n)/lambda);
n_c02=1.5;           % refractive index of co2
r_sat_earth= 184e9;   % distance from earth to orbital in (meters)
r_sat_probe =18806e3;    % distance from orbital to probe on venus surface
 
% GAINS 
Gain_R=(4*pi*pi*(diameter_R)^2)/(4*(lambda^2));
Gain_T=(4*pi*pi*(diameter_T)^2)/(4*(lambda)^2);
Gain_R_dB=3;
Gain_T_dB=10*log10(Gain_T);
P_r_probe= (p_transmit_dB) + (Gain_T_dB) + (Gain_R_dB) - (20*log10(r_sat_probe))...
    - 20*log10(4*pi*n(2)/lambda);
 
% noise parameters 
k=1.3807e-23;
temp_venus = 700;  % venus temperature in degree (Kelvin)
band_wit= 1e6;   % bandwidth of signal 
noise_power = 10*log10(k*temp_venus*band_wit);
S_N_R= (P_r_probe) - (noise_power);
S_N_R_linear = 10^(S_N_R/10);
 
  
% Shanon Chanel Capacity 
c_capacity= band_wit*(log10(S_N_R_linear + 1)/log10(2));
 
% BER for  M-ary Modulation scheme
 
M= [1,2,3,4,5,6];
BER= (4*(1-(1/sqrt(M(4)))))*Q(sqrt((3*S_N_R_linear)/(M(4)-1)));
