<< Chapter < Page | Chapter >> Page > |
If all has gone well, the quantized output
mprime
should
be identical to the original message string.The function
pam2letters.m
rebuilds the message
from the received signal. The final line of the programcalculates how many symbol errors have occurred
(how many of the
differ between the
message
m
and the reconstructed message
mprime
).
% first run pulseshape.m to create x
y=xcorr(x,ps); % correlate pulse with received signalz=y(N*M:M:N*M)/(pow(ps)*M); % downsample to symbol rate and normalize
mprime=quantalph(z,[-3,-1,1,3])'; % quantize to +/-1 and +/-3 alphabet
pam2letters(mprime) % reconstruct messagesum(abs(sign(mprime-m))) % calculate number of errors
recfilt.m
undo pulse shaping using correlation
(download file)
In essence,
pulseshape.m
is a transmitter, and
recfilt.m
is the corresponding receiver.
Many of the details of this simulation can be changedand the message will still arrive intact. The following
exercises encourage exploration of some of the options.
Other pulse shapes may be used. Try
ps=sin(0.1*pi*(0:M-1));
ps=cos(0.1*pi*(0:M-1));
ps=ones(1,M);
What happens if the pulse shape used at the transmitter
differs from the pulse shape used at the receiver? Try using theoriginal pulse shape from
pulseshape.m
at the transmitter,
but using
ps=sin(0.1*pi*(0:M-1));
at the receiver.
What percentage errors occur?ps=cos(0.1*pi*(0:M-1));
at the receiver.
What percentage errors occur?The received signal may not always arrive
at the receiver unchanged. Simulate a noisy channelby including the command before the
xcorr
command in
recfilt.m
. What percentage errors
occur? What happens as you increase or decrease the amount ofnoise (by changing the
1.0
to a larger or smaller number)?
In many communication systems, the data in the transmitted signal
is separated into chunks called frames.In order to correctly decode the text at the receiver,
it is necessary to locate the boundary (the start) of each chunk.This was done by fiat in the receiver of
recfilt.m
by correctly indexing into the received signal
y
.
Since this starting point will not generally be known beforehand,it must somehow be located.
This is an ideal job for correlation and a marker sequence.
The marker is a set of predefined symbols embedded at some specified location within eachframe. The receiver can locate the marker by cross-correlating it with the incoming signal stream.What makes a good marker sequence? This section shows that not all markers are created equally.
Consider the binary data sequence
where the marker is used to indicate a frame transition. A seven-symbol marker is to be used.Consider two candidates:
The correlation of the signal with each of the markers can be performed as indicated in [link] .
For marker A, correlation corresponds to a simple sum of the last seven values.Starting at the location of the seventh value available to us in the data sequence (two data points before the marker), marker A producesthe sequence
Notification Switch
Would you like to follow the 'Software receiver design' conversation and receive update notifications?