In [1]:

```
import math
#Variable Declaration
PRF = 1000; #Pulse repetitive frequency in Hz
t = 0.15*10**-3; #Round propagation time in s
c = 3*10**8; #velocity of EM waves in m/s
#calculations
R = (c*t)/float(2); #Range
Runamb = c/float((2*PRF)); #Max unambiguous range
#Result
print'Target Range = %3.1f Km' %(R/float(1000));
print'Maximum Unambiguous range = %d Km'%(Runamb/float(1000));
```

In [2]:

```
import math
#Variable Declaration
f = 10*10**9; # radar Tx frequency
c = 3*10**8; # velocity of EM waves in m/s
V = 108; # vel of car in kmph
# Calculations
lamda = c/float(f); # wavelength in m
Vr = V*(5/float(18)); # vel of car in m/s
fd = (2*Vr)/float(lamda); # Doppler shift in Hz
fr = f + fd # received freq
fr_away = f-fd # Rx frequency if the car is moving away from radar
# Result
print'Doppler Shift = %d Khz'%(fd/float(1000));
print'Frequency of Received signal = %3.6f Ghz'%(fr/float(10**9));
print'Received Frequency if car is moving away from radar = %3.6f Ghz'%(fr_away/float(10**9));
```

In [5]:

```
import math
#Variable Declaration
f = 10*10**9; # radar Tx frequency
PRF = 2000; # Pulse repetitive frequency in Hz
Vr = 0.5; # radial vel in Mach
c = 3*10**8; # velocity of EM waves in m/s
vs = 330; # velocity of sound in m/s
# Calculations
lamda = c/float(f); # wavelength in m
max_unamb_fd = PRF/2; # maximum unambiguous doppler shift
Vrunamb = (lamda*max_unamb_fd)/2; # doppler shift
Vaircraft = 0.5*vs; # Converting from Mach to m/s
fd_desired = (2*Vaircraft)/lamda;
PRF_desired = 2*fd_desired; # desired PRF
# Output
if Vrunamb < Vaircraft:
print'The radar is not capable of determining unambiguously the velocity of the approaching aircraft\n';
print'Desired Pulse Repetition Rate = %d Khz'%(PRF_desired/1000);
```

In [6]:

```
import math
# Given Data
PW_tx = 10**-6; # Transmitted pulse width
Rx_PW = 10**-6; # Received pulse width
c = 3*10**8; # velocity of EM waves in m/s
# Calculations
RR = (c*Rx_PW)/float(2); # Range Resolution in m
# output
print'This Radar can resolve upto an inter target separation in range of %d m\nTherefore,given radar will be able to resolve the targets'%RR;
```

In [6]:

```
import math
#Variable Declaration
CRR = 100; # Cross range resolution in m
R = 3000; # radial range
# Calculations
# CRR = (R*theta3)*(math.pi/180);
theta3 = (180*CRR)/(math.pi*R) # 3 dB beamwidth
# Result
print'3 dB beamwidth = %3.2f°'%theta3;
```

In [8]:

```
import math
#Variable Declaration
Vs = 330; # velocity of sound in m/s
NM = 1.85*(5/float(18)) # 1NM equivalent in m/s
V1 = 0.5; # velocity of first aircraft in mach
V2 = 400; # velocity of second aircraft in NM/hr
theta = 30; # angle with radial axis in degrees
lamda = 3*10**-2; # wavelength in m
# Calculations
v1 = V1*Vs # velocity of first aircraft in m/s
fd1 = (2*v1)/float(lamda); # doppler freq.
v2 = V2*NM*(math.cos(30*(math.pi/180))); # velocity of second aircraft in m/s
fd2 = (2*v2)/float(lamda); # doppler freq
dd = fd2 - fd1; # doppler difference
Tl = 1/float(dd); # look time in s
# Result
print'Required minimum look time = %3.2f ms'%(Tl/float(10**-3));
print'\nNote: Cos(30) value is taken as 0.5 in textbook';
```

In [9]:

```
import math
# Given Data
# Rmax = [1000000/(12.4*PRF)]NM
# = [1000000*t/12.4]NM
print'The Numerator represents round trip propagation time in us\n';
print'Therefore, number 12.4 represents the units microseconds per nautical miles\n';
print'In other words, this means that the round propagation time for one nautical mile is 12.4 us which is equivalent to 6.66us for 1km range'
```

In [7]:

```
import math
# variable Declaration
PW = 10*10**-6; # pulse width in sec
f = 10*10**9; # frequency in Hz
fm = 1000; # modulating frequency
# calculations
BW_M = 1/float(PW); # matched bandwidth
cf1 = f+fm; # closest freq.
cf2 = f-fm; # closest freq.
fo = f; # centre freq.
# Output
print'Centre of frequency spectrum = %d Khz'%(fo/float(10**3));
print'The two closet frequencies to the center of the spectrum are %d Khz'%(cf1/float(10**3)),' and %d Khz'%(cf2/float(10**3));
```

In [8]:

```
import math
# Variable Declaration
fc1 = 495; # freq in Mhz
fc2 = 505; # freq in Mhz
# Calculations
fo = (fc1 + fc2)/float(2); # Center of spectrum in Mhz
BW = fc2 - fc1; # Bandwidth in Mhz
PW = 1/float(BW); # compressed pulse width in us
# Result
print'Center of spectrum = %d Mhz\n'%fo,'Matched Bandwidth = %d Mhz\n'%BW,'Compressed Pulse width = %3.1fus'%PW;
```

