Matlab wireless communication foundation
Matlab wireless communication foundation
QAM modulation
We use Matlab toolbox to realize QAM modulation easily.
1 | srcBits = randi([0, 1], 20000, 1);%列向量,信源,而且注意16QAM是4位一组,所以2000应该为4的倍数 |
Here is the QAM graph.

QAM modulation and AWGN(Additive White Gauss Noise)channel
脚本如下
1 | srcBits = randi([0, 1], 20000, 1);%设置信源 |
Calculate Bit Error Rate(BER)
1 | numBits = 20000; |

Obviously, if we add the AWGN channel, then the BER is very large, and we have to improve our SNR to cancel it.
When we change BER into 20dB, let’s see the graph.

The bit can be distinguished now!
Matched Filter

All wireless communication signals must occupy a designated frequency band, much like how vehicles occupy a lane in a highway. If the signal’s energy extend beyond that band, it interferes the signals have the frequencies that be above or below your signal.
A transmitter filter makes sure that your transmitted signal stays within its designated band.
On the other hand, the receiver also filters its input signal. Here, the filter will reduce the noise power that the downstream processing must handle.

Since both transmitter and receiver filter the signals, it’s important that the two filters have matching frequency responses. These matched filters provide optimum performance in the presence of noise, because they maximize the signal to noise ratio of the output.

There are many types of matched filters to choose from, we use commomly used Raised Cosine Filter, because it elimates inner-symbol interference that filtering can introduce.
Reason: In the time domain, when you filter, the filter’s inpulse response can smear one symbol into the next, which can distort it!

A Raised Cosine Impulse Response has a convenient property, the peak of one filter’s symbol occurs the zero crossings(其他波在此处0值) of the filter’s symbols that come before and after it.


So!Zero ISI!
For implementation, since you need two filters, its convenient for their composite response to be the raised Cosined Filter response, so then use a Square Root Raised Cosine Filter for each,

and there you have it!

Band limited on the front end, noise reduction on the backend, and zero ISI with the composite Raised Cosine Filter.
1 | numBits = 20000; |
Mathpath signal recession
In wireless communications, the transmitted signal generally has reflected off many different surfaces before reaches the receiver.

These reflections resolve a phenomenon called multipath. Multipath basically means the transmitted signal has travelled a multiple different path by the time it reaches the receiver.

Each path changes the signal while it’s on its way. For example, it could have a different gain or take longer to arrive.

As a result, the receiver gets multiple superimposed copies.And sees a time smear version of a transmitted signal.

Mathematically, it’s simply the sum of the impulse responses for the various path, including the time delay and gain and phase change for each path.


1 | %Single Carrier Link with Multipath Channel |



OFDM(Orthogonal Frequency Division Multiplexing)
The multiple carriers are used to tramsmit data, each carrier has different frequency, in OFDM, according to Nyquist Bandwidth, the bandwidth efficiency has been improved and it can guarantee no inter-symbol interference(ISI)!

1 | %This is a simple OFDM system, using IFFT as a modulator, FFT as a demodulator. |

This is the OFDM-demodulated signal.
Let’s see the frequency-magnitude graph of OFDM.

So what makes orthogonality in OFDM? Let’s zoom in to find the answer.

The peak of each carrier is precisely at the zero crossing of all the others, which means none of the sub-carriers interfere with each others.
And each carrier with $a_m$ as the cofficient, so the addition of the carriers can be
In fact it is a IDFT, which can be efficiently implemented with the IFFT! So the simplest possible OFDM link uses the IFFT in the transmitter, followed by the FFT in the receiver!

But it doesn’t actually help much with the multipath channel. A channel is basically a filter, ideally, that filter will be spectrally flat across the bandwidth of the signal.

Then you can compensate for the channel signal loss and phase change with the simple complex gain in the receiver.

But a multipath channel spectrum can vary across the signal’s bandwidth, this causes the frequency selected fading(频率选择性衰落), where different frequencies fade different amounts.

The receiver needs an equalizer to remove all the peaks and valleys created by the channel.

The secret of the OFDM receiver is that how it performs the equalization. It can increase of decrease the gain of different frequency, to create the best listening experience!

OFDM turns the high rates signal into parallel low rates signals. Each low-rate signal has a narrow bandwidth. So it encounters a channel whose spectra is relatively flat!

That means the equalizer can simply apply a complex gain, and to each sub-carrier seperately , removing the peaks and valleys.

And since this equalization happens in the frequency domain, implementation is easy!

You can estimate the channel, then simply divide to get the estimate of the transmitted signal.
There is one defect of this approach. The equation above only holds if the channel performs a circular convolution on the signal.
However the reality is the channel performs a linear convolution, because it is just a filter.
If the signal is periodic, linear convolution and circular convolution are the same!
Then let’s simply make our signal periodic!
Take an OFDM symbol, take some time domain sample from the end, and then prepend them to the beginning.

It is important that the cyclic prefix is at least as long as the channel inpulse response. The cyclic prefix will get impacted by the time smearing and the multipath channel. Since it’s duplicate information, it doesn’t really matter if it gets corrupted.

So in the transmitter you have the IFFT output. then you add the cyclic prefix to get a full OFDM symbol,

On the other hand, in the receiver, the operation is run in reverse.
First you strip off the cyclic prefix, getting rid of all that multipath corruption.

Then perform FFT,

Then you can equalize the signal using that beautiful simple division!
and your output is the QAM signal you start with.
Note: In the OFDM, the guardbands are in the external part the whold bandwidth.


1 | modOrder = 16; |
There are some additional attributions in the OFDM system, such as void subcarriers.
Void subcarriers
People usually distribute guard bands to the lower part of bandwidth and the higher part of bandwidth, to reduce the interference from neighbors. They also give 0 to DC position, to remove the DC signals

1 | modOrder = 16; |



