Project Report: ENGR 498Q – Digital Communications Laboratory

Facebook
LinkedIn
Twitter
Email

Picture of the 8-PSK received signal constellation

 
 

Introduction

Over the past few months, I had the pleasure of taking ENGR 498Q – Digital Communications Laboratory. As the name implies, this course explores concepts related to digital communication (the “theory” portion of the class) and implements them in using a software-defined radio (SDR) through GNU Radio Companion, a Python-based software development toolkit that enables the implementation of the SDR using a block diagram (the “practice” portion of the class). Warning: there is math in this article!

USRP-2901

The USRP-2901 software-defined radio. At a price of $3,980 per unit, you don’t want to drop this!

Throughout this class, we delved into the details of many fundamental concepts of digital communication, including but not limited to: a brief review of signals and systems (specifically the Nyquist–Shannon sampling theorem), stochastic processes, basis function construction and orthogonalization, matched filtering and Nyquist’s theorem for zero inter-symbol interference (ISI), signal detection, phase and timing synchronization, and M-ary PAM/PSK/QAM modulation. As a word of warning to anyone taking this class, I exhort you to review the fundamentals of your signals and systems and probability courses, as many concepts from these courses are used without hesitation. For instance, if you’re not familiar with $f(t) \star g(t)=\int_{\infty}^{\infty}f(\tau)g(t-\tau)d\tau$ (convolution), then you’re going to have a hard time!

With all that being said, this report serves to go over the semester-long process of building a digital radio scheme, culminating with the implementation of 8 and 16-PSK with rectangular and Gaussian filtering.

Labs 1-2: Introduction and Noise

The first few labs were fairly uneventful as we were still getting familiar with the fundamental course concepts. The first lab saw us play around with the GNU software and see how changing the frequency of the generated signal moves the spike seen in the frequency spectrum, as defined by $e^{j2\pi f_{0}t}\overset{\mathcal{F}}\longleftrightarrow \delta(f-f_0)$. For the second lab, we explored the effects of additive white Gaussian noise (AWGN) $z(t)$ on the system, represented as $y(t)=x(t)+z(t)$, including the signal’s signal-to-noise ratio (SNR), and power spectral density value (PSD).

The effect of noise on the sent (top left) and received signal (bottom left) as well as their frequency representations

Lab 3: Binary Antipodal Signalling and Manual Phase Correction

The sent (left, bottom) and received (left, top) signal and the corresponding flowgraph (right)

The third lab was when things started to get interesting. After being introduced to several modulation schemes, it was time to implement them. For the sake of simplicity, the first scheme to be implemented was binary antipodal signaling. Since this scheme only sends one bit per symbol, only $M=2^k=2$ symbols are necessary, those being $x_1(t)=-x_0(t)$. For this lab, both a rectangular pulse and raised root cosine filter were used.

It is important to note that the imaginary component of the sent signal is 0 (seen as the flat red line). However, the received signal has a significant imaginary component. Mathematically, this is seen as $y(t)=x(t)e^{j \alpha}+z(t)$, where a value of $\alpha = \frac{\pi}{2}$ can completely destroy the signal. This is due to the physical effects of the channel and must be accounted for.

To account for this phase shift, a conveniently available phase shift block was implemented. However, the specific phase shift $\alpha$ had to be manually applied by moving around the phase slider.

Beyond correcting for the channel phase shift, a raised root cosine filter was also implemented. The result of this was more efficient bandwidth usage through a steeper drop-off in amplitude in the frequency spectrum as well as a different looking pulse in the time domain, as seen in the image to the right.

The sent and received signal using a raised root cosine filter with a minimized imaginary component and its corresponding frequency spectrum

Lab 4: Optimal Receiver in AWGN - Matched Filter

Matched filter with some sampling times as vertical black lines (top left), the flowgraph (top right), and the corresponding eye diagram (bottom)

The fourth lab saw the beginning of the implementation of the receiver, more specifically a matched filter. As demonstrated in the right image, a matched filter, represented as $\phi(t)=\psi (-t)$, is optimal for maximizing the SNR in an AWGN channel. After going through sampling, the sampled signal can be expressed as $\tilde{y}(kT_s)=s_k+n$, with $t=kT_s$ corresponding to the red dots in the right image.

