diff options
author | Tom Rondeau | 2011-12-30 11:10:23 -0500 |
---|---|---|
committer | Tom Rondeau | 2011-12-30 11:11:07 -0500 |
commit | ef4d48de26b64d89851a93fc5402b33fcc1a809f (patch) | |
tree | ec38490428181cc78b91f93b90e4bcdfd6793a97 /gr-digital/examples/snr_estimators.py | |
parent | a4d62472975aaeb50fa96c360c4b24d3ad84cf6e (diff) | |
download | gnuradio-ef4d48de26b64d89851a93fc5402b33fcc1a809f.tar.gz gnuradio-ef4d48de26b64d89851a93fc5402b33fcc1a809f.tar.bz2 gnuradio-ef4d48de26b64d89851a93fc5402b33fcc1a809f.zip |
digital: update to qa and example code for new constructor with tag_nsamples arg.
Diffstat (limited to 'gr-digital/examples/snr_estimators.py')
-rwxr-xr-x | gr-digital/examples/snr_estimators.py | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/gr-digital/examples/snr_estimators.py b/gr-digital/examples/snr_estimators.py index 6bd9257fa..432abd455 100755 --- a/gr-digital/examples/snr_estimators.py +++ b/gr-digital/examples/snr_estimators.py @@ -118,8 +118,8 @@ def main(): snr_python = list() snr_gr = list() - gain =0.5 - alpha = 0.004 + # when to issue an SNR tag; can be ignored in this example. + ntag = 10000 n_cpx = xx + 1j*xy @@ -133,10 +133,10 @@ def main(): for snr in SNR_dB: SNR = 10.0**(snr/10.0) scale = scipy.sqrt(SNR) - yy = gain*(bits + n_cpx/scale) + yy = bits + n_cpx/scale print "SNR: ", snr - Sknown = scipy.mean((yy/gain)**2) + Sknown = scipy.mean(yy**2) Nknown = scipy.var(n_cpx/scale)/2 snr0 = Sknown/Nknown snr0dB = 10.0*scipy.log10(snr0) @@ -146,7 +146,7 @@ def main(): snr_python.append(snrdB) gr_src = gr.vector_source_c(bits.tolist(), False) - gr_snr = digital.mpsk_snr_est_cc(gr_est, 0.001) + gr_snr = digital.mpsk_snr_est_cc(gr_est, ntag, 0.001) gr_chn = gr.channel_model(1.0/scale) gr_snk = gr.null_sink(gr.sizeof_gr_complex) tb = gr.top_block() |