discuss-gnuradio
[Top][All Lists]
Advanced

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

Re: [Discuss-gnuradio] gr_unpacked_to_packed_bb, modulation


From: Mattias Kjellsson
Subject: Re: [Discuss-gnuradio] gr_unpacked_to_packed_bb, modulation
Date: Fri, 16 Oct 2009 16:05:57 +0200
User-agent: Thunderbird 2.0.0.23 (X11/20090817)

Mattias Kjellsson wrote:
> Hi again,
>
> Thanks for the reply, that confirmed my suspicion of me being wrong
> about D=2.
>
> But then I am wondering how the gr_unpacked_to_packed_bb- block is working?
>
> When I setup a unpacked_to_packed_bb(2,GR_MSB_FIRST) (I guess GR_MSB_FIRST
> on a regular intel x86, right?) and connect it to a
> gr_chunks_to_symbols_bc block using the following lines of code:
>
> float t = sqrt(2)/2;
> gr_complex c[] = {
>         gr_complex(-t, t), gr_complex(t, t),
>         gr_complex(-t,-t), gr_complex(t,-t)
> };
>
> std::vector<gr_complex> d_constellation(c,c+sizeof(c)/sizeof(gr_complex));
> d_mapper = gr_make_chunks_to_symbols_bc(d_constellation,1);
>
> The program fails with an assert in gr_chunks_to_symbols_bc.cc:68
>  
> In an effort to understand this problem, I have modefied
> gr_chunks_to_symbols work- function with a few printouts...
>
> in[i] = 1, d_D = 1, d_symbol_table.size() = 4
> in[i]*d_D+d_D = 2
> in[i] = 69, d_D = 1, d_symbol_table.size() = 4
> in[i]*d_D+d_D = 70
> packer: gr_chunks_to_symbols_bc.cc:68: virtual int
> gr_chunks_to_symbols_bc::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
>
> Looking at the printouts, one can see that it fails (appropriately) on
> the second input, in[i] = 69.
>
>   
Ops, this should read: 

This gave me suspicions regarding gr_unpacked_to_packed_bb, which is the
block "before" in the connection- chain.

>
> Adding a few printouts to that block gave me the following output
> (reworked for readability)
> Where "residue is the variable with the same name in "unsigned int
> get_bit_be1(...)", return is the same functions return
> and out is what is written to out in "general_work(...)". The "||" is
> just there to separate the bytes.
>
> residue:0 1 0 1 0 1 0 1 || 0 1 0 1 0 1 0 1
> return : 0 0 0 0 0 0 0 1 || 0 1 0 0 0 1 0 1
> out:        1 || 69
>
> The input to the block is a file_source
> (gr_make_file_source(sizeof(unsigned char),"ones.in",false))
> containing eight bytes, [0, 0, 0, 1, 1, 0, 1, 1]
>
> What am I doing wrong?
> Best regards,
> Mattias
>
>   
>> In chunks-to-symbols you need a lookup table of one dimension, so
>> D=1 and it should contain 4 entries.
>>
>> Achilleas
>>   
>>     
>
>
>
> _______________________________________________
> Discuss-gnuradio mailing list
> address@hidden
> http://lists.gnu.org/mailman/listinfo/discuss-gnuradio
>   





reply via email to

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