discuss-gnuradio
[Top][All Lists]
Advanced

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

Re: [Discuss-gnuradio] MSB


From: Eric Blossom
Subject: Re: [Discuss-gnuradio] MSB
Date: Thu, 15 Mar 2007 12:17:07 -0700
User-agent: Mutt/1.5.9i

On Thu, Mar 15, 2007 at 04:36:56PM +0100, Davide Anastasia wrote:
> Il giorno gio, 15/03/2007 alle 08.10 -0700, Eric Blossom ha scritto:
> > Davide,
> > 
> > In the code that we distribute, yes.  However, I think you're asking
> > about the code that you have been modifying in the FPGA.  You're in
> > charge of that part.  What are you doing?
> 
> I'm working on usrp1_source_s.cc to obtain an unpacked stream of 1 bit
> samples into char variables (no changes for short). So, if I have 1, I
> wish to use 0x00000001 and 0x00000000 for 0 value. I guess it is
> reasonable, because after I can use unpacked_to_packed and
> packed_to_unpacked to obtain a stream of bit of byte. I fault?
> 
> > In the unmodified code, we push 16-bit I & Q across the interface to
> > the FX2 and from there to the host.  The data comes out I first, then
> > Q, and each 16-bit value is little-endian byte order.
> 
> Because Peter Monta' patch use a mask like this 16'b0000000000000001, I
> need to give to a 16 bit sample a 15 bit shift to take the SIGN. Isn't
> it??
> 
> Regards,
> -- 
> Davide Anastasia
> 
> web: http://www.davideanastasia.com/
> email: address@hidden

I Davide,

I think you'll find it easier to do the unpacking in a separate block
downstream from the usrp1_source_s.  Modifying usrp1_source* to handle
samples smaller than 1 byte is going to take quite a bit of work.  Part
of the problem is that the code is written in terms of functions such
as sizeof_basic_sample() which returns a size in bytes.  In your case,
your basic sample is smaller than a byte.  The current code doesn't
know how to deal with that.

After unpacking, what representation do you want for your samples?

If bytes containing 1-bit per byte are OK, then perhaps the easiest
approach is to create a gr_packed_to_unpacked_sb.*

You should be able to do this by changing:

# other blocks
others = (
    ('gr_chunks_to_symbols_XX',     ('bf', 'bc', 'sf', 'sc', 'if', 'ic')),
    ('gr_unpacked_to_packed_XX',    ('bb','ss','ii')),
    ('gr_packed_to_unpacked_XX',    ('bb','ss','ii'))
    )


to

# other blocks
others = (
    ('gr_chunks_to_symbols_XX',     ('bf', 'bc', 'sf', 'sc', 'if', 'ic')),
    ('gr_unpacked_to_packed_XX',    ('bb','ss','ii')),
    ('gr_packed_to_unpacked_XX',    ('bb','ss','ii', 'sb'))
    )

in gnuradio-core/src/lib/gengen/generate_common.py

On the other hand, I assume that ultimately these end up as some kind
of complex data type, so perhaps some other kind of mapping to
gr_complex would be useful.

Eric




reply via email to

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