diff options
author | eb | 2007-01-13 05:37:03 +0000 |
---|---|---|
committer | eb | 2007-01-13 05:37:03 +0000 |
commit | 87afa6ff1bb26acf3cd8a2c37a11fd44e655d314 (patch) | |
tree | 98262a4234efe859de1e0b24f94de9f050d52416 /gr-radar/src/python/signal_levels.py | |
parent | cbe1628f2eb1a1a3c8b0b96a3b1334a039074def (diff) | |
download | gnuradio-87afa6ff1bb26acf3cd8a2c37a11fd44e655d314.tar.gz gnuradio-87afa6ff1bb26acf3cd8a2c37a11fd44e655d314.tar.bz2 gnuradio-87afa6ff1bb26acf3cd8a2c37a11fd44e655d314.zip |
Moved gr-radar out of trunk for now. Needs portability cleanup.
Not to mention some functionality...
git-svn-id: http://gnuradio.org/svn/gnuradio/trunk@4258 221aa14e-8319-0410-a670-987f0aec2ac5
Diffstat (limited to 'gr-radar/src/python/signal_levels.py')
-rwxr-xr-x | gr-radar/src/python/signal_levels.py | 62 |
1 files changed, 0 insertions, 62 deletions
diff --git a/gr-radar/src/python/signal_levels.py b/gr-radar/src/python/signal_levels.py deleted file mode 100755 index f21f7f8bc..000000000 --- a/gr-radar/src/python/signal_levels.py +++ /dev/null @@ -1,62 +0,0 @@ -#!/usr/bin/env python - -import sys -from math import pi, log10 -from gnuradio.eng_notation import num_to_str - -def power_density(transmitted_power, distance): - """ - Estimate power density in Watts/meter. - Assume isotropic radiator (spherical radiation pattern). - - @param transmitted_power: Watts - @param distance: distance from transmitter in meters - - """ - return transmitted_power / (4 * pi * distance * distance) - - -def ratio_of_target_return_to_direct(Rl, Rt, Rr, rcs): - """ - Estimate relative strength of signal levels for direct and reflected - path in bistatic radar. Assume all antenna factors are constant, - and hence 'wash out'. Also assume that the antennas are isotropic - radiators (spherical radiation pattern). - - @param Rl: distance between Tx and Rx in meters - @param Rt: distance between Tx and target in meters - @param Rr: distance between Rx and target in meters - @param rcs: radar cross section in meters^2 - - @returns: ratio of reflected to direct in decibels - """ - Tx_power = 1 - direct_path_power_density = power_density(Tx_power, Rl) - power_at_target = power_density(Tx_power, Rt) * rcs - reflected_path_power_density = power_density(power_at_target, Rr) - return 10*log10(reflected_path_power_density / direct_path_power_density) - - -def print_header(f): - f.write(" Rl Rt Rr rcs dB\n") - f.write("-----------------------------------------\n") - -def print_result(f, Rl, Rt, Rr, rcs, dB): - f.write("%6sm %6sm %6sm %6s %6s\n" % tuple([num_to_str(x) for x in [Rl, Rt, Rr, rcs, dB]])) - -def calc_print(f, Rl, Rt, Rr, rcs): - print_result(f, Rl, Rt, Rr, rcs, ratio_of_target_return_to_direct(Rl, Rt, Rr, rcs)) - -def main(): - f = sys.stdout - print_header(f) - calc_print(f, 40e3, 100e3, 100e3, 10.0) - calc_print(f, 40e3, 80e3, 80e3, 10.0) - calc_print(f, 40e3, 40e3, 40e3, 10.0) - calc_print(f, 40e3, 40e3, 8e3, 10.0) - calc_print(f, 40e3, 60e3, 20e3, 10.0) - calc_print(f, 40e3, 20e3, 60e3, 10.0) - - -if __name__ == '__main__': - main() |