diff options
author | Tom Rondeau | 2011-07-30 16:04:12 -0400 |
---|---|---|
committer | Tom Rondeau | 2011-07-30 16:04:12 -0400 |
commit | 6fd12da36b2a790fe536a0f621f04513a6762374 (patch) | |
tree | 1f0e6bcb3389229f7a07f938b3233aa23978b284 /gr-digital/examples/example_fll.py | |
parent | a6fa43a9075e5123c741090622c80598a7e84c3a (diff) | |
download | gnuradio-6fd12da36b2a790fe536a0f621f04513a6762374.tar.gz gnuradio-6fd12da36b2a790fe536a0f621f04513a6762374.tar.bz2 gnuradio-6fd12da36b2a790fe536a0f621f04513a6762374.zip |
digital: Add a costas loop example program. Updates FLL example program to include phase offset setting.
Diffstat (limited to 'gr-digital/examples/example_fll.py')
-rwxr-xr-x | gr-digital/examples/example_fll.py | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/gr-digital/examples/example_fll.py b/gr-digital/examples/example_fll.py index 16c4be812..3b75b5a75 100755 --- a/gr-digital/examples/example_fll.py +++ b/gr-digital/examples/example_fll.py @@ -18,13 +18,14 @@ except ImportError: sys.exit(1) class example_fll(gr.top_block): - def __init__(self, N, sps, rolloff, ntaps, bw, noise, foffset, toffset): + def __init__(self, N, sps, rolloff, ntaps, bw, noise, foffset, toffset, poffset): gr.top_block.__init__(self) rrc_taps = gr.firdes.root_raised_cosine( sps, sps, 1.0, rolloff, ntaps) data = 2.0*scipy.random.randint(0, 2, N) - 1.0 + data = scipy.exp(1j*poffset) * data self.src = gr.vector_source_c(data.tolist(), False) self.rrc = gr.interp_fir_filter_ccf(sps, rrc_taps) @@ -61,6 +62,8 @@ def main(): help="Set the simulation's normalized frequency offset (in Hz) [default=%default]") parser.add_option("-t", "--toffset", type="eng_float", default=1.0, help="Set the simulation's timing offset [default=%default]") + parser.add_option("-p", "--poffset", type="eng_float", default=0.0, + help="Set the simulation's phase offset [default=%default]") (options, args) = parser.parse_args () # Adjust N for the interpolation by sps @@ -69,7 +72,7 @@ def main(): # Set up the program-under-test put = example_fll(options.nsamples, options.sps, options.rolloff, options.ntaps, options.bandwidth, options.noise, - options.foffset, options.toffset) + options.foffset, options.toffset, options.poffset) put.run() data_src = scipy.array(put.vsnk_src.data()) |