#!/usr/bin/env python from tincanradar.fwdmodel import friis from argparse import ArgumentParser p = ArgumentParser() p.add_argument('freq_Hz',help='frequency [Hz]',type=float) p.add_argument('dist_m',help='distance (one-way) [meters]',type=float) p = p.parse_args() print(friis(p.dist_m,p.freq_Hz))
#!/usr/bin/env python3 from __future__ import division from numpy import log10 # from tincanradar.fwdmodel import friis from harmonicradar.fwdmodel import noisepower Fgps=1.575e9 Mindist_m = (20200-8.848)*1e3 Pgps = 59 #[dBm] EIRP Grx = 0 #dBi RX antenna Brx = 2.046e6 NF =2 #[dB] Prxgps = Pgps - friis(Mindist_m,Fgps) + Grx #[dBm] Pn = noisepower(NF,Brx) Prxtot = 10*log10(10**(Prxgps/10) + 10**(Pn/10))
#!/usr/bin/env python3 from __future__ import division from numpy import log10 # from tincanradar.fwdmodel import friis from harmonicradar.fwdmodel import noisepower Fgps = 1.575e9 Mindist_m = (20200 - 8.848) * 1e3 Pgps = 59 #[dBm] EIRP Grx = 0 #dBi RX antenna Brx = 2.046e6 NF = 2 #[dB] Prxgps = Pgps - friis(Mindist_m, Fgps) + Grx #[dBm] Pn = noisepower(NF, Brx) Prxtot = 10 * log10(10**(Prxgps / 10) + 10**(Pn / 10))
from numpy import pi,log10 from numpy.testing import assert_allclose # from tincanradar.fwdmodel import friis c=299792458 #[m/s] def noisepower(nf,bw): """ Compute noise power for receiver in dBm Note: we are talking power not PSD. nf: noise figure [dB] cascaded for the entire receiver bw: receiver bandwidth [Hz] this is the bandwidth of the final filter in the system """ k=1.38064852e-23 T=290 #[K] by convention Pthermal = 10*log10(k*T*bw)+30 #+30 for dBW to dBm return Pthermal + nf #[dBm] DSB if __name__ == '__main__': assert_allclose(noisepower(8,25e3),-121.995788617) assert_allclose(friis(1e3,144e6), 75.6150330638)