summaryrefslogtreecommitdiff
path: root/gr-digital/examples/example_fll.py
diff options
context:
space:
mode:
authorTom Rondeau2011-07-30 16:04:12 -0400
committerTom Rondeau2011-07-30 16:04:12 -0400
commit6fd12da36b2a790fe536a0f621f04513a6762374 (patch)
tree1f0e6bcb3389229f7a07f938b3233aa23978b284 /gr-digital/examples/example_fll.py
parenta6fa43a9075e5123c741090622c80598a7e84c3a (diff)
downloadgnuradio-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-xgr-digital/examples/example_fll.py7
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())