summaryrefslogtreecommitdiff
path: root/gr-digital/examples/narrowband
diff options
context:
space:
mode:
authorTom Rondeau2011-10-14 17:46:20 -0400
committerTom Rondeau2011-10-14 17:46:20 -0400
commite011b5bb0bcb24fc43bd689d003cdf19d36581b9 (patch)
tree897cae93b4f0da8dafcc4e7c85cc0c2aa0e8fd4a /gr-digital/examples/narrowband
parent1033576a2c839edce1c82b7e1466501d800e3a06 (diff)
downloadgnuradio-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.
Diffstat (limited to 'gr-digital/examples/narrowband')
-rwxr-xr-xgr-digital/examples/narrowband/benchmark_add_channel.py7
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 ()