Professional Documents
Culture Documents
Bernd Porr
9 Oct 2015
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
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
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);