Two possible bugs in qpsk receiving with GNU radio

I was working on qpsk receiving with GNU radio and I was wondering if
these are something we should change.

  1. The qpsk constellation in the current code seems to be (1,0),
    (0,1j), (-1,0), (0,-1j). Should it be rotated by 45 degrees?

  2. I understand that in the current mpsk_receiver_cc block, qpsk
    decisions are obtained by calling the generic decision function.I just
    want to mention, in case anyone wants to use the decision_qpsk
    function, that it has bug in it and will never return decision 0.
    unsigned int
    gr_mpsk_receiver_cc::decision_qpsk(gr_complex sample) const
    {
    unsigned int index = 0;

// Implements a simple slicer function
if((sample.real() < 0) && (sample.imag() > 0))
index = 1;
else if((sample.real() < 0) && (sample.imag() < 0))
index = 2;
//bug here begin
else
index = 3;
//bug here end
// fixed begin
else if((sample.real() > 0) && (sample.imag() < 0))
index = 3;
// fixed end

return index;
}

Also, this qpsk decision function is using the rotated constellation.

I actually copied the original mpsk_receiver_cc code and modified it
to rotate the constellation and it works fine.

Zenny

On Thu, Jun 19, 2008 at 12:52 PM, Zenny Z. [email protected]
wrote:

I was working on qpsk receiving with GNU radio and I was wondering if
these are something we should change.

  1.  The qpsk constellation in the current code seems to be (1,0),
    

(0,1j), (-1,0), (0,-1j). Should it be rotated by 45 degrees?

I wouldn’t be worried about this. Just tilt your head to the side a
bit, and does it look better to you? Phase alignment is part of the
receiver - and it’s why you need some type of correlation to figure
out the offset. Staying purely real or purely imaginary helps since
you stop multiplying by sqrt(2) and just do some simple
additions/subtractions.

if((sample.real() < 0) && (sample.imag() > 0))
// fixed end

return index;
}

I couldn’t find this code in the repository. Can you please link to it?

I first went to the gr_mpsk_receiver_cc code and found the QPSK case
here:

http://gnuradio.org/trac/browser/gnuradio/trunk/gnuradio-core/src/lib/general/gr_mpsk_receiver_cc.cc#L97
http://gnuradio.org/trac/browser/gnuradio/trunk/gnuradio-core/src/lib/general/gr_mpsk_receiver_cc.cc#L155

It apparently uses gr_quad_0deg_slicer( ) which is defined in gr_math.h
here:

http://gnuradio.org/trac/browser/gnuradio/trunk/gnuradio-core/src/lib/general/gr_math.h#L116

As a note, there are also 45 degree versions written there as well.

Are you sure the code you pasted is actually the code that is being
used?

Brian

On Thu, Jun 19, 2008 at 2:30 PM, Zenny Z. [email protected]
wrote:

I installed GNU radio about one and a half months ago and used the tar
ball. The file I used, gr_mpask_receiver_cc.cc, is under directory
/gnuradio-3.1.2/gnuradio-core/src/lib/general/. Maybe the repository
has some newer version of the code?

It appears that is the case. Looking at the changeset located here:

http://gnuradio.org/trac/changeset/7389#file6

It appears as if around 5 months ago this was changed.

Brian

On Thu, Jun 19, 2008 at 1:35 PM, Brian P. [email protected]
wrote:

It appears that is the case. Looking at the changeset located here:

http://gnuradio.org/trac/changeset/7389#file6

It appears as if around 5 months ago this was changed.

Thanks! Looks like I am using some old code…