discuss-gnuradio
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Discuss-gnuradio] Gr-trellis ; convolutional code and convolutionnal in


From: Axel Belliard
Subject: [Discuss-gnuradio] Gr-trellis ; convolutional code and convolutionnal interleaver.
Date: Tue, 13 Apr 2010 17:49:02 +0200 (CEST)
User-agent: SquirrelMail/1.5.1

Gr-trellis ; convolutional code and convolutionnal interleaver.


Hi,


I'm trying to design an error correction flow graph that would use a
convolutional encoder and a convolutional interleaver. I searched in
gr-trellis for the appropriate blocks, but I have a bunch of questions
about how to use them.

About the convolutional interleaver.
Trellis.interleaver needs a specification file. Where can I find an
example of this specification file? The best would be a file specifying a
convolutional interleaving.

About Viterbi decoder
I wrote the following python file that should encode a stream of bits and
decode it using Viterbi algorithm. Unfortunately, my inputs and outputs
are different. What did I do wrong?


Thanks
Axel






class top(gr.top_block):
        def __init__(self):
                gr.top_block.__init__(self)


                constel= (2,[0, 0, 0, 1, 1, 0, 1, 1])
                f=trellis.fsm("/home/Axel/Desktop/Testgnuradio/FSM_Codeur2.fsm")
                self.src_data =
(0,0,1,0,0,1,1,0,1,0,1,1,1,0,1,0,1,1,0,0,1,0,0,1,1,0,1,1,0,1,1,0,1,0,0,1,1,0,0,0,1,1,1,0,1,0,1,1,0,0,1,0,0,1,1,0,1,1,0,1,1,0,1,0,0,1,1,0,0,0,1,1,1,0,1,0,1,1,0,0,1,0,0,1,1,0,1,1,0,1,1,0,1,0,0,1,1,0,0,0,1,1,1,0,1,0,1,1,0,0,1,0,0,1,1,0,1,1,0,1,1,0,1,0,0,1,1,0,0,0,1,1,1,0,1,0,1,1,0,0,1,0,0,1,1,0,1,1,0,1,1,0,1,0,0,1,1,0,0,0,1,1,1,0,1,0,1,1,0,0,1,0,0,1,1,0,1,1,0,1,)

                self.in_data = gr.vector_source_s (self.src_data)
                self.enc = trellis.encoder_ss(f,0) # initial state = 0
                #self.mod = gr.chunks_to_symbols_sf(constel[1],constel[0])

                self.metrics =
trellis.metrics_s(f.O(),1,[0,1,2,3],trellis.TRELLIS_HARD_SYMBOL)
                self.va = trellis.viterbi_s(f,2,0,-1) # Put -1 if the 
Initial/Final
states are not set.
                 #self.va
=trellis.viterbi_combined_s(f,K+L,0,0,dimensionality,tot_constellation,trellis.TRELLIS_EUCLIDEAN)
                self.sink1= gr.vector_sink_s()
                self.sink2= gr.vector_sink_s()

                self.connect
(self.in_data,self.enc,self.metrics,self.va,self.sink2)#,self.metrics,self.va)
                self.connect (self.in_data,self.sink1)
        def print_out(self):
                print "in",self.sink1.data()
                print "out",self.sink2.data()

if __name__ == '__main__':
        try:
                tb = top()
                tb.run()
                tb.print_out()

        except KeyboardInterrupt:
                pass



(FSM_codeur2.fsm  =   )
2 4 4

0 2
0 2
1 3
1 3

0 3
3 0
1 2
2 1






reply via email to

[Prev in Thread] Current Thread [Next in Thread]