Monday, March 23, 2015

QPSK Theory and implementation in Matlab and SDR: Part2


In this post, we will discuss the implementation of QPSK in Matlab.

We will discuss the implementation of a QPSK transmitter and receiver.

The receiver addresses practical issues in wireless communications which are:
1. carrier frequency and phase offset,
2. timing offset and
3. frame synchronization.

The receiver demodulates the received symbols and outputs a simple message to the MATLAB command line.

Before we proceed further we need to understand by what we mean by the term Complex Baseband.

Passband signals: A passband signal has energy concentrated in the vicinity of a frequency ωc = 2πfc in anticipation of transmission through a passband channel that only passes energy in this same frequency band.

Passband signals are designed for passband channels.

Passband signals usually have been generated through multiplication of a “lowpass” signal by a sinusoid to move the energy away from low frequencies towards the frequency band around ωc.

Baseband signal is the equivalent representation of the passband signal.
The designer replaces the original modulated passband signal with the baseband-equivalent signal in most modern transmission analyzes.

The real-valued signal x(t) is a passband signal.

A carrier-modulated signal is any passband signal that can be written in the following form

x(t) = a(t) cos (ωct + θ(t))

where a(t) is the time-varying amplitude or envelope of the modulated signal and θ(t) is the time-varying phase. ωc is called the carrier frequency (in radians/sec).

The quadrature decomposition of a carrier modulated signal is 

x(t) = xI (t) cos (ωct) − xQ(t) sin (ωct)

where xI (t) = a(t) cos (θ(t)) is the time-varying in-phase component of the modulated signal, and 
xQ(t) = a(t) sin (θ(t)) is the time-varying quadrature component.


The figure above represents the decomposition of baseband-equivalent signal.

The resultant complex vector xbb(t) is known as the complex baseband-equivalent signal for x(t) and is given as follows:

xbb(t) = xI (t) + jxQ(t)  where j is = √−1.

Now, coming back to the QPSK implementation in MATLAB, all processing is done at complex baseband to handle a static frequency offset, a time-varying symbol delay, and Gaussian noise.


The above figure shows the transmitter implementation of the Transmitter in Matlab. The main components of the Transmitter are: 
The components are further described in the following sections.

1. Bit Generation - Generates the bits for each frame
2. QPSK Modulator - Modulates the bits into QPSK symbols
3. Raised Cosine Transmit Filter - Uses a rolloff factor of 0.5, and upsamples the QPSK symbols by four

Let us go into all of them in detail and see what is going on inside each block.

Bit Generation:



Above figure shows in detail the blocks running in background in order to generate the bits to be transmitted.
The Bit Generation subsystem uses a MATLAB workspace variable as the payload of a frame, as shown in the following figure.

Each frame contains 200 bits. Division of bits is as follows:
     1. The first 26 bits are header bits,
     2. A 13-bit Barker code that has been oversampled by two. The Barker code is oversampled by                two in order to generate precisely 13 QPSK symbols for later use in the Data Decoding                        subsystem.
     3. The remaining bits are the payload. The first 105 bits of the payload correspond to the ASCII               representation of 'Hello world ###', where '###' is a repeating sequence of '000', '002', '003',...,             '099'. The remaining payload bits are random bits. The payload is scrambled to guarantee a                 balanced distribution of zeros and ones for the timing recovery operation.

Tearing down the Signal From Workspace block:
    Signal from work space block imports a signal from the qpsktxrx.sBit part of the struct which is         initially a 17400x1 matrix.

    Now a good question to ask is how the Signal from workspace block works?

    

     The above figure shows the Parameters of the block.

      ADD TEXT HERE LATER


Next comes the 'To Sample' block which is just used to set the sampling mode of the output signal, which we have set to 'Sample Based'.

Next block is the 'Scrambler', 

Let us first discuss, what a Scrambler is, and what is its importance?

In a communication system, the performance must be independent of the specific bit sequence being transmitted, because repetition causes the following problems:
     1. wide variations in the received power level along with
     2. difficulties in adaptive equalization and clock recovery.

Thus, to eliminate these problems, pseudo random bit sequence is produced using a data scrambler for any input sequence.

Scrambler is used here in the design just to scramble the payload which guarantees a balanced distribution of zeros and ones for the timing recovery operation.

After that the data is concatenated with the header bits and then is sent to the 'QPSK modulator baseband' block.

QPSK modulator baseband block:

The QPSK Modulator Baseband block modulates using the quaternary phase shift keying method. The output is a baseband representation of the modulated signal.

Raised Cosine Transmit Filter:








No comments:

Post a Comment