In [9]:

```
import math
# variable Declaration
f = 10**9; # CW radar waveform freq.
fm = 100; # modulation freq. in Hz
MaxfD = 500; # max freq deviation in Hz
c = 3*10**8; # vel. of EM waves in m/s
# Calculations
Mf = MaxfD/float(fm); # Modulation index
BW = 2*(Mf + 1)*fm # Bandwidth
RR = c/float((2*BW)); # Range Resolution in m
# Result
print'Bandwidth = %d Hz\n'%BW,'Range Resolution = %d Km'%(RR/float(1000));
```

In [10]:

```
import math
# Variable Declaration
f = 10**9; # Centre freq. of spectrum
t = 13 # pulse width in us
N = 13; # N-bit Barker code
# Calculations
Sub_PW = t/float(N); # sub pulsewidth
match_BW= 1/float(Sub_PW); # Matched bandwidth in Mhz
# Output
print'Matched Bandwidth = %d Mhz\n'%match_BW,'Center Frequency of the spectrum = %d Ghz'%(f/float(10**9));
```

In [11]:

```
import math
# Variable Declaration
PW = 10**-6; # Pulse width in sec
Pp = 100*10**3; # Peak power in watts
PRF = 1000; # pulse rep.rate
N_target= 20; # no of target hits in 1 dwell period
# Calculations
PE = Pp*PW; # Pulse energy in Joule
LE = N_target *PE; # look energy
DC = PW*PRF # Duty cycle
Pav = Pp*DC; # Average power
Pavg = 10*math.log10(Pav); # Avg power in dB
# result
print'Average power = %d dB\n'%Pavg,'Look Energy = %3.0f Joules'%LE;
```

In [20]:

```
import math
# Variable Declaration
PW = 10**-6; # Pulse width in sec
Pp = 100*10**3; # Peak power in watts
PRF = 1000; # pulse rep.rate
N_target= 20; # no of target hits in 1 dwell period
# Calculations
PE = Pp*PW; # Pulse energy in Joule
LE = N_target *PE; # look energy
DC = PW*PRF # Duty cycle
Pav = Pp*DC; # Average power
Pavg = 10*math.log10(Pav); # Avg power in dB
Pp_dB = 10*math.log10(Pp); # Peak power in dB
DCCF = Pp_dB - Pavg # Duty cycle correction factor
# result
print'Duty cycle correction factor = %d dB'%DCCF;
```

In [29]:

```
import math
# Variable Declaration
G_rx = 97; # Rx gain in dB
Bn = 5*10**6; # Bandwidth in Hz
To = 300; # temperature in kelvin
K = 1.38*10**-23; # Boltzmann constant in J/k
n = -3 # o/p noise power in dBm
# calculations
Pn_dB = n-G_rx # input noise power
Pn = 10**(Pn_dB/float(10))*10**-3 # converting from dBm to watts
# Pn = KToBnF;
F = Pn/float((K*To*Bn)) # Noise Factor
T = To*(F - 1); # Equivalent Noise Temperature
# Result
print'Equivalent Noise Temperature = %3.2d °K'%T;
```

In [30]:

```
import math
# Variable Declaration
Gx = 60; # gain of Rx 'X' in dB
Gy = 70; # gain of Rx 'Y' in dB
Fx = 3; # Noise factor of 'X'
Fy = 2; # Noise factor of 'Y'
# calculations
Gx_W = 10**(Gx/float(10)); # gain in watts
Gy_W = 10**(Gy/float(10)); # gain in watts
# k = Pnx/float(Pny); # Ratio of noise power levels produced at the o/p's of Rx 'X' and 'Y'
k = (Fx*Gx_W)/float((Fy*Gy_W)); # Ratio of noise power levels produced at the o/p's of Rx 'X' and 'Y'
# result
print'Ratio of noise power levels produced at the outputs of Rx X and Y = %3.2f'%k;
```

In [12]:

```
import math
# Variable Declaration
Pn = -70; # Noise power in dBm
fl = 10**6; # lower cut-off freq in Hz
fh = 11*(10**6); # upper cut-off freq in Hz
BP_fl = 13*(10**6); # Bandpass filter lower cutoff freq
BP_fh = 14*(10**6); # Bandpass filter lower cutoff freq
# Calculations
Pn_W = (10**(Pn/10))*10**-3; # coversion from dBm to Watts
BW = fh - fl
PSD = Pn_W/BW # Noise power spectral density
# Since white noise has the same spectral power density through the frequency spectrum,
# therefore Noise power in second case
B = BP_fh - BP_fl
Pn_2 = PSD*B; # Noise power in second case
# Output
print'Noise power for BandPass filter having Cutoff frequencies 13Mhz and 14Mhz = %3.0e W'%Pn_2;
```

In [13]:

```
import math
# Given Data from Figure triagle OAB
OA = 100 # in Km
OB = OA*math.cos(60*math.pi/180); # Range of Target 2
# Result
print'Range of Target-2 = %d Km\n Azimuth angle of target-1 = 60°\n Azimuth angle of Target-2 = 120°'%OB;
```