Home Intro Basic Concept Comm-Link System Design Satellite Orbit Cost References

 Mars_Earth_link.m
close all
clc
clear
format compact

%downlink calcs
display('These are the downlink calculations')
%consts
c = 299792458; %m/s
dist_MtoE = 401.3e9; %m
d_earth_ant = 34; %m

Tsys = 20; %K
k = 1.39e-23; %J/K Boltzmann's constant

%downlink bandwidth
bitrate = 1.5e6; %bits/sec
codingrate = .5; %1/2 rate turbo code
coding_gain = 10;
codedbitrate = bitrate/codingrate;

%BPSK: 1 QPSK:2
mod = 2; %bits/sym
symrate = codedbitrate/mod; %sym/sec

%using optimum rolloff factor determined in homework
r = .3500;
BW_coded  = (1+r)*symrate;
M = 240;
BW = BW_coded*M; %hz
BWlink_Mhz = BW / 1e6

freq = 32e9; %hz
lambda = c/freq; %m
Q = 50; %terminals on Mars that will be communicating

% a range of EIRP to determine best to achieve specific BER
EIRPsat = [60:0.5:70];

eff_e_ant = .94;
G_earth_ant = 10*log10(eff_e_ant*(4*pi^2*(d_earth_ant/2)^2)/(lambda^2));

Pr_earth = EIRPsat + G_earth_ant -20*log10(4*pi/lambda*dist_MtoE);

Pn = 10*log10((k*Tsys*BW) + (10.^(Pr_earth./10)*(Q-1)));

procgain = 10*log10(M);

SNR_despread = Pr_earth-Pn + procgain;

%accounting for turbo coding gain, get 10 dB of coding gain for turbo code
%as seenin the figure in the book
%as determined by HW 6
SNR_uncoded = SNR_despread+coding_gain;

x = sqrt(2*10.^(SNR_uncoded./10));

BER_downlink = 1/2*erfc(x/sqrt(2));

semilogy(EIRPsat, BER_downlink);
title('EIRP of Satellite vs BER')
xlabel('EIRP of Satellite(dBW)');
ylabel('BER');
grid on

indexBER = find(BER_downlink <1e-6, 1, 'first');
EIRPsat = EIRPsat(indexBER)

%determining the satellite power and gain that will satisfy the BER
Pt_sat = 100 %W
G_sat_ant = EIRPsat - 10*log10(Pt_sat) %dB

eff_sat_ant = .8;
r_sat_ant = ((((10^(G_sat_ant/10))/eff_sat_ant)*(lambda^2))/(4*pi^2))^(1/2)
beamwidth = sqrt(30000/10^(G_sat_ant/10))
%beamwidth might get too small, check and see if OK with ablity to point at
%earth Given geometry can determine radius that beam will fall onto earth
beamwidth_radius_on_earth = tand(beamwidth/2)*dist_MtoE/1e3 %km

BER_downlink = BER_downlink(indexBER)
SNR_uncoded = SNR_uncoded(indexBER)

%--------------------------------------------------------------------------
display(' ');
display('These are the uplink calculations');
frequp = 34.5e9; %Hz
lambdaup = c/frequp;
%using same modulation scheme as above

G_earth_ant_up = 10*log10(eff_e_ant*(4*pi^2*(d_earth_ant/2)^2)/(lambdaup^2))
Pt_earth = 500000; %W
EIRPearth = 10*log10(Pt_earth)+G_earth_ant_up %dBW

G_sat_ant_up = 10*log10(eff_sat_ant*(4*pi^2*(r_sat_ant)^2)/(lambdaup^2))

Pr_sat = EIRPearth + G_sat_ant_up -20*log10(4*pi/lambdaup*dist_MtoE);

Pn = 10*log10((k*Tsys*BW) + 10^(Pr_sat/10)*(Q-1));

SNR_spread_up = Pr_sat - Pn;

SNR_despread_up = SNR_spread_up + procgain;

SNR_uncoded_up = SNR_despread_up+coding_gain

x = sqrt(2*10^(SNR_uncoded_up/10));

BER_uplink = 1/2*erfc(x/sqrt(2))
These are the downlink calculations
BWlink_Mhz =
     4.860000000000001e+02
EIRPsat =
    63
Pt_sat =
   100
G_sat_ant =
    43
r_sat_ant =
   0.23547557320742
beamwidth =
   1.22619806755753
beamwidth_radius_on_earth =
     4.294313392754615e+06
BER_downlink =
     8.512750676577547e-07
SNR_uncoded =
  10.58890347768661
 
These are the uplink calculations
G_earth_ant_up =
  81.52382217363169
EIRPearth =
     1.385135222169919e+02
G_sat_ant_up =
  43.65338233506735
SNR_uncoded_up =
  16.89770361765463
BER_uplink =
     2.195847986924769e-23
Creative Commons License