diff options
author | Tom Rondeau | 2011-10-14 17:46:20 -0400 |
---|---|---|
committer | Tom Rondeau | 2011-10-14 17:46:20 -0400 |
commit | e011b5bb0bcb24fc43bd689d003cdf19d36581b9 (patch) | |
tree | 897cae93b4f0da8dafcc4e7c85cc0c2aa0e8fd4a | |
parent | 1033576a2c839edce1c82b7e1466501d800e3a06 (diff) | |
download | gnuradio-e011b5bb0bcb24fc43bd689d003cdf19d36581b9.tar.gz gnuradio-e011b5bb0bcb24fc43bd689d003cdf19d36581b9.tar.bz2 gnuradio-e011b5bb0bcb24fc43bd689d003cdf19d36581b9.zip |
digital: fixed narrowband channel model adder to take a signal amplitude to determine the SNR.
-rwxr-xr-x | gr-digital/examples/narrowband/benchmark_add_channel.py | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/gr-digital/examples/narrowband/benchmark_add_channel.py b/gr-digital/examples/narrowband/benchmark_add_channel.py index def1f8267..841833a08 100755 --- a/gr-digital/examples/narrowband/benchmark_add_channel.py +++ b/gr-digital/examples/narrowband/benchmark_add_channel.py @@ -37,11 +37,9 @@ class my_top_block(gr.top_block): phase_offset = options.phase_offset*(math.pi/180.0) # calculate noise voltage from SNR - # FIXME: normalize to signal amplitude - power_in_signal = abs(1.0)**2 + power_in_signal = abs(options.tx_amplitude)**2 noise_power = power_in_signal/SNR noise_voltage = math.sqrt(noise_power) - print noise_voltage self.src = gr.file_source(gr.sizeof_gr_complex, ifile) #self.throttle = gr.throttle(gr.sizeof_gr_complex, options.sample_rate) @@ -74,6 +72,9 @@ def main(): help="set phase offset (in degrees) between Tx and Rx [default=%default]") parser.add_option("-m", "--use-multipath", action="store_true", default=False, help="Use a multipath channel [default=%default]") + parser.add_option("", "--tx-amplitude", type="eng_float", + default=1.0, + help="tell the simulator the signal amplitude [default=%default]") (options, args) = parser.parse_args () |