12.4 Application to Digital Communications 7390 1 2 3 4 5 6 7 8 9− 101
m(
t)Message0 1 2 3 4 5 6 7 8 9
− 101
c(t)Code0 1 2 3 4 5 6 7 8 9
− 101
s(t)t (sec)Spread Message− 50000 − 4000 − 3000 − 2000 − 1000 0 1000200030004000204060|M
(f)|Message Spectrum− 50000 − 4000 − 3000 − 2000 − 1000 0 1000200030004000102030|S(f)|f (Hz)Spread Signal Spectrum− (^10123456789)
0
1
− (^10123456789)
0
1
r(t
)
0 1 2 3 4 5 6 7 8 9
− 1
0
1
− (^10123456789)
0
1
t (sec)
× 103
× 103
× 103
× 103
× 103
× 103
× 103
s(a
t)
ma
(t)
m^1
(t)
(a) (b)
(c)
FIGURE 12.13
Simulation of direct-sequence spread-spectrum communication. (a) Displays from top to bottom the message,
the code, and the spread signal. (b) Displays the spectrum of the message and of the spread signal (notice it is
wider than that of the message). (c) Displays the band-pass signals sent and received (assumed equal), the
despread analog, and the binary message.
subplot(311)
bar(t,m); axis([0 max(t) -1.2 1.2]);grid; ylabel(‘m(t)’)
subplot(312)
bar(t,c); axis([0 max(t) -1.2 1.2]);grid; ylabel(‘c(t)’)
subplot(313)
bar(t,s); axis([0 max(t) -1.2 1.2]);grid; ylabel(‘s(t)’); xlabel(‘t (sec)’)
% spectrum of message and spread signal
M = fftshift(abs(fft(m)));
S = fftshift(abs(fft(s)));
N = length(M);K = [0:N-1];w = 2∗K∗pi/N-pi; f = w/(2∗pi∗Ts);
figure(2)
subplot(211)