<< Chapter < Page | Chapter >> Page > |
Drawing on the code in
pulseshape.m
, and modulating with the carrier
c
,
pulrecsig.m
creates the two different received signals.
The
pam
command creates a random sequence of symbols
drawn from the alphabet
,
, and then
uses
hamming
to create a pulse
shape.
This is not a common (or a particularly
useful) pulse shape. It is just easy to use.Good pulse shapes are considered in detail in Chapter
[link] . The oversampling factor
M
is used to simulate the
“analog” portion of the transmission, and
is
equal to the symbol time
.
N=10000; M=20; Ts=.0001; % no. symbols, oversampling factor
time=Ts*N*M; t=Ts:Ts:time; % sampling interval and time vectorsm=pam(N,4,5); % 4-level signal of length N
mup=zeros(1,N*M); mup(1:M:N*M)=m; % oversample by integer length Mps=hamming(M); % blip pulse of width M
s=filter(ps,1,mup); % convolve pulse shape with datafc=1000; phoff=-1.0; % carrier freq. and phase
c=cos(2*pi*fc*t+phoff); % construct carrierrsc=s.*c; % modulated signal (small carrier)
rlc=(s+1).*c; % modulated signal (large carrier)
pulrecsig.m
make pulse-shaped signal
(download file)
[link] plots the spectra of both
the large and suppressed carrier signals and . The carrier itselfis clearly visible in the top plot, and its frequency and
phase can readily be found by locating the maximum valuein the FFT:
fftrlc=fft(rlc); % spectrum of rlc
[m,imax]=max(abs(fftrlc(1:end/2))); % index of max peak
ssf=(0:length(t))/(Ts*length(t)); % frequency vectorfreqL=ssf(imax) % freq at the peak
phaseL=angle(fftrlc(imax)) % phase at the peak
Changing the default phase offset
phoff
changes the
phaseL
variable accordingly. Changing the
frequency
fc
of the carrier changes the
frequency
freqL
at which the maximum occurs.
Note that the
max
function used in this fashion returns both
the maximum value
m
and the index
imax
at which the maximum occurs.
On the other hand, applying the same code to the FFT of
the suppressed carrier signal does not recover the phaseoffset. In fact, the maximum often occurs at frequencies
other than the carrier, and the phase values reportedbear no resemblance to the desired phase offset
phoff
. There needs to be a way to process
the received signal to emphasize the carrier.
A common scheme uses a squaring nonlinearity followed by a bandpass filter, as shown in [link] . When the received signal consists of the pulse modulated data signal times the carrier , the output of the squaring block is
Notification Switch
Would you like to follow the 'Software receiver design' conversation and receive update notifications?