Beyond adding the matched filter, an eye diagram was also implemented. In essence, an eye diagram displays an overlap of the filtered received signal spanning multiple symbol durations. For more information, please watch this video.

Lab 4 Extra: Unique Pulse Shape Design

The filters $\tilde{\Psi} (f)$ (left) and $\psi (t)$ I designed. Note that the graph for $\psi (t)$ is merely an approximation of the actual filter using arbitrary values modelled with $\sin(t)/t$

For the lab 4 prelab, it was required that us students each design a matched filter that satisfies the Nyquist ISI theorem, that is to say we needed to design a filter such that $\tilde{\Psi}(f)=\Psi (f) \Psi^*(-f)$ satisfies $\sum_{k=-\infty}^{\infty} \tilde{\Psi} (f+k/T)=T$. Not only this, but the filter must not have been one introduced in class: no rectangular, sinc, raised cosine, or root raised cosine filter allowed!

After mulling around with several different exotic shapes, I eventually had the following epiphany: since we could not use a rectangular pulse shape nor a triangular shape (since a triangle shape would result in a sinc filter), I went to the next easiest shape: a trapezoid, as can be seen in the above picture. After working through the math, I formulated the following expression for $\tilde{\Psi}(f)$. Note that $\psi (t)$ is to my knowledge not easily attainable analytically. For the purposes of demonstration, a similar pulse is provided in the above right figure.

\[
\tilde{\Psi}(f) =
\begin{cases}
T, & -\dfrac{a}{T} \leq f \leq \dfrac{a}{T} \\
T \cdot \dfrac{T f + b}{b – a}, & -\dfrac{b}{T} \leq f < -\dfrac{a}{T} \\
– T \cdot \dfrac{T f – b}{b – a}, & \dfrac{a}{T} < f \leq \dfrac{b}{T} \\
0, & \text{otherwise}
\end{cases}\]

\[\text{ where } b>a>0, \, a+b=1\]

Lab 5: Optimal Receiver in AWGN - Detector

The received signal with no synchronization (image 1), the synchronized received signal with high, medium, and low gains (images 2, 3, 4 respectively)

The next lab saw the implementation of detection. By sampling the output of the matched filter, yielding $\tilde{y}(kT)$, we expect to see two flat groups of dots opposite from each other equidistant from the origin. However, we instead see three (sometimes four) dot groups: why? This is because the receiver is sampling at $kT+T_e$, where $T_e$ is some timing error which needs to be corrected using a delay block. Note that if this is not corrected, the bit error rate will be high due to the incorrectly detected bits.

The received signal with (top) and without (bottom) symbol frame synchronization

While the timing error has been addressed, we are not done. Frame delay synchronization still needs to be implemented, which matches the sent and received bits. For this lab, this involves using another delay block and cycling through each of the bit sequences, which is not fun!

The flowgraph for Lab 5

Lab 6: Phase and Symbol Synchronization

The pilot sequence, its autocorrelation, and the resulting modulated signal with a rectangular filter and the correlator output as implemented in the lab. Note the periodic behavior of the correlator

Now that we have our demodulator and detection scheme in place, it is now time to get rid of manual synchronization and implement symbol and phase synchronization using a pilot sequence. I will spare most of the details, but by comparing the received signal $y(t)=e^{j \theta}hx(t)\star\delta(t-\tau)+z(t)$ with a matched filter matched to the pilot sequence $x(t)$, i.e. $w(\tau)=y(\tau)\star x^*(-\tau)$, we can find the time delay $\tau$, the phase angle $\theta$ as well as the channel attenuation $h$. Note that channel attenuation isn’t dealt with until Lab 7.

For this lab, each student was tasked to come up with their own pilot sequence to be used in the lab. I chose a pilot length 32 (as was recommended), created a MATLAB script that randomly generated a myriad of pilot sequences of amplitude $\pm1$, and looked for the sequence whose autocorrelation energy was minimized everywhere but at 0 lag (at 0 lag the value of the autocorrelation would be the energy of the sequence).

After implementing the pilot sequence and adding some custom blocks into the setup to implement the phase/symbol and frame synchronization, the days of manually adjusting the delay and phase sliders were over.

The flowgraph for Lab 6 and the effects a phase shift $e^{j\theta}$ can have on the signal

Lab 7: 4-PAM Implementation

All of the graphs used for 4-PAM implementation. It’s getting crowded in here!

We now find ourselves at the final lab where we implement 4-PAM. In general, PAM, or pulse-amplitude modulation is a scheme in which bits are conveyed by varying the amplitude of a signal. More specifically, for a given signal $x(t)=\sum_ks_m\psi(t-kT)$, we can express $s_m=A_m\sqrt{E_p}$, where $A_m=(2m+1-M)A,$ and $m=0,1,\dots,M-1$. For this lab, this was just $A_m \in {\left\{ {\pm1/3,\pm1} \right\}}$. While this lab was relatively short, it was important to implement constellation normalization. This is because due to the effects of the channel, the received signal is attenuated, as seen in the right image rx constellation. Despite this, the detection thresholds are unchanged, leading to all bits being within the ${\left\{ {\pm1/3} \right\}}$ decision threshold!

Signal without constellation normalization (image 1) and the flowgraph for Lab 7 (image 2). Note the high symbol error rate of 0.5624.

Course Project: PSK Implementation

Received signal constellation of 8-PSK (image 1) and 16-PSK (image 2)

After Lab 7, all that remained for us to do was the project. Everyone was assigned to implement either PSK (phase shift keying) or QAM (quadrature amplitude modulation). I was given the task to implement PSK. PSK, which to be technical is phase modulation (PM) in the passband, is the act of encoding bit information by varying the phase of the signal, which can be represented mathematically as $x(t)=\sum_k s_m \psi(t-kT)$, where $s_m=\sqrt{E_p}\exp{\left( {j\frac{2\pi m}{M}} \right)}$ and $\psi(t)=\frac{p(t)}{\sqrt{E_p}}$, where $p(t)$ is the pulse function. To do this, I had to modify several parameters, including getting the pilot sequence to send sequences of $\pm(1/\sqrt{2}+j/\sqrt{2})$ instead of $\pm1$, which are complex values allowing for ideal autocorrelation properties. The result is a signal constellation with 8 dots whose centers are radially equidistant from the origin. Since this is $M=8$ PSK, each sent symbol now transmits $k=3$ bits per symbol!

After implementing 8-PSK, I moved towards 16-PSK. This was not a major leap, and largely involved changing a few block parameters. As a result, the received signal constellation has 16 dots. However, this scheme is now more sensitive to noise as evidenced by the above graph, requiring higher transmitter/receiver gains to achieve the same BER as 8-PSK.

As a final challenge, I implemented a Gaussian filter. Because the finite impulse response filters (FIRs) in the flowgraph were all normalized with respect to the rectangular pulse, I needed to calculate the energy of the Gaussian pulse and normalize all the FIRs with respect to this energy, which turned out to be approximately 3. The major changes I noted from the usage of a Gaussian filter was the differing pulse and eye diagram shapes and a sharper cutoff of the signal’s frequency spectrum. However, it seems that the scaling of the tx/rx bits are still slightly off, indicating that I did not apply appropriate normalization somewhere in the flowgraph. Fortunately, this does not affect the performance of this scheme.

Frequency spectrum of PSK with a rectangular and Gaussian filter (image 1 and 2, respectively). Note the faster falloff of the Gaussian filter

All of the graphs used for 8-PSK

All of the graphs used for 16-PSK, including rectangular/Gaussian pulse shaping (first/second image respectively)

Conclusion

The flowgraph of the project

With everything said and done, I have to say that I thoroughly enjoyed this course. While topics related to signals and systems and communications definitely get quite technical, it is quite refreshing to be able to actually implement the mathematics discussed. By taking this course, I now have a deeper appreciation for the ways that information around me is communicated and I look forward to learning more about it in the future.

Facebook
LinkedIn
Twitter
Email