You are on page 1of 2

Phase modulation

Bernd Porr
9 Oct 2015

This lab introduces you into phase shift keying.

1 Real valued phase modulation (BPSK)


1.1 Modulation
1. Generate a sinewave with a normalised frequency of 0.1 at a length of 80 samples with a loop.
Plot the sine wave and check that it has 10 samples / cycle.

2. Add a sign variable so that you can switch the phase.

3. Generate a longer sequence of sine wave chunks of 80 samples where the bit stream of an image
determines the phase within very chunk. You can generate the bitstream with this code fragment:

% pacman
image = [ 1, 1, 1, 0, 0, 1, 1, 1;
1, 1, 0, 0, 0, 0, 1, 1;
1, 0, 0, 0, 1, 0, 0, 1;
0, 0, 0, 0, 0, 0, 1, 1;
0, 0, 0, 0, 0, 1, 1, 1;
1, 0, 0, 0, 0, 0, 0, 1;
1, 1, 0, 0, 0, 0, 1, 1;
1, 1, 1, 0, 0, 1, 1, 1 ];
N=8*8;
bit_stream = [];
% Generate the bitstream from the pacman
for j = 1:8
bit_stream = [bit_stream image(j,:)];
end

You can check the image with imshow(image);


You should see a signal which looks like the one shown in Fig 1 where the phase shifts should be
visible after having zoomed in.

1.2 Demodulation
1. Generate a carrier signal with the same frequency (10 samples / cycle) as before which has the
same length as the bpsk signal.

2. Mix the carrier signal with your pm signal and check that you see a shift in DC when a phase
change happens.

1
1

0.5

-0.5

-1
0 100 200 300 400 500

Figure 1: PSK signal

3. Filter the resulting signal with a lowpass filter, for example:

b = fir1(100,0.05);
lp_demod = filter(b,1,mixer);

Experiment with different cutoff frequencies so that the demodulated signal looks smooth. The
term 100 determines the order of the filter. The higher the order the better the damping but the
longer the processing delay (roughly half the order). You should see a demodulated signal which
looks like the one shown in Fig 1.

4. Sample the lowpass filtered signal for the different symbols and piece together the pacman image.
Check that all pixels are properly detected.
Check the image with imshow(image);

5. Try out images from other groups.

2 Complex valued phase modulation (quadrature modulation)


Now modify the program from above and introduce quadrature modulation by mixing a cosine and a
sine carrier as shown in the lecture.
Transmit the pacman with half the required samples by using both cosine and sine transmission
streams.

You might also like