Let’s look at some BPSK Receiver Theory. This is the 3rd post in the PSK Series. We’ll cover the theory before we go into the implementation.
PSK Series
Here is a summary of where we are in the PSK Series.
- BPSK Transmit Theory - This post shows graphs and has audio files of what this tool does.
- BPSK Implementation
- BPSK Receiver Theory - This Post
- BPSK Receiver Implementation - Coming Soon
- QPSK - Coming Soon
What are we going to receive?
See my previous post on BPSK Transmitter Theory for what the waveform transmitted. For this post we’ll receive and decode this waveform. Effectively, we’re sending symbols that are Root Raised Cosine waveforms multiplied with sinusoids. Below is the encoded text t
represented by our alphabet as
We need to build a receiver to guess the bits transmitted from the waveform above. It should be decoded to
Our Matched Filter
Here are our matched filters, which are our basis functions we used to generate symbols.
Our Basis Functions are simple
The take-away here is when we send a
We can convolve what we receive with only one of the basis functions
Convolving the Received signal with our Matched Filter
Let’s look at Convolving our received waveform with our matched filter. The matched filter will give us the best SNR. People pedantically prove this maximized SNR all over the internet. All we’re doing here is convolving the entire received waveform with the same Root Raised Cosine we used to create the waveform when it was transmitted. It makes a lot of sense to correlate the received waveform to what was transmitted.
Note, the power of our basis functions is essentially
Here is what is important in this graph.
- The green lines are
apart which corresponds to the maxima/minima for each symbol. If we could sample at one place to guess for a or the green lines would be the place. But as you’ll see it doesn’t make much sense to just sample at one place for a symbol, we’d be throwing out a ton of good data to make our guess. - An
x
corresponds to a local maxima/minima or a peak output from the convolution between our signal and the matched filter. - For this example we have 4 cycles per symbol. Thus, we have 8
x
marks per symbol since each cycle has 2 peaks. However, due to low amplitude we chop off one ‘x’, leaving 7 peaks per symbol. Each set of 7 is a new symbol and the set corresponds to . Therefore, we have peaks. - We go from an amplitude of
in our basis functions to nearly after the convolution. Should we be worried about bit overflow on our data types? Yes! Also, this large range makes threshold detection easier with so much headroom. - Each peak with an
x
corresponds to a positive or negative phase of our basis functions. More on this regarding Phase Locked Loops…
Phase Locked Loops
Our job is to decode BPSK. The P here stands for Phase and the phase is a big part of decoding obviously. As we transmit symbols we’re shifting the phase of a carrier. Let’s repeat our basis functions again.
When we look at the figure above, each x
mark will align in time to the phase for x
will correspond to phase for an entire symbol period. As a matter of fact, discounting drift, this phase will align for all symbols transmitted during a symbol duration.
So what is a Phase Lock in this context? We will lock the phase of our peaks in the 1st symbol received to the phase shift of x
to the output of a Phase Locked Loop. If it’s a bit confusing, I agree, it took me a while to grasp this point.
Generating our Phase Locked Loop Function
Let’s outline creation of our Phase Locked Loop function. Again, this function allows us to align the phase of each symbol to guess whether it’s a
- For the first symbol period, and the first symbol period only, we will find the peaks. See above there are 7
x
marks for the first symbol. - In this first symbol period we will find the peak with the largest magnitude. This corresponds to the peak at
with a value of or among friends. - We will take the time
and lock the phase of a . This phase will correspond to our . Let’s call this function - Now that we have this phase for any time
we correspond the amplitude of our phase locked function. A positive amplitude corresponds to a positive phase or a symbol and a negative amplitude corresponds to a negative phase . By positive and negative amplitudes I’m thinking values near and .
The phase for
Where
For our example
Thus, we have
The Phase Locked Loop is our Magic 8-Ball
What is amazing here is our Phase Locked Loop function will tell us for every x
on the figure above the phase of our transmitted sinusoid, there are 36 of them in total. Sorry, it’s a bit hard to read the following values of
Symbol # | t | y | PLL(t) | Symbol Guess |
---|---|---|---|---|
0 | 0.096000 | -62730531 | 1.00 | 1 |
0 | 0.088125 | -39491674 | 1.00 | 1 |
0 | 0.100000 | 60867936 | -1.00 | 1 |
1 | 0.128000 | 66875555 | 1.00 | 0 |
1 | 0.131875 | -61727000 | -1.00 | 0 |
I just picked some points at random corresponding to x
’s on the figure. We can make a guess for what the symbol is by taking the sign of the amplitude multiplied by x
s in the figure correspond to a symbol of x
s correspond to a symbol of
If we sum up all the values of t
. A reverse lookup from the alphabet is all that’s needed.
Receiver Implementation Summary
How would we receive this? Let’s provide an outline:
- Convolve what is received with our matched filter. This matched filter is a basis function corresponding to the symbol that relates to transmission of a
bit. - When the convolution output has peaks above a threshold, for a long enough amount of time, handwave .. handwave … we can make guesses. This amount of time needs to be at least
symbol periods , since it’s the shortest possible alphabet sequence. - We do peak finding and correlate each peak to what symbol it’s in. The peaks last in
chunks. - A Phased Locked Look will determine the phase of each peak (both positive and negative).
- For each symbol period we can accumulate the amplitude at that time, multiplied by the phase locked loop output at the time. The sign of the multiplicative sum will determine if a
or a was transmitted. - From step 5 we will have a bit stream of guesses such as
. From here we will take the bit stream and reverse lookup using our alphabet for the text that was sent.
The steps above are definitely not the only way to do receive PSK. The challenge with receiving PSK is phase is so sensitive to time. If guess the phase wrong, you flip a bit. Depending how you do it you can be off for the whole duration or off regionally.
What I left out
- Choosing the amplitude at which to start recording and guessing is a bit of black magic as far as I know …
- The phase locked loop can be continually adjusted. For a long bit sequence setting the phase for the PLL at the first symbol will be susceptible to drift.
A Short Rant on PSK Theory Text
Whenever I read theory text explaining PSK they usually mention sampling at multiples of the symbol period
In order to build a system where a receiver and transmitter are in good time lock and you can sample every
In the implementation above is asynchronous and we will have to guess that first bit. Sometimes this is known as clock recovery. Knowing the transmission always starts with