Hello Achilleas, I went through the document gr-trellis. In my case (BPSK) 2-aray ,1-D modulation:[D{1},constellation{C11 , C21}]
Since the output of encoder is 2 bit packed leading to output symbol cardinality O=4, { 0 ,1,2,3} and as per your suggestion i created constellations as follows: std::vector< float > constellation; constellation.push_back( 1); constellation.push_back(1); constellation.push_back( 1); constellation.push_back(-1); constellation.push_back( -1); constellation.push_back(1); constellation.push_back(- 1); constellation.push_back(-1); and dimensionality D = 2; Now the result appears to be as i expected both encoding and decoding. Thank you very much Ram --- On Tue, 20/7/10, Achilleas Anastasopoulos <anas...@umich.edu> wrote: From: Achilleas Anastasopoulos <anas...@umich.edu> Subject: Re: [Discuss-gnuradio] gr-trellis : problem in using viterbi decoder To: "Raman O" <gnuma...@yahoo.com>, discuss-gnuradio@gnu.org Date: Tuesday, 20 July, 2010, 1:55 AM you will have to make the constellation a 2D array (essentially representing the 2 BPSK symbols). It is all explained in the examples and the documentation of gr-trellis and in the examples... please read it; i spend a lot of time writing it... Achilleas On Mon, Jul 19, 2010 at 8:19 PM, Raman O <gnuma...@yahoo.com> wrote: Hello Achilleas, I made changes to vector source and sink, encoding works fine with awgn1o2_128.fsm. But the result of encoder is 2 bit packed and is not suitable for me. Since i want to employ BPSK modulation (0-> -1 / 1 ->1), I need encoder output 1 bit at a time. Since awgn1o2_128.fsm dictates numInputbits: 2 and numOutputbits: 4 , Modulator throws following error. If i am not wrong it says, constellation length is not enough. lt-director: gr_chunks_to_symbols_sf.cc:66: virtual int gr_chunks_to_symbols_sf::work(int, gr_vector_const_void_star&, gr_vector_void_star&): Assertion `((unsigned int)in[i]*d_D+d_D) <= d_symbol_table.size()' failed. Aborted I am using following Constellation: std::vector<float> constellation; constellation.push_back(1); constellation.push_back(-1); So how do i achieve BPSK modulation with encoder using generator poly in awgn1o2_128.fsm. Many many thanks, Ram --- On Mon, 19/7/10, Achilleas Anastasopoulos <anas...@umich.edu> wrote: From: Achilleas Anastasopoulos <anas...@umich.edu> Subject: Re: [Discuss-gnuradio] gr-trellis : problem in using viterbi decoder To: "Raman O" <gnuma...@yahoo.com>, discuss-gnuradio@gnu.org Date: Monday, 19 July, 2010, 9:50 PM As I mentioned in my earlier email, you have misunderstood the functionality of the gr_make_vector_source_s(vec,false) block. It takes a vector "vec" as an argument and produces A STREAM OF SHORTS at its output!!! It is NOT producing a stream of vectors at its output...unless you specify this as the third parameter, which has nothing to do with the size of the input vector "vec" you are using... Please remove both stream2vector and vector2stream from your code and modify the statement gr_vector_source_s_sptr bit_src = gr_make_vector_source_s(in_bits,false,K ); as gr_vector_source_s_sptr bit_src = gr_make_vector_source_s(in_bits,false); Please see the python program test_tcm1.py in the gr-trellis/src/examples directory to see how the blocks are arranged... best, Achilleas On Mon, Jul 19, 2010 at 4:19 PM, Raman O <gnuma...@yahoo.com> wrote: Hello Achilleas, Thanks for your response. I have connected encoder block , it disappeared during editing mail by mistake. Input is in the form of an array of size K and vector2stream feeds encoder bit a time ,so i am using following syntax : gr_vector_source_s_sptr bit_src = gr_make_vector_source_s(in_bits,false,K ); gr_vector_to_stream_sptr vector2stream = gr_make_vector_to_stream(sizeof(short),K)------------------------------------------------------------------------------------------------------------ int K=100; short inputbits[100]={ ....contains bits.... }; std::vector<short> in_bits; for (int i = 0; i <K ; i++) { // K - no of bits in_bits.push_back(inputbits[i]); // input bits } std::vector<float> constellation; // BPSK mapping constellation.push_back(1); constellation.push_back(-1); gr_vector_source_s_sptr bit_src = gr_make_vector_source_s(in_bits,false,K ); gr_vector_to_stream_sptr vector2stream= gr_make_vector_to_stream(sizeof(short),K); // encoder fsm f= fsm("../../../gr-trellis/src/examples/fsm_files/awgn1o2_128.fsm"); trellis_encoder_ss_sptr encoder = trellis_make_encoder_ss (f, 0); // modulate gr_chunks_to_symbols_sf_sptr mod = gr_make_chunks_to_symbols_sf (constellation, 1); // ----------- ideal channel ------------- // decoder trellis_metric_type_t type= TRELLIS_EUCLIDEAN; trellis_metrics_f_sptr metrics = trellis_make_metrics_f (f.O(), 1, constellation, type); trellis_viterbi_s_sptr viterbi =trellis_make_viterbi_s ( f,K, 0,-1); gr_stream_to_vector_sptr stream2vector= gr_make_stream_to_vector(sizeof(short), K); d_dst = gr_make_vector_sink_s (K); connect( bit_src , 0, vector2stream, 0); connect( vector2stream , 0,encoder, 0); connect( encoder , 0,mod, 0); connect(mod, 0,metrics, 0); connect(metrics, 0, viterbi, 0); connect( viterbi, 0,stream2vector, 0); connect(stream2vector, 0, d_dst, 0); --- On Mon, 19/7/10, Achilleas Anastasopoulos <anas...@umich.edu> wrote: From: Achilleas Anastasopoulos <anas...@umich.edu> Subject: Re: [Discuss-gnuradio] gr-trellis : problem in using viterbi decoder To: "gnuradio mailing list" <discuss-gnuradio@gnu.org>, gnuma...@yahoo.com Date: Monday, 19 July, 2010, 6:47 PM I also realized that the way you call gr_make_vector_source_s(in_bits,false,K ); is incorrect. I think you have misunderstood what this block does. You should use: gr_make_vector_source_s(in_bits,false,1 ); or simply gr_make_vector_source_s(in_bits,false); and you really don't need the vector2stream block. Achilleas --------------------- In your code the "encoder" block is not connected to any other block... It should be: info bits -> encoder -> modulator -> channel -> metrics -> viterbi Achilleas
_______________________________________________ Discuss-gnuradio mailing list Discuss-gnuradio@gnu.org http://lists.gnu.org/mailman/listinfo/discuss-gnuradio