[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Commit-gnuradio] r3383 - gnuradio/trunk/gnuradio-examples/python/channe
From: |
anastas |
Subject: |
[Commit-gnuradio] r3383 - gnuradio/trunk/gnuradio-examples/python/channel-coding |
Date: |
Tue, 22 Aug 2006 23:19:41 -0600 (MDT) |
Author: anastas
Date: 2006-08-22 23:19:41 -0600 (Tue, 22 Aug 2006)
New Revision: 3383
Modified:
gnuradio/trunk/gnuradio-examples/python/channel-coding/README
gnuradio/trunk/gnuradio-examples/python/channel-coding/test_tcm_combined.py
gnuradio/trunk/gnuradio-examples/python/channel-coding/test_viterbi_equalization1.py
Log:
Updated viterbi equalization examples and README file
Modified: gnuradio/trunk/gnuradio-examples/python/channel-coding/README
===================================================================
--- gnuradio/trunk/gnuradio-examples/python/channel-coding/README
2006-08-23 05:18:04 UTC (rev 3382)
+++ gnuradio/trunk/gnuradio-examples/python/channel-coding/README
2006-08-23 05:19:41 UTC (rev 3383)
@@ -18,8 +18,13 @@
./test_sccc_soft.py fsm_files/awgn1o2_4.fsm fsm_files/awgn1o2_4_msb.fsm 8.0
100
./test_sccc_turbo.py fsm_files/awgn1o2_4.fsm fsm_files/awgn1o2_4_msb.fsm 5.0
100
+./test_viterbi_equalization.py 12.0 100
+./test_viterbi_equalization1.py 12.0 100
+
+
In your terminal you will see something like this:
+
$ ./test_tcm.py fsm_files/awgn1o2_4.fsm 6.0 1000
100 98 9.80e-01 102400 9 8.79e-05
200 198 9.90e-01 204800 20 9.77e-05
@@ -36,11 +41,11 @@
which gives you information about the:
number of transmitted packets
number of packets in error
-iestimated packet error rate
-number of transmitted shorts
-number of shorts in error
-estimated (short) error rate
+estimated packet error rate
+number of transmitted shorts (or symbols, or bits, depending on the specific
program)
+number of shorts (or symbols, or bits) in error
+estimated short (or symbol, or bit) error rate
-1.10e-03 is the error rate estimate by sending 1000 packets of
-1024 shorts each, using an 1/2 4-state convolutional code and QPSK
-modulation through an AWGN with Es/N0 = 6.0 dB
+for instance, the final number 1.10e-03 is the error rate estimate by sending
1000
+packets of 1024 shorts each, using an 1/2 4-state convolutional code
+and QPSK modulation through an AWGN with Es/N0 = 6.0 dB
Modified:
gnuradio/trunk/gnuradio-examples/python/channel-coding/test_tcm_combined.py
===================================================================
--- gnuradio/trunk/gnuradio-examples/python/channel-coding/test_tcm_combined.py
2006-08-23 05:18:04 UTC (rev 3382)
+++ gnuradio/trunk/gnuradio-examples/python/channel-coding/test_tcm_combined.py
2006-08-23 05:19:41 UTC (rev 3383)
@@ -13,7 +13,7 @@
# TX
src = gr.lfsr_32k_source_s()
- src_head = gr.head (gr.sizeof_short,K/16) # packet size in shorts
+ 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)
@@ -25,7 +25,7 @@
# RX
- va =
trellis.viterbi_combined_s(f,dimensionality,constellation,K/bitspersymbol,0,-1,trellis.TRELLIS_EUCLIDEAN)
# Put -1 if the Initial/Final states are not set.
+ va =
trellis.viterbi_combined_s(f,K,0,-1,dimensionality,constellation,trellis.TRELLIS_EUCLIDEAN)
# Put -1 if the Initial/Final states are not set.
fsmi2s = gr.unpacked_to_packed_ss(bitspersymbol,gr.GR_MSB_FIRST) # pack
FSM input symbols to shorts
dst = gr.check_lfsr_32k_s();
Modified:
gnuradio/trunk/gnuradio-examples/python/channel-coding/test_viterbi_equalization1.py
===================================================================
---
gnuradio/trunk/gnuradio-examples/python/channel-coding/test_viterbi_equalization1.py
2006-08-23 05:18:04 UTC (rev 3382)
+++
gnuradio/trunk/gnuradio-examples/python/channel-coding/test_viterbi_equalization1.py
2006-08-23 05:19:41 UTC (rev 3383)
@@ -16,6 +16,7 @@
# TX
# this for loop is TOO slow in python!!!
packet = [0]*(K+2*L)
+ random.seed(seed)
for i in range(len(packet)):
packet[i] = random.randint(0, 2**bitspersymbol - 1) # random symbols
for i in range(L): # first/last L symbols set to 0
@@ -30,9 +31,10 @@
noise = gr.noise_source_f(gr.GR_GAUSSIAN,math.sqrt(N0/2),seed)
# RX
+ skip = gr.skiphead(gr.sizeof_float, L) # skip the first L samples since
you know they are coming from the L zero symbols
#metrics =
trellis.metrics_f(f.O(),dimensionality,tot_constellation,trellis.TRELLIS_EUCLIDEAN)
# data preprocessing to generate metrics for Viterbi
- #va = trellis.viterbi_s(f,K+2*L,-1,0) # Put -1 if the Initial/Final states
are not set. Better if we could skip the first L symbols and start with a 0
state... don't know how to "skip" samples in gnuradio
- va =
trellis.viterbi_combined_s(f,dimensionality,tot_constellation,K+2*L,-1,0,trellis.TRELLIS_EUCLIDEAN)
# using viterbi_combined_s instead of metrics_f/viterbi_s allows larger packet
lengths because metrics_f is complaining for not being able to allocate large
buffers. This is due to the large f.O() in this application...
+ #va = trellis.viterbi_s(f,K+L,-1,0) # Put -1 if the Initial/Final states
are not set.
+ va =
trellis.viterbi_combined_s(f,K+L,0,0,dimensionality,tot_constellation,trellis.TRELLIS_EUCLIDEAN)
# using viterbi_combined_s instead of metrics_f/viterbi_s allows larger packet
lengths because metrics_f is complaining for not being able to allocate large
buffers. This is due to the large f.O() in this application...
dst = gr.vector_sink_s()
fg.connect (src,mod)
@@ -40,15 +42,15 @@
fg.connect (noise,(add,1))
#fg.connect (add,metrics)
#fg.connect (metrics,va,dst)
- fg.connect (add,va,dst)
+ fg.connect (add,skip,va,dst)
fg.run()
data = dst.data()
- ntotal = len(data) - 2*L
+ ntotal = len(data) - L
nright=0
for i in range(ntotal):
- if packet[i+L]==data[i+L]:
+ if packet[i+L]==data[i]:
nright=nright+1
#else:
#print "Error in ", i
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Commit-gnuradio] r3383 - gnuradio/trunk/gnuradio-examples/python/channel-coding,
anastas <=