# How can I generate offset QPSK symbols from QPSK symbols

I am trying to generate Offset-QPSK modulated symbols. But I am facing some difficulties. I know how to make QPSK symbols but I am unable to figure out at what stage I have to bring in changes to make it OFFSET QPSK.

The following are the steps I did:

1. Generated a stream of 1s and 0 s
2. I have paired at 2 consecutive bits and mapped it to one among the integers 0,1,2,3.
3. Now I map these integers to $(1+j), \ (-1+j), \ (-1-j), \ (1-j)$ following grey code based ordering.

I know that these are the steps for QPSK. But I am not sure If I need to generate OQPSK symbols at which step should I make changes and what are the changes?

Any help is appreciated.

The idea of OQPSK is very simple:

1. Consider your QPSK as two BPSK, one orthogonal to the other. It helps remembering that you're free to rotate the constellation, so that the constellation points are on the I and Q axis. Instead of choosing one point of a four-points constellation based on two bits, you now choose two separate constellations points from two two-point constellations.
2. pulse shape I and Q independently with a pulse shaper that has more than 2 Samples per Symbol. Typically, use 5 or more.
3. offset (in time) either component so that it lags half a symbol time behind the other

If you already have QPSK-modulated baseband, you can still do step 3.

You already have a serial stream of bits, say one bit every $T$ seconds. Think of the bits as being numbered consecutively $b_0, b_1, b_2, \ldots$ and modulate the even-numbered bits onto the inphase carrier and the odd-numbered bits onto the quadrature carrier with each modulation lasting for $2T$ seconds. That is, bit $b_{2n}$ creates a BPSK signal $(-1)^{b_{2n}}\cos(2\pi f_c t)$ that lasts from $t=2nT$ to $t=(2n+2)T$ while bit $b_{2n+1}$ creates a BPSK signal $(-1)^{b_{2n+1}}(-\sin(2\pi f_c t))$ that lasts from $t=(2n+1)T$ to $t=(2n+3)T$. The OQPSK signal is then the sum of these two BSPK signals, that is, at any time, we have that $$s(t) = (-1)^{b_I}\cos(2\pi f_c t) - (-1)^{b_Q}\sin(2\pi f_c t)$$ as in this answer of mine but what $b_I$ and $b_Q$ are is different between standard QPSK and OQPSK.

In OQPSK, during the $T$-second time interval $[2kT, (2k+1)T)$, the signal is

$$s(t) = (-1)^{b_{2k}}\cos(2\pi f_c t) - (-1)^{b_{2k-1}}\sin(2\pi f_c t), ~2kT \leq t < (2k+1)T,$$ while during the $T$-second interval $[(2k+1)T, (2k+2)T)$, the QPSK signal is

$$s(t) = (-1)^{b_{2k}}\cos(2\pi f_c t) - (-1)^{b_{2k+1}}\sin(2\pi f_c t), ~(2k+1)T \leq t < (2k+2)T.$$

In contrast, in standard QPSK, during the entire $2T$-second interval from $2kT$ till $(2k+2)T$, we have that

$$s(t) = (-1)^{b_{2k}}\cos(2\pi f_c t) - (-1)^{b_{2k+1}}\sin(2\pi f_c t), ~2kT \leq t < (2k+2)T.$$

That is, in OQPSK, at all times the signal is a QPSK signal but the modulating bit in the I branch changes at even multiples of $T$ while the modulating bit in the Q branch changes at odd multiples of $T$. Thus, the QPSK bit pair changes from $0*$ to $1*$ or from $1*$ to $0*$ at even multiples of $T$ and from $*1$ to $*0$ or from $*0$ to $*1$ at odd multiples of $T$ (in contrast to standard QPSK in which both bits can change at even multiples of $T$ and there are no changes at odd multiples of $T$). Hence, in OQPSK, at no time can the transition complement both the I branch bit and the Q branch bit, and there is never a phase change of $180^\circ$.

• +1. When simulating an OQPSK signal (either generating it or for purposes of demodulation), it can sometimes be easier to treat it instead as a QPSK signal at twice the symbol rate with a modulating bit stream that is adjusted appropriately to implement the offset nature that Dilip describes. – Jason R Oct 31 '17 at 16:24
• To supplement Jason's comment, note that the QPSK symbols at twice the symbol rate are $(b_0, b_{-1})$ during $[0,T)$, $(b_0, b_1)$ during $[T,2T)$, $(b_2, b_1)$ during $[2T,3T)$ and so on. This is good for generation, but for demodulation, it is useful to remember that one doesn't simply run the QPSK receiver at double the symbol rate because that would lead to two decisions being made for each bit (e.g. we get $\hat{b}_0^{(1)}$ at time $T$ and $\hat{b}_0^{(2)}$ at time $2T$) and because of the noise, there is no guarantee that the two demodulated values for $b_0$ are the same! – Dilip Sarwate Nov 1 '17 at 1:43
• Dilip is right as usual here with his point on demodulation using the double-rate QPSK model. Instead, I should have said that I have used this simplistic model to implement a symbol timing synchronizer for an OQPSK signal before. It isn't necessarily optimal, but it allowed me to use an existing implementation with little modification. – Jason R Nov 1 '17 at 1:59

Okay, as an addendum to my other answer (that no one liked), here is a little bit more formal answer:

Let your serial bit stream be $a[n] \ \in \{$0, 1$\}$ and the discrete-time bipolar binary signal be

\begin{align} x[n] &\triangleq -1 + 2 a[n] \quad \in \{-1, 1 \} \\ &= -(-1)^{a[n]} \\ \end{align}

So it's the negative of the other bipolar binary convention of $x[n] \triangleq (-1)^{a[n]}$ which some folks like to use.

The modulated IQ signal is:

\begin{align} s(t) &= \Re\Big\{ (i[n] + j q[n]) \, e^{j 2 \pi f_\text{c} t} \Big\} \\ & = i[n] \cos(2 \pi f_\text{c} t) - q[n] \sin(2 \pi f_\text{c} t) \\ \end{align}

where $f_\text{c}$ is the carrier frequency and

$$n = \Big\lfloor \tfrac{t}{T} \Big\rfloor = \operatorname{floor}\Big(\tfrac{t}{T} \Big) \ .$$

$T$ is the bit period and $\frac{1}{T}$ is the baud rate or bps (bits per second).

Now before I defined the in-phase, $i[n]$, and quadrature, $q[n]$ signals as:

\begin{align} i[n] \ &= \ g[n] x[n] \ + \ (1-g[n]) x[n-1] \\ q[n] \ &= \ (1-g[n]) x[n] \ + \ g[n] x[n-1] \\ \end{align}

where $g[n]$ is an even/odd gating signal defined as

$$g[n] \triangleq \tfrac{1}{2}\left( 1 + (-1)^n \right)$$

and

$$1-g[n] = \tfrac{1}{2}\left( 1 - (-1)^n \right)$$

(Note that for $n$ even, $g[n]=1$ and only $i[n]$ can change, while for $n$ odd, $g[n]=0$ and only $q[n]$ can change. The bit rates for $i[n]$ and $q[n]$ is half the bit rate for $x[n]$.) But let's do that a little differently this time and define $i[n]$ and $q[n]$ more generally.

\begin{align} i[n] &= \sum\limits_{m=-\infty}^{\infty} x[2m] \, p[n-2m] \\ \\ q[n] &= \sum\limits_{m=-\infty}^{\infty} x[2m+1] \, p[n-(2m+1)] \\ \end{align}

Here $p[n]$ is our bandlimited pulse shape. For $i[n]$ only even-indexed samples of $x[n]$ are used and for $q[n]$ only odd-indexed samples are used. This means that the effective baud rate for $i[n]$ and $q[n]$ is half of the bit rate for $a[n]$ or the bipolar $x[n]$. So only half of the bandwidth is needed for $i[n]$ and $q[n]$.

Now above (and previously) I was defining the pulse shape to be:

$$p[n] = \begin{cases} 0 \qquad & n < 0 \\ 1 \qquad & 0 \le n < 2 \\ 0 \qquad & 2 \le n \\ \end{cases}$$

Note the pulse width is $2T$, two bit widths, wide. So it would occupy half of the bandwidth than a similarly shaped pulse that is one bit width wide.

So try this for a pulse shape:

$$p[n] = \operatorname{sinc}\left( \tfrac{n}{2} \right)$$

where

$$\operatorname{sinc}(u) \triangleq \begin{cases} \frac{\sin(\pi u)}{\pi u} \qquad & u \ne 0 \\ 1 & u = 0 \\ \end{cases}$$

This will result in a bandwidth of half of the bandwidth necessary for a baud rate of $\tfrac{1}{T}$. And it's a flat (brickwall) bandwidth, emphasizing or de-emphasizing no frequencies (within the bandwidth) over any others.

Note that for $i[n]$ or $i[2m]$, because none of the other even-indexed samples will contribute to the value of $i[n]$ at the even index of $n=2m$.

For $q[n]$ or $q[2m+1]$, none of the other odd-indexed samples will contribute to the value of $q[n]$ at the odd index of $n=2m+1$. So there is no inter-symbol interference and these are strictly bandlimited pulses.

Now that $\operatorname{sinc}(\cdot)$ function goes on forever, which means that the you'll have to add an infinite number of non-zero terms in the summations for $i[n]$ and $q[n]$ above, so you'll have to window it with a window function, $w[n]$, of non-zero width $M+1$:

$$p[n] = \operatorname{sinc}\left( \tfrac{n}{2} \right) w[n]$$

This changes the summations for $i[n]$ and $q[n]$ to be finite:

\begin{align} i[n] &= \sum\limits_{m=\lfloor n/2-M/4 \rfloor}^{\lfloor n/2+M/4 \rfloor} x[2m] \, \operatorname{sinc}\left( \tfrac{n-2m}{2} \right) w[n-2m] \\ \\ q[n] &= \sum\limits_{m=\lfloor (n-1)/2-M/4 \rfloor}^{\lfloor (n-1)/2+M/4 \rfloor} x[2m+1] \, \operatorname{sinc}\left( \tfrac{n-(2m+1)}{2} \right) w[n-(2m+1)] \\ \end{align}

You could define the window function as a Hamming window:

$$w[n] \triangleq \begin{cases} \tfrac{27}{50} + \tfrac{23}{50} \cos\left(2\pi \tfrac{n}{M}\right) \quad \quad & |n| \le \tfrac{M}{2} \\ 0 & |n| > \tfrac{M}{2} \\ \end{cases}$$

but I would suggest a Kaiser window:

$$w[n] \triangleq \begin{cases} \frac{1}{J_0(\beta)} J_0\left(\beta \sqrt{1 - \left(\frac{n}{1+M/2}\right)^2} \right) \quad \quad & |n| \le \tfrac{M}{2} \\ 0 & |n| > \tfrac{M}{2} \\ \end{cases}$$

$J_0(\cdot)$ is the 0th-order modified Bessel function of the first kind.

$$J_0(u) = 1 \ + \ \sum\limits_{k=1}^{\infty} \frac{1}{(k!)^2} \left(-\frac{u^2}{4}\right)^{k}$$

$M+1$ is the number of non-zero samples or FIR taps. $\beta$ is a "shape parameter" and O&S recommend this heuristic:

$$\beta = \begin{cases} 0.1102 \cdot (A-8.7) & A>50 \\ 0.5842 \cdot (A-21)^{2/5} + 0.07886 \cdot (A-21) \quad & 21 < A \le 50 \\ 0.0 & A \le 21 \\ \end{cases}$$

$$M = 2 \left\lceil \frac{A-8}{4.57 \cdot \Delta\omega} \right\rceil - 1$$

$A$ is the desired stopband attention in dB and $\Delta\omega$ is the desired width of the transition band in normalized angular frequency. $\lceil \cdot \rceil$ is the ceiling function (i.e. "round up").

• Maybe no one bothered to upvote your other answer because it is still marked as a work in progress, and everyone is waiting for you to tell us that you are done with the writing and the work is ready to be admired. – Dilip Sarwate Nov 1 '17 at 1:50
• listen, i am not expecting it to be "admired". i don't really expect upvotes.  what i hope for is discussion regarding some of the content. – robert bristow-johnson Nov 1 '17 at 3:31