summaryrefslogtreecommitdiff
path: root/gr-trellis/src/examples
diff options
context:
space:
mode:
Diffstat (limited to 'gr-trellis/src/examples')
-rwxr-xr-xgr-trellis/src/examples/python/test_cpm.py16
-rwxr-xr-xgr-trellis/src/examples/python/test_pccc_turbo1.py2
-rwxr-xr-xgr-trellis/src/examples/python/test_sccc_hard.py2
-rwxr-xr-xgr-trellis/src/examples/python/test_sccc_soft.py2
-rwxr-xr-xgr-trellis/src/examples/python/test_sccc_turbo.py2
-rwxr-xr-xgr-trellis/src/examples/python/test_sccc_turbo1.py2
-rwxr-xr-xgr-trellis/src/examples/python/test_sccc_turbo2.py2
-rwxr-xr-xgr-trellis/src/examples/python/test_tcm.py2
-rwxr-xr-xgr-trellis/src/examples/python/test_tcm_bit.py2
-rwxr-xr-xgr-trellis/src/examples/python/test_tcm_combined.py2
-rwxr-xr-xgr-trellis/src/examples/python/test_tcm_parallel.py2
-rwxr-xr-xgr-trellis/src/examples/python/test_turbo_equalization.py2
-rwxr-xr-xgr-trellis/src/examples/python/test_turbo_equalization1.py6
-rwxr-xr-xgr-trellis/src/examples/python/test_turbo_equalization2.py6
-rwxr-xr-xgr-trellis/src/examples/python/test_viterbi_equalization.py2
-rwxr-xr-xgr-trellis/src/examples/python/test_viterbi_equalization1.py6
16 files changed, 29 insertions, 29 deletions
diff --git a/gr-trellis/src/examples/python/test_cpm.py b/gr-trellis/src/examples/python/test_cpm.py
index 5342e57e82..7e80d400be 100755
--- a/gr-trellis/src/examples/python/test_cpm.py
+++ b/gr-trellis/src/examples/python/test_cpm.py
@@ -8,7 +8,7 @@
##################################################
from gnuradio import gr
-from gnuradio import trellis, digital
+from gnuradio import trellis, digital, filter
from gnuradio.gr import firdes
from grc_gnuradio import blks2 as grc_blks2
import math
@@ -45,7 +45,7 @@ def run_test(seed,blocksize):
BT=0.3;
tt=numpy.arange(0,L*Q)/(1.0*Q)-L/2.0;
#print tt
- p=(0.5*scipy.stats.erfc(2*math.pi*BT*(tt-0.5)/math.sqrt(math.log(2.0))/math.sqrt(2.0))-0.5*scipy.stats.erfc(2*math.pi*BT*(tt+0.5)/math.sqrt(math.log(2.0))/math.sqrt(2.0)))/2.0;
+ p=(0.5*scipy.special.erfc(2*math.pi*BT*(tt-0.5)/math.sqrt(math.log(2.0))/math.sqrt(2.0))-0.5*scipy.special.erfc(2*math.pi*BT*(tt+0.5)/math.sqrt(math.log(2.0))/math.sqrt(2.0)))/2.0;
p=p/sum(p)*Q/2.0;
#print p
q=numpy.cumsum(p)/Q;
@@ -89,8 +89,8 @@ def run_test(seed,blocksize):
# Blocks
##################################################
random_source_x_0 = gr.vector_source_b(data.tolist(), False)
- gr_chunks_to_symbols_xx_0 = gr.chunks_to_symbols_bf((-1, 1), 1)
- gr_interp_fir_filter_xxx_0 = gr.interp_fir_filter_fff(Q, p)
+ digital_chunks_to_symbols_xx_0 = digital.chunks_to_symbols_bf((-1, 1), 1)
+ gr_interp_fir_filter_xxx_0 = filter.interp_fir_filter_fff(Q, p)
gr_frequency_modulator_fc_0 = gr.frequency_modulator_fc(2*math.pi*h*(1.0/Q))
gr_add_vxx_0 = gr.add_vcc(1)
@@ -99,8 +99,8 @@ def run_test(seed,blocksize):
gr_multiply_vxx_0 = gr.multiply_vcc(1)
gr_sig_source_x_0 = gr.sig_source_c(Q, gr.GR_COS_WAVE, -f0T, 1, 0)
# only works for N=2, do it manually for N>2...
- gr_fir_filter_xxx_0_0 = gr.fir_filter_ccc(Q, MF[0].conjugate())
- gr_fir_filter_xxx_0_0_0 = gr.fir_filter_ccc(Q, MF[1].conjugate())
+ gr_fir_filter_xxx_0_0 = filter.fir_filter_ccc(Q, MF[0].conjugate())
+ gr_fir_filter_xxx_0_0_0 = filter.fir_filter_ccc(Q, MF[1].conjugate())
gr_streams_to_stream_0 = gr.streams_to_stream(gr.sizeof_gr_complex*1, int(N))
gr_skiphead_0 = gr.skiphead(gr.sizeof_gr_complex*1, int(N*(1+0)))
viterbi = trellis.viterbi_combined_cb(f, head+blocksize+tail, 0, -1, int(N),
@@ -111,8 +111,8 @@ def run_test(seed,blocksize):
##################################################
# Connections
##################################################
- tb.connect((random_source_x_0, 0), (gr_chunks_to_symbols_xx_0, 0))
- tb.connect((gr_chunks_to_symbols_xx_0, 0), (gr_interp_fir_filter_xxx_0, 0))
+ tb.connect((random_source_x_0, 0), (digital_chunks_to_symbols_xx_0, 0))
+ tb.connect((digital_chunks_to_symbols_xx_0, 0), (gr_interp_fir_filter_xxx_0, 0))
tb.connect((gr_interp_fir_filter_xxx_0, 0), (gr_frequency_modulator_fc_0, 0))
tb.connect((gr_frequency_modulator_fc_0, 0), (gr_add_vxx_0, 0))
tb.connect((gr_noise_source_x_0, 0), (gr_add_vxx_0, 1))
diff --git a/gr-trellis/src/examples/python/test_pccc_turbo1.py b/gr-trellis/src/examples/python/test_pccc_turbo1.py
index 0655b972de..abc0e1d01f 100755
--- a/gr-trellis/src/examples/python/test_pccc_turbo1.py
+++ b/gr-trellis/src/examples/python/test_pccc_turbo1.py
@@ -20,7 +20,7 @@ def run_test (fo,fi,interleaver,Kb,bitspersymbol,K,dimensionality,constellation,
#src = gr.vector_source_s([0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1],False)
enc = trellis.pccc_encoder_ss(fo,0,fi,0,interleaver,K)
code = gr.vector_sink_s()
- mod = gr.chunks_to_symbols_sf(constellation,dimensionality)
+ mod = digital.chunks_to_symbols_sf(constellation,dimensionality)
# CHANNEL
add = gr.add_ff()
diff --git a/gr-trellis/src/examples/python/test_sccc_hard.py b/gr-trellis/src/examples/python/test_sccc_hard.py
index 4eeb94a12d..397ebf0871 100755
--- a/gr-trellis/src/examples/python/test_sccc_hard.py
+++ b/gr-trellis/src/examples/python/test_sccc_hard.py
@@ -19,7 +19,7 @@ def run_test (fo,fi,interleaver,Kb,bitspersymbol,K,dimensionality,constellation,
enc_out = trellis.encoder_ss(fo,0) # initial state = 0
inter = trellis.permutation(interleaver.K(),interleaver.INTER(),1,gr.sizeof_short)
enc_in = trellis.encoder_ss(fi,0) # initial state = 0
- mod = gr.chunks_to_symbols_sf(constellation,dimensionality)
+ mod = digital.chunks_to_symbols_sf(constellation,dimensionality)
# CHANNEL
add = gr.add_ff()
diff --git a/gr-trellis/src/examples/python/test_sccc_soft.py b/gr-trellis/src/examples/python/test_sccc_soft.py
index 10c28419a8..b1ffaae748 100755
--- a/gr-trellis/src/examples/python/test_sccc_soft.py
+++ b/gr-trellis/src/examples/python/test_sccc_soft.py
@@ -22,7 +22,7 @@ def run_test (fo,fi,interleaver,Kb,bitspersymbol,K,dimensionality,constellation,
enc_out = trellis.encoder_ss(fo,0) # initial state = 0
inter = trellis.permutation(interleaver.K(),interleaver.INTER(),1,gr.sizeof_short)
enc_in = trellis.encoder_ss(fi,0) # initial state = 0
- mod = gr.chunks_to_symbols_sf(constellation,dimensionality)
+ mod = digital.chunks_to_symbols_sf(constellation,dimensionality)
# CHANNEL
add = gr.add_ff()
diff --git a/gr-trellis/src/examples/python/test_sccc_turbo.py b/gr-trellis/src/examples/python/test_sccc_turbo.py
index 762a93ba51..e8054a08b2 100755
--- a/gr-trellis/src/examples/python/test_sccc_turbo.py
+++ b/gr-trellis/src/examples/python/test_sccc_turbo.py
@@ -61,7 +61,7 @@ def run_test (fo,fi,interleaver,Kb,bitspersymbol,K,dimensionality,constellation,
enc_out = trellis.encoder_ss(fo,0) # initial state = 0
inter = trellis.permutation(interleaver.K(),interleaver.INTER(),1,gr.sizeof_short)
enc_in = trellis.encoder_ss(fi,0) # initial state = 0
- mod = gr.chunks_to_symbols_sf(constellation,dimensionality)
+ mod = digital.chunks_to_symbols_sf(constellation,dimensionality)
# CHANNEL
add = gr.add_ff()
diff --git a/gr-trellis/src/examples/python/test_sccc_turbo1.py b/gr-trellis/src/examples/python/test_sccc_turbo1.py
index 187a75185f..ef5d32f588 100755
--- a/gr-trellis/src/examples/python/test_sccc_turbo1.py
+++ b/gr-trellis/src/examples/python/test_sccc_turbo1.py
@@ -17,7 +17,7 @@ def run_test (fo,fi,interleaver,Kb,bitspersymbol,K,dimensionality,constellation,
src_head = gr.head (gr.sizeof_short,Kb/16) # packet size in shorts
s2fsmi = gr.packed_to_unpacked_ss(bitspersymbol,gr.GR_MSB_FIRST) # unpack shorts to symbols compatible with the outer FSM input cardinality
enc = trellis.sccc_encoder_ss(fo,0,fi,0,interleaver,K)
- mod = gr.chunks_to_symbols_sf(constellation,dimensionality)
+ mod = digital.chunks_to_symbols_sf(constellation,dimensionality)
# CHANNEL
add = gr.add_ff()
diff --git a/gr-trellis/src/examples/python/test_sccc_turbo2.py b/gr-trellis/src/examples/python/test_sccc_turbo2.py
index dff1ba93c3..942572676d 100755
--- a/gr-trellis/src/examples/python/test_sccc_turbo2.py
+++ b/gr-trellis/src/examples/python/test_sccc_turbo2.py
@@ -17,7 +17,7 @@ def run_test (fo,fi,interleaver,Kb,bitspersymbol,K,dimensionality,constellation,
src_head = gr.head (gr.sizeof_short,Kb/16) # packet size in shorts
s2fsmi = gr.packed_to_unpacked_ss(bitspersymbol,gr.GR_MSB_FIRST) # unpack shorts to symbols compatible with the outer FSM input cardinality
enc = trellis.sccc_encoder_ss(fo,0,fi,0,interleaver,K)
- mod = gr.chunks_to_symbols_sf(constellation,dimensionality)
+ mod = digital.chunks_to_symbols_sf(constellation,dimensionality)
# CHANNEL
add = gr.add_ff()
diff --git a/gr-trellis/src/examples/python/test_tcm.py b/gr-trellis/src/examples/python/test_tcm.py
index a7d6a02d04..eff93f5b4e 100755
--- a/gr-trellis/src/examples/python/test_tcm.py
+++ b/gr-trellis/src/examples/python/test_tcm.py
@@ -24,7 +24,7 @@ def run_test (f,Kb,bitspersymbol,K,dimensionality,constellation,N0,seed):
#b2s = gr.unpacked_to_packed_ss(1,gr.GR_MSB_FIRST) # pack bits in shorts
s2fsmi = gr.packed_to_unpacked_ss(bitspersymbol,gr.GR_MSB_FIRST) # unpack shorts to symbols compatible with the FSM input cardinality
enc = trellis.encoder_ss(f,0) # initial state = 0
- mod = gr.chunks_to_symbols_sf(constellation,dimensionality)
+ mod = digital.chunks_to_symbols_sf(constellation,dimensionality)
# CHANNEL
add = gr.add_ff()
diff --git a/gr-trellis/src/examples/python/test_tcm_bit.py b/gr-trellis/src/examples/python/test_tcm_bit.py
index 7f69c0e294..1a89d06a89 100755
--- a/gr-trellis/src/examples/python/test_tcm_bit.py
+++ b/gr-trellis/src/examples/python/test_tcm_bit.py
@@ -25,7 +25,7 @@ def run_test (f,Kb,bitspersymbol,K,dimensionality,constellation,N0,seed):
b2s = gr.unpacked_to_packed_ss(1,gr.GR_MSB_FIRST) # pack bits in shorts
s2fsmi = gr.packed_to_unpacked_ss(bitspersymbol,gr.GR_MSB_FIRST) # unpack shorts to symbols compatible with the FSM input cardinality
enc = trellis.encoder_ss(f,0) # initial state = 0
- mod = gr.chunks_to_symbols_sf(constellation,dimensionality)
+ mod = digital.chunks_to_symbols_sf(constellation,dimensionality)
# CHANNEL
diff --git a/gr-trellis/src/examples/python/test_tcm_combined.py b/gr-trellis/src/examples/python/test_tcm_combined.py
index d98e36e27d..a46444e32b 100755
--- a/gr-trellis/src/examples/python/test_tcm_combined.py
+++ b/gr-trellis/src/examples/python/test_tcm_combined.py
@@ -18,7 +18,7 @@ def run_test (f,Kb,bitspersymbol,K,dimensionality,constellation,N0,seed):
src_head = gr.head (gr.sizeof_short,Kb/16) # packet size in shorts
s2fsmi = gr.packed_to_unpacked_ss(bitspersymbol,gr.GR_MSB_FIRST) # unpack shorts to symbols compatible with the FSM input cardinality
enc = trellis.encoder_ss(f,0) # initial state = 0
- mod = gr.chunks_to_symbols_sf(constellation,dimensionality)
+ mod = digital.chunks_to_symbols_sf(constellation,dimensionality)
# CHANNEL
diff --git a/gr-trellis/src/examples/python/test_tcm_parallel.py b/gr-trellis/src/examples/python/test_tcm_parallel.py
index 0372351aad..72fb8cf3bf 100755
--- a/gr-trellis/src/examples/python/test_tcm_parallel.py
+++ b/gr-trellis/src/examples/python/test_tcm_parallel.py
@@ -19,7 +19,7 @@ def run_test (f,Kb,bitspersymbol,K,dimensionality,constellation,N0,seed,P):
s2fsmi=gr.packed_to_unpacked_ss(bitspersymbol,gr.GR_MSB_FIRST) # unpack shorts to symbols compatible with the FSM input cardinality
s2p = gr.stream_to_streams(gr.sizeof_short,P) # serial to parallel
enc = trellis.encoder_ss(f,0) # initiali state = 0
- mod = gr.chunks_to_symbols_sf(constellation,dimensionality)
+ mod = digital.chunks_to_symbols_sf(constellation,dimensionality)
# CHANNEL
add=[]
diff --git a/gr-trellis/src/examples/python/test_turbo_equalization.py b/gr-trellis/src/examples/python/test_turbo_equalization.py
index 18bfb022a9..d97f3f2c29 100755
--- a/gr-trellis/src/examples/python/test_turbo_equalization.py
+++ b/gr-trellis/src/examples/python/test_turbo_equalization.py
@@ -59,7 +59,7 @@ def run_test (fo,fi,interleaver,Kb,bitspersymbol,K,dimensionality,tot_constellat
inter = trellis.permutation(interleaver.K(),interleaver.INTER(),1,gr.sizeof_short)
enc_in = trellis.encoder_ss(fi,0) # initial state = 0
# essentially here we implement the combination of modulation and channel as a memoryless modulation (the memory induced by the channel is hidden in the innner FSM)
- mod = gr.chunks_to_symbols_sf(tot_constellation,dimensionality)
+ mod = digital.chunks_to_symbols_sf(tot_constellation,dimensionality)
# CHANNEL
add = gr.add_ff()
diff --git a/gr-trellis/src/examples/python/test_turbo_equalization1.py b/gr-trellis/src/examples/python/test_turbo_equalization1.py
index 17ad430235..e8b946458c 100755
--- a/gr-trellis/src/examples/python/test_turbo_equalization1.py
+++ b/gr-trellis/src/examples/python/test_turbo_equalization1.py
@@ -1,7 +1,7 @@
#!/usr/bin/env python
from gnuradio import gr
-from gnuradio import trellis, digital
+from gnuradio import trellis, digital, filter
from gnuradio import eng_notation
import math
import sys
@@ -61,10 +61,10 @@ def run_test (fo,fi,interleaver,Kb,bitspersymbol,K,channel,modulation,dimensiona
src = gr.vector_source_s(packet,False)
enc_out = trellis.encoder_ss(fo,0) # initial state = 0
inter = trellis.permutation(interleaver.K(),interleaver.INTER(),1,gr.sizeof_short)
- mod = gr.chunks_to_symbols_sf(modulation[1],modulation[0])
+ mod = digital.chunks_to_symbols_sf(modulation[1],modulation[0])
# CHANNEL
- isi = gr.fir_filter_fff(1,channel)
+ isi = filter.fir_filter_fff(1,channel)
add = gr.add_ff()
noise = gr.noise_source_f(gr.GR_GAUSSIAN,math.sqrt(N0/2),seed)
diff --git a/gr-trellis/src/examples/python/test_turbo_equalization2.py b/gr-trellis/src/examples/python/test_turbo_equalization2.py
index 5a6c77e9d4..6b37ee9b59 100755
--- a/gr-trellis/src/examples/python/test_turbo_equalization2.py
+++ b/gr-trellis/src/examples/python/test_turbo_equalization2.py
@@ -1,7 +1,7 @@
#!/usr/bin/env python
from gnuradio import gr
-from gnuradio import trellis, digital
+from gnuradio import trellis, digital, filter
from gnuradio import eng_notation
import math
import sys
@@ -59,10 +59,10 @@ def run_test (fo,fi,interleaver,Kb,bitspersymbol,K,channel,modulation,dimensiona
src = gr.vector_source_s(packet,False)
enc_out = trellis.encoder_ss(fo,0) # initial state = 0
inter = trellis.permutation(interleaver.K(),interleaver.INTER(),1,gr.sizeof_short)
- mod = gr.chunks_to_symbols_sf(modulation[1],modulation[0])
+ mod = digital.chunks_to_symbols_sf(modulation[1],modulation[0])
# CHANNEL
- isi = gr.fir_filter_fff(1,channel)
+ isi = filter.fir_filter_fff(1,channel)
add = gr.add_ff()
noise = gr.noise_source_f(gr.GR_GAUSSIAN,math.sqrt(N0/2),seed)
diff --git a/gr-trellis/src/examples/python/test_viterbi_equalization.py b/gr-trellis/src/examples/python/test_viterbi_equalization.py
index 9f3f7e3911..00d54620b2 100755
--- a/gr-trellis/src/examples/python/test_viterbi_equalization.py
+++ b/gr-trellis/src/examples/python/test_viterbi_equalization.py
@@ -16,7 +16,7 @@ def run_test (f,Kb,bitspersymbol,K,dimensionality,tot_constellation,N0,seed):
s2fsmi = gr.packed_to_unpacked_ss(bitspersymbol,gr.GR_MSB_FIRST) # unpack shorts to symbols compatible with the FSM input cardinality
enc = trellis.encoder_ss(f,0) # initial state = 0
# essentially here we implement the combination of modulation and channel as a memoryless modulation (the memory induced by the channel is hidden in the FSM)
- mod = gr.chunks_to_symbols_sf(tot_constellation,dimensionality)
+ mod = digital.chunks_to_symbols_sf(tot_constellation,dimensionality)
# CHANNEL
add = gr.add_ff()
diff --git a/gr-trellis/src/examples/python/test_viterbi_equalization1.py b/gr-trellis/src/examples/python/test_viterbi_equalization1.py
index 90eb4790e5..cb000d6852 100755
--- a/gr-trellis/src/examples/python/test_viterbi_equalization1.py
+++ b/gr-trellis/src/examples/python/test_viterbi_equalization1.py
@@ -1,7 +1,7 @@
#!/usr/bin/env python
from gnuradio import gr
-from gnuradio import trellis, digital
+from gnuradio import trellis, digital, filter
from gnuradio import eng_notation
import math
import sys
@@ -22,10 +22,10 @@ def run_test (f,Kb,bitspersymbol,K,channel,modulation,dimensionality,tot_constel
packet[i] = 0
packet[len(packet)-i-1] = 0
src = gr.vector_source_s(packet,False)
- mod = gr.chunks_to_symbols_sf(modulation[1],modulation[0])
+ mod = digital.chunks_to_symbols_sf(modulation[1],modulation[0])
# CHANNEL
- isi = gr.fir_filter_fff(1,channel)
+ isi = filter.fir_filter_fff(1,channel)
add = gr.add_ff()
noise = gr.noise_source_f(gr.GR_GAUSSIAN,math.sqrt(N0/2),seed)