# Scatter Plot of OQPSK

Below is my MATLAB code for OQPSK communication:

    data_in = [ 2 1 3 1 2 3 1 1 0 2 0 2 3 2 3 1 1 2 0 3 1 3  3 0 2 1 ];
data_modualted=oqpskmod(data_in);
filtmsg = filter(H,1,data_modualted); % Introduce channel distortion.
eq1 = lineareq(nweigth,normlms(StepSize)); % Create an equalizer object. eq1.SigConst=oqpskmod(0:3);
[symbolest,filtmsg_eq] = equalize(eq1,filtmsg,data_modualted(1:trainlen)); % Equalize.
%%Scatter plot
h = scatterplot(filtmsg,4,0,'g.');
hold on ;
scatterplot(symbolest,4,0,'kx',h);
scatterplot(eq1.SigConst,1,0,'r*',h);
legend('Filtered signal','Equalized signal','Ideal signalconstellation')


I am unable to understand which values to use to generate the phase constellation diagram for my code? How can i generate the correct phase constellation diagram?

The first figure is constellation diagram of The filtered signal and the second is the constellation diagram of The Equalized signal  • If you're willing to do this without toolboxes, I recommend reading 'Digital signal processing in modern communications systems' by A. Schwarzinger. – MBaz Jul 28 '17 at 14:21

You'll need to plot your signal's imaginary and real (I and Q) part at the exact symbol time – in other words, you'll need timing recovery to get the constellation from a time signal.

Timing recovery is among the more complicated things you'll need to implement for a receiver, depending on the actual kind of transmission you're dealing with.

Assuming you weren't aware of that, you might want to look into these terms (I think the order makes sense, didactically):

• pulse shaping filter
• eye diagram
• Nyquist ISI criteria
• timing recovery
• square timing recovery
• Gardner timing recovery
• phase error correction
• Costas loop
• thanks alot @Marcus Müller but there is attenuation due to fading channel – karem Adam Jul 29 '17 at 14:24
• so what? That's what you'd see in a constellation plot! (if the fading isn't too strong for the timing recovery to work; again, timing recovery is necessary for any constellation plot to make sense). – Marcus Müller Jul 29 '17 at 14:25
• Thanks alot @Marcus Müller when i want to plot both the constellation diagram of filtered signal(filtmsg ) and the equalized signal(symbolest) on the same figure , the filtered signal is shown like point. – karem Adam Jul 29 '17 at 14:43
• so, is that a new thing? Can you mention that in your question please? Is that really about signal processing, or more of a "how do I debug my code" question (which would fit better on StackOverflow, for example)? Where's that plot in your question? – Marcus Müller Jul 29 '17 at 14:45
• ya know Marcus, it seems to me that the best way to extract a clock out of the signal would be to use bookends in the OQPSK protocol of 1100110011001100 and 0110011001100110 (one would be the lowest frequency possible and the other is highest) and simply block any occurrence of 110011001100110 (15 bits) but inserting a 1 into the stream between the trailing 1 and x in 11001100110011x independent of the value of bit x, and in the receiver removing the bit (which should be a 1 unless it's a bookend) that follows the 14 bits 11001100110011 from the stream. – robert bristow-johnson Aug 29 '17 at 0:08