Вы находитесь на странице: 1из 16

ECEN 4652/5002 Communications Lab Spring 2013

2-13-13 P. Mathys
Lab 5: PAM Receiver with Matched Filter and Symbol
Timing Extraction
1 Introduction
Communication without noise would be trivial. You could take the text of a whole encyclo-
pedia, encode it in ASCII, and make a long binary string by concatenating the resulting bits.
To transmit this string as a single symbol you would interpret it as the binary representation
of a number which determines the amplitude of a voltage or current pulse sent by the trans-
mitter. The receiver would then convert the received amplitude back into a number whose
binary representation is the received bit string. If the bit string is 7 bits long (from one
ASCII character), then the receiver needs to distinguish 128 dierent amplitude levels, and
the scheme actually works quite well. But if a whole text results in 1 million bits, say, then
the receiver needs to be able to distinguish 2
1,000,000
10
300,000
levels, which is impossible in
the presence of the slightest amount of noise. Thus, there is no other choice than to trans-
mit a long text as a sequence of smaller numbers and, to minimize the probability of error,
to build the receiver front-end such that it maximizes the signal-to-noise ratio (SNR) for
each reception. An associated problem that comes from transmitting sequences of numbers
rather than a single number is that the receiver must synchronize itself to the transmitter.
In practice this means in most cases that symbol timing information must be extracted from
the received signal waveform itself.
1.1 Trapezoidal Lowpass Filter
Lowpass lters (LPF) are used for many dierent tasks in communication systems. Among
them are the separation of a desired signal from noise and interference and symbol timing
extraction at the receiver.
The impulse response h
L
(t) and frequency response H
L
(f) of an ideal LPF with cuto
frequency f
L
are shown in the gure below.
H
L
(f)
1
f
f
L 0 f
L
h
L
(t) =
sin(2f
L
t)
t

For practical applications the problem with the ideal LPF is that h
L
(t) needs to be trun-
cated, e.g., to the time interval k/(2f
L
) t k/(2f
L
) for some integer k, which leads
1
to substantial sidelobes in the frequency response whenever k is nite. The following plot
shows an example with f
L
= 1000 Hz and k = 10.
5 4 3 2 1 0 1 2 3 4 5
500
0
500
1000
1500
2000
Ideal LPF, h
L
(t) Truncated to k/(2f
L
)<t<k/(2f
L
), f
L
=1000 Hz, k=10
t [ms]
h
L
(
t
)
3000 2000 1000 0 1000 2000 3000
60
50
40
30
20
10
0
f [Hz]
2
0
*
l
o
g
1
0
(
|
H
L
(
f
)
|
)

[
d
B
]
By making the transition from the passband to the stopband less abrupt, the situation can be
improved considerably. One possibility is to use an LPF with trapezoidal frequency response
as shown next.
H
L
(f)
1
f
(1+)f
L
(1)f
L
0
(1)f
L
(1+)f
L
0 1
h
L
(t) =
sin(2f
L
t)
t
sin(2f
L
t)
2f
L
t

As the parameter is varied from 0 to 1, the frequency response goes from an ideal LPF
to a H(f) with triangular shape. An example with f
L
= 1000 Hz, k = 10, and = 0.2 is
shown below.
2
5 4 3 2 1 0 1 2 3 4 5
500
0
500
1000
1500
2000
Trapezoidal LPF, h
L
(t) Truncated to k/(2f
L
)<t<k/(2f
L
), f
L
=1000 Hz, k=10, =0.2
t [ms]
h
L
(
t
)
3000 2000 1000 0 1000 2000 3000
60
50
40
30
20
10
0
f [Hz]
2
0
*
l
o
g
1
0
(
|
H
L
(
f
)
|
)

[
d
B
]
An additional advantage of a LPF with trapezoidal frequency response is that its transition
region around f
L
can be used as a frequency discriminator, i.e., as a device that converts
linearly from frequency to amplitude. A linear plot of the frequency response of the same
lter that was used as an example above is plotted in the next gure.
3000 2000 1000 0 1000 2000 3000
0
0.2
0.4
0.6
0.8
1
1.2
1.4
f [Hz]
|
H
L
(
f
)
|
Trapezoidal LPF, h
L
(t) Truncated to k/(2f
L
)<t<k/(2f
L
), f
L
=1000 Hz, k=10, =0.2
1.2 Filtering PAM Signals
Suppose you received a noisy rectangular PAM signal r(t) with baud rate F
B
= 1/T
B
, like
the one shown in the graph below.
3
0 5 10 15 20 25 30
3
2
1
0
1
2
3
Noisy Rectangular PAM Signal
t/T
B


r
(
t
)
,


s
(
t
)
Before sampling r(t) at times t = nT
B
, it certainly is a good idea to perform some kind of
averaging operation. This is the function of the receiver lter h
R
(t) H
R
(f) shown in the
following blockdiagram of a general PAM communication system.
PAM
p(t)
Channel
H
C
(f)
Filter
H
R
(f)
+
Noise n(t)

t = nT
B

Transmitter

Channel

Receiver
b(t)
a
n
s(t) r(t)
b
n
If H
R
(f) is a LPF with cuto frequency near F
B
, then the output b(t) of the receiver lter
from the same r(t) as shown above looks as follows.
0 5 10 15 20 25 30
3
2
1
0
1
2
3
Noisy Rectangular PAM Signal after LPF H
R
(f) near F
B
t/T
B


r
(
t
)
,


s
(
t
)
This is quite an improvement, and it is tempting to see if more ltering would lead to further
improvements. The following graph shows r(t) after lowpass ltering near F
B
/4.
4
0 5 10 15 20 25 30
3
2
1
0
1
2
3
Noisy Rectangular PAM Signal after LPF H
R
(f) near F
B
/4
t/T
B


r
(
t
)
,


s
(
t
)
That does remove more noise, but at the price of loosing signal energy and introducing
intersymbol interference (ISI). Thus, a compromise needs to be made between rejecting as
much noise as possible, while keeping most of the signal energy and avoiding ISI. A properly
chosen LPF is a good initial choice, but to maximize the signal-to-noise ratio (SNR) at the
output of the receiver lter, a matched lter, as described in the next section, needs to be
used.
1.3 Matched Filter
Suppose a transmitter sends the PAM signal s(t) = a
0
p(t) over a channel with unit impulse
response h
C
(t) H
C
(f). It is assumed that p(t) is a deterministic pulse, but a
0
is a random
variable. In the absence of noise the received signal is thus a
0
p(t) h
C
(t) = a
0
p
C
(t), where
p
C
(t) = p(t) h
C
(t). If an additive noise model is used for the channel, then the received
signal is r(t) = a
0
p
C
(t) + n(t), where n(t) is the noise signal. The question now is how to
design a receiver that estimates a
0
as accurately as possible. The following block diagram
depicts the situation graphically.
PAM
p(t)
Channel
h
C
(t)
Filter
h
R
(t)
+
Noise n(t)

t = t
0

Transmitter

Channel

Receiver
b(t)
a
0
s(t) a
0
p
C
(t) r(t)
b
0
Note that, in order to avoid the issue of ISI, this model uses the so called one shot approach,
i.e., only the single sample a
0
is transmitted. If the overall pulse q(t) = p
C
(t) h
R
(t) satises
Nyquists rst criterion, then the results from the one shot approach directly generalize to
the transmission of sequences a
0
, a
1
, a
2
, . . . of symbols.
Assume that the random variable a
0
and the noise n(t) are uncorrelated and that n(t) is
a wide-sense stationary (WSS) CT random process with zero mean, i.e., E[n(t)] = 0 and
5
autocorrelation function R
n
(t, t ) = E[n(t) n

(t )] = R
n
(), all t. The power spectral
density (PSD) S
n
(f) of the noise is the FT of the correlation function R
n
(), i.e.,
S
n
(f) =
_

R
n
()e
j2f
d .
For white noise R
n
() = (N
0
/2)() S
n
(f) = N
0
/2, all f, i.e., white noise has a at
(2-sided) PSD.
One optimality criterion for selecting the receiver lter response h
R
(t) is the maximization
of the signal-to-noise ratio (SNR) of b
0
after sampling at t = t
0
. If r(t) = a
0
p
C
(t) + n(t),
then
b(t) = h
R
(t)
_
a
0
p
C
(t) + n(t)
_
= a
0
_

H
R
(f) P
C
(f) e
j2ft
df +
_

h
R
() n(t ) d .
Therefore
E[b(t)] = E[a
0
]
_

H
R
(f) P
C
(f) e
j2ft
df +
_

h
R
() E[n(t )]
. .
= 0
d
= E[a
0
]
_

H
R
(f) P
C
(f) e
j2ft
df .
In the absence of noise (i.e., n(t) = 0)
E[|b(t)|
2
] = E
_
_
a
0
_

H
R
(f) P
C
(f) e
j2ft
df
__
a
0
_

H
R
() P
C
() e
j2t
d
_

_
= E[|a
0
|
2
]

H
R
(f) P
C
(f) e
j2ft
df

2
,
and thus the signal power at t = t
0
is
E[|b
0
|
2
] = E[|b(t
0
)|
2
] = E[|a
0
|
2
]

H
R
(f) P
C
(f) e
j2ft
0
df

2
.
6
The autocorrelation function R
b
(t
1
, t
2
) at the output of the receiver lter when r(t) = n(t)
(noise only, no pulse present or a
0
= 0) is obtained as follows
R
b
(t
1
, t
2
) = E[b(t
1
) b

(t
2
)] = E
__
h
R
(t
1
) n(t
1
)
_ _
h
R
(t
2
) n(t
2
)
_

= E
_
_

h
R
() n(t
1
) d
_

R
() n

(t
2
) d

=
_

h
R
() h

R
() E[n(t
1
) n

(t
2
)]
. .
= R
n
(t
1
t
2
+ ) =
_
S
n
(f) e
j2f(t
1
t
2
+)
df
dd
=
_

h
R
() h

R
() S
n
(f) e
j2f(t
1
t
2
+)
df dd
=
_

S
n
(f)
_

h
R
() e
j2f
d
_

R
() e
j2f
d e
j2f(t
1
t
2
)
df
=
_

S
n
(f) |H
R
(f)|
2
e
j2f(t
1
t
2
)
df = R
b
(t
1
t
2
) .
The variance of the noise at time t at the output of the lter h
R
(t) is therefore

2
b
= R
b
(0) =
_

S
n
(f) |H
R
(f)|
2
df .
Assuming white noise with S
n
(f) = N
0
/2 for all f, this simplies to

2
b
= R
b
(0) =
N
0
2
_

|H
R
(f)|
2
df .
The SNR after sampling at t = t
0
in the receiver can now be expressed as
S
N
=
E[|b
0
|
2
]

2
b
=
2E[|a
0
|
2
]
N
0

H
R
(f) P
C
(f) e
j2ft
0
df

2
_

|H
R
(f)|
2
df
.
To maximize S/N by choice of h
R
(t) H
R
(f), the following theorem comes in handy.
Theorem: Schwartz Inequality. Let U(f) and V (f) be real- or complex-valued and have
nite energy. Then

U(f) V (f) df

|U(f)|
2
df
_

|V (f)|
2
df ,
with equality i V

(f) = AU(f) for some real- or complex-valued constant A.


7
In the context of the PAM receiver lter this implies that

H
R
(f) P
C
(f) e
j2ft
0
df

|H
R
(f)|
2
df
_

|P
C
(f) e
j2ft
0
|
2
. .
= |P
C
(f)|
2
df ,
and thus
S
N

2E[|a
0
|
2
]
N
0
_

|H
R
(f)|
2
df
_

|P
C
(f)|
2
df
_

|H
R
(f)|
2
df
=
2E[|a
0
|
2
]
N
0
_

|P
C
(f)|
2
df ,
with equality i
P

C
(f) e
j2ft
0
= AH
R
(f) = H
R
(f) =
P

C
(f) e
j2ft
0
A
.
Substituting this in the equation for E[b(t)] at t = t
0
yields
E[b
0
] =
E[a
0
]
A
_

|P
C
(f)|
2
df = A =
_

|P
C
(f)|
2
df =
_

|p
C
(t)|
2
dt ,
for E[b
0
] = E[a
0
]. Altogether this proves the following
Theorem: Matched Filter. Let r(t) = a
0
p
C
(t) + n(t) be a received PAM signal with
random amplitude a
0
, known pulse p
C
(t), and additive white noise n(t) with PSD S
n
(f) =
N
0
/2 for all f. Assume that a
0
and n(t) are uncorrelated. Then the lter
h
R
(t) =
p

C
(t
0
t)
_

|p
C
()|
2
d
H
R
(f) =
P

C
(f) e
j2ft
0
_

|P
C
()|
2
d
which is called a matched lter, maximizes the SNR at its output when sampled at t = t
0
.
The expected output value (at t = t
0
) is E[a
0
], with SNR
S
N
=
2 E[|a
0
|
2
]
N
0
_

|p
C
()|
2
d =
2 E[|a
0
|
2
]
N
0
_

|P
C
()|
2
d .

The plot below shows the output of the matched lter for the same noisy rectantgular PAM
signal r(t) that was used as an example in a the section.
0 5 10 15 20 25 30
3
2
1
0
1
2
3
Noisy Rectangular PAM Signal after Matched Filter H
R
(f)
t/T
B


b
(
t
)
,


s
(
t
)
The improvement over simple lowpass ltering is clearly visible.
8
1.4 Root Raised Cosine in Frequency Pulse
The overall pulse q(t) in a PAM communication system with matched lter receiver is
q(t) = p
C
(t) h
R
(t) Q(f) = P
C
(f) H
R
(f)
Assuming t
0
= 0 and white noise with S
n
(f) = N
0
/2, yields
Q(f) =
|P
C
(f)|
2
_

|P
C
()|
2
d
.
Thus, to satisfy Nyquists 1st criterion for no ISI after the matched lter, P
C
(f) has to
satisfy

k=
|P
C
(f kF
B
)|
2
= K , all f ,
for some constant K. Since the RCf pulse is bandlimited and behaves well in the time
domain, it is a natural starting point for nding a bandlimited P
C
(f) that satises the above
formula. Recall that that the RCf pulse with parameter 0 1 is dened as
p(t) =
sin(t/T
B
)
t/T
B
cos(t/T
B
)
1 (2t/T
B
)
2
,
with Fourier transform
P(f) =
_

_
T
B
, |f|
1
2T
B
,
T
B
2
_
1 + cos
_
T
B

_
|f|
1
2T
B
_
__
,
1
2T
B
|f|
1 +
2T
B
,
0 , |f|
1 +
2T
B
.
To obtain the square root of this P(f), use the trigonometric identity
cos
2
=
1
2
(1 + cos(2)) =
_
1 + cos
2
= cos
_

2
_
.
In addition, multiply the resulting spectrum by

T
B
(to keep the dc component unchanged)
so that
P
C
(f) =
_

_
T
B
cos
_
T
B
2
_
|f|
1
2T
B
_
_
,
1
2T
B
|f|
1 +
2T
B
,
T
B
, |f|
1
2T
B
,
0 , otherwise .
9
which is proportional to the square root of the RCf spectrum. In the time domain this
corresponds to
p
C
(t) =
_

_
T
B

sin
_
(1 )t/T
B
_
+ (4t/T
B
) cos
_
(1 + )t/T
B
_
_
1 (4t/T
B
)
2
_
t
, t = 0,
T
B
4
,
1 +
4

, t = 0 ,

2
_
_
1 +
2

_
sin
_

4
_
+
_
1
2

_
cos
_

4
_
_
, t =
T
B
4
,
where 0 1. Because of its spectral shape and origin, this pulse will be called the
root raised cosine in frequency (RRCf ) pulse. An example of a RRCf pulse p(t) and
p(t T
B
) and its Fourier transform |P(f)| for = 0.4 is shown in the graphs below.
0.04 0.03 0.02 0.01 0 0.01 0.02 0.03 0.04 0.05
0.2
0
0.2
0.4
0.6
0.8
1
1.2
t [sec]
p
(
t
)
RRCf Pulse p(t)<=>P(f), F
B
=100 Baud, =0.4
p(t)
p(tT
B
)
100 80 60 40 20 0 20 40 60 80 100
0
0.002
0.004
0.006
0.008
0.01
0.012
f [Hz]
|
P
(
f
)
|
Note that this p(t) creates intersymbol interference, as indicated by the red crosses at the
sampling times (black circles), during transmission. After matched ltering at the receiver,
however, this intersymbol interference disappears.
1.5 Symbol Timing Synchronization
As shown previously, a spectral component at the baud rate F
B
can be extracted from most
practical PAM signals by squaring the received signal r(t). To remove as much noise as
10
possible, it is best to use a matched lter (MF) H
R
(f) rst and then to square its output
b(t) as shown in the following block diagram.
H
R
(f)
MF
(.)
2
LPF
at f
L
LPF
at f
L
tan
1
wq(t)
w
i
(t)

2 sin2F
B
t
2 cos 2F
B
t
w
i
(t)
w
q
(t)
b
2
(t) r(t) b(t)
v
i
(t)
v
q
(t)
(t)
The reason why symbol timing synchronization at the receiver is necessary is that the baud
rate F
B
used (initially) at the receiver diers from the baud rate F
B
+f
e
used at the trans-
mitter by the frequency error f
e
. In addition, there may also be a phase error
e
. Reliable
reception of a PAM signal is only possible if f
e
= 0 and
e
is suciently small.
Let F
B
be the baud rate used by the receiver and let
b
B
(t) = A cos
_
2(f
B
+ f
e
)t +
e
_
,
be the term in b
2
(t) that contains the spectral component at the baud rate F
B
+f
e
used by
the transmitter. To estimate f
e
and
e
, b
2
(t) is multiplied by 2 cos 2F
B
t and by 2 sin 2F
B
t
to obtain
v
i
(t) 2b
B
(t) cos 2f
B
t = A
_
cos(2f
e
t +
e
) + cos(2(2F
B
+ f
e
)t +
e
)

,
v
q
(t) 2b
B
(t) cos 2f
B
t = A
_
sin(2f
e
t +
e
) sin(2(2F
B
+ f
e
)t +
e
)

,
where the approximation comes from the fact that b
2
(t) also contains other terms than the
(strong) spectral component in b
B
(t). After lowpass ltering with cuto frequency f
L
< F
B
w
i
(t) Acos(2f
e
t +
e
) ,
w
q
(t) Asin(2f
e
t +
e
) .
Thus after taking the inverse tangent of w
q
(t)/w
i
(t) (resolved modulo 2) and unwrapping
the phase at jumps by 2,
(t) 2f
e
t +
e
.
This is the (estimated) error between the symbol timing at the transmitter and the symbol
timing at the receiver. To obtain a pulse train c(t) for sampling the received signal b(t) at
the (estimated) best time instants, compute
g(t) =
d
dt
_
sgn
_
sin
_
2F
B
t + (t)
__
,
where sgn(.) is the signum function (sgn(x) = 1 if x < 0, sgn(x) = +1 otherwise), and
then set
c(t) =
g(t) +|g(t)|
4
.
Thus, c(t) has impulses of area 1 at the positive zero crossings of sin
_
2F
B
t + (t)
_
.
11
2 Lab Experiments
E1. LPF with Trapezoidal Frequency Response. (a) The unit impulse response of an
LPF with trapezoidal frequency response and -6dB frequency f
L
is
h(t) =
sin(2f
L
t)
t
sin(2f
L
t)
2f
L
t
, 0 1 .
The linear rollo region of this LPF extends from (1 )f
L
to (1 +)f
L
. Write a Matlab
function, called trapfilt, that generates a truncated version h
T
(t) of this impulse response
and uses it to lter an input signal x(t) and produce a delay-compensated output signal y(t).
More specically
h
T
(t) =
_
h(t) , k/(2f
L
) t k/(2f
L
) ,
0 , otherwise ,
for some integer k and
H
T
(f) = 0 , f
L
f f
L
.
Note that delay compensation is important, for instance, when processing PAM signals, so
that the optimum sampling times are not shifted by the lowpass lter. The header and a
skeleton for the trapfilt function are shown below.
function [y,ord] = trapfilt(x,Fs,fL,k,alfa)
%trapfilt Delay compensated FIR LPF with trapezoidal frequency response.
% >>>>> [y,ord] = trapfilt(x,Fs,fL,k,alfa) <<<<<
% where
% y: filter output y(t), sampling rate Fs
% ord: filter order
% x: filter input x(t), sampling rate Fs
% Fs: Sampling rate of x(t), y(t)
% fL: cutoff frequency in Hz
% k: h(t) is truncated to -k/(2fL)<=t<=k/(2fL)
% alfa: frequency rolloff parameter, linear rolloff
% over range (1-alfa)fL<=|f|<=(1+alfa)fL
ixk = round(Fs*k/(2*fL)); %Tail cutoff index
t = [-ixk:ixk]/Fs; %Time axis for h(t)
ord = length(t)-1; %Filter order
%***** Generate impulse response h here *****
y = filter(h,1,[x zeros(1,ixk)])/Fs; %Filter output y(t)
y = y(ixk+1:end); %Filter delay compensation
(b) To test trapfilt, let F
s
= 16000 Hz, use a time axis from -0.5 to 0.5 sec, and generate
a unit impulse at t = 0. Note that this has to be (an approximation to) a CT unit impulse
(with area 1 under the impulse). Use this unit impulse as input for trapfilt with f
L
= 1000
Hz, k = 10 and = 0.2. Then use your showft function to plot the magnitude and the phase
of the unit impulse response. Display the magnitude both linear on an absolute scale, and
12
relative in dB. Compare your graphs to the ones given in the introduction. In particular,
verify that the passband has a magnitude of 1 and that the transition from passband to
stopband is linear. Verify also that the lter is properly delay-compensated (explain how
you did this). How do the results change when you set = 0?
(c) The le pamsig501.wav contains a noisy polar binary PAM signal. Look at the PSD of
this signal and then use trapfilt to lowpass lter the signal with f
L
1000 Hz, k 10,
and 0.2. Determine the baud rate F
B
(look at the PSD of the lowpass ltered signal
squared), and then use this information to display the eye diagram (use a width of 3 T
B
and
superimpose about 100 traces) of the lowpass ltered PAM signal. Change f
L
to nd the
value that gives you the largest eye opening. How is this f
L
related to F
B
?
E2. PAM Transmitter/Receiver. (a) Update your pam11 function to include the RRCf
(root raised cosine in frequency) pulse which is dened as
p(t) =
_

_
T
B

sin
_
(1 )t/T
B
_
+ (4t/T
B
) cos
_
(1 + )t/T
B
_
_
1 (4t/T
B
)
2
_
t
, t = 0,
T
B
4
,
1 +
4

, t = 0 ,

2
_
_
1 +
2

_
sin
_

4
_
+
_
1
2

_
cos
_

4
_
_
, t =
T
B
4
,
where 0 1. Call the new function pam12 (PAM, V1.2). The ptype for the RRCf pulse
is rrcf and the parameter format is pparms = [k alpha], with the same meanings as
for the RCf pulse. An example of polar binary PAM using an RRCf pulse with = 0.4 and
taillength k = 4 is shown in the following graph.
0.05 0 0.05 0.1 0.15 0.2 0.25 0.3 0.35 0.4
2
1
0
1
2
t [sec]
s
(
t
)
,
s
(
n

T
B
)
Polar Binary PAM for String Test, F
B
=100 Baud, "RRCf" p(t), k=5, =0.4
Note that the RRCf pulse has ISI at the sampling time instants. After ltering with a
matched lter, however, the ISI disappears.
(b) Write a Matlab function called pamrcvr10 (PAM receiver V1.0) which implements a
receiver, with matched lter and sampler, for (noisy) PAM signals. Here is the header for
this function:
13
function [bn,b,ixn] = pamrcvr10(t,r,FBparms,ptype,pparms)
%pamrcvr10 PAM receiver with matched filter: r(t) -> b(t) -> b_n.
% V1.0 for man, rcf, rect, rrcf, sinc, and tri
% pulse types
% >>>>> [bn,b,ixn] = pamrcvr10(t,r,FBparms,ptype,pparms) <<<<<
% where
% t: time axis for r(t)
% r: received (noisy) PAM signal r(t)
% FBparms = [FB dly]
% FB: baud rate of PAM signal, TB=1/FB
% dly: sampling delay for b(t) -> b_n, fraction of TB
% Sampling times are t=n*TB+t0 where t0=dly*TB
% ptype: pulse type from list
% {man,rcf,rect,rrcf,sinc,tri}
% pparms = not used for {man,rect,tri}
% pparms = [k alpha] for {rcf,rrcf}
% pparms = [k beta] for {sinc}
% k: "tail" truncation parameter for {rcf,rrcf,sinc}
% (truncates at -k*TB and k*TB)
% alpha: rolloff parameter for {rcf,rrcf}, 0<=alpha<=1
% beta: kaiser window parameter for {sinc}
% bn: received DT sequence after sampling at t=n*TB+t0
% b: received PAM signal b(t) after matched filter
% ixn: indexes where b(t) is sampled to obtain b_n
The following commands implement pamrcvr10 for rectangular p(t).
14
FB = FBparms(1); %Baud rate
Fs = (length(t)-1)/(t(end)-t(1)); %Sampling rate
%***** Set up matched filter response h_R(t) *****
TB = 1/FB; %Time per symbol
switch lower(ptype) %Determine left/right truncation
case {rect}
kL = 1/2;,kR = kL;
otherwise
kL = 1;,kR = kL; %Default truncation
end
ixpL = round(-Fs*kL*TB); %Left index for p(t) time axis
ixpR = round(Fs*kR*TB); %Right index for p(t) time axis
tp = [ixpL:ixpR-1]/Fs; %Time axis for p(t)
p = zeros(size(tp)); %Initialize pulse p(t)
switch lower(ptype)
case rect
ix = find(tp>=-kL*TB&tp<kR*TB);
p(ix) = ones(size(ix));
otherwise
disp([ptype ptype is not recognized])
end
hR = p(end:-1:1); %p(t) reversed
hR = Fs*hR/sum(p.^2); %hR(t) normalized
%***** Filter r(t) with matched filter hR(t) *****
b = conv(r,hR)/Fs; %Matched filter: b(t)=r(t)*hR(t)
b = b(1-ixpL:length(t)-ixpL); %Trim b(t)
%***** Sample b(t) at t=n*T_B+t0 to obtain b_n *****
n1 = ceil(FB*t(1)); %First n value
[aux ix1] = min(abs(t-n1/FB)); %ix1 is index of first n
ixn = ix1+round(Fs*([0:floor(FB*length(t)/Fs)-1]+FBparms(2))/FB);
ix = find(ixn>0&ixn<=length(t));
ixn = ixn(ix); %Trim to existing indexes
bn = b(ixn); %b(t) -> bn, t=n*TB+t0
Complete this function by adding the remaining pulse types. Note that the generation of
p(t) in pamrcvr10 is essentially identical to the p(t) generation in pam12.
(c) Reception of noisy PAM signals. The wav-les pamsig501.wav, pamsig502.wav, and
pamsig503.wav contain received PAM signals r(t) with additive white Gaussian noise. The
data in the PAM signals is ASCII text, 8 bits/character, LSB-rst, transmitted as polar
binary with logical 0 A and logical 1 +A where A is an amplitude level that was
chosen so that the wav-les (with the noise added) have amplitude less than 1. Use showpsd
in combination with trapfilt and time domain plots to analyze the PAM signals suciently
so that you can use your pamrcvr10 function to recover the ASCII text in each case.
15
E3. Matched Filters and ISI. (Experiment for ECEN 5002, optional for ECEN 4652)
Devise a test using pam12.m, pamrcvr10.m, and showeye.m to determine for which of the
pulse types (man, rcf, rect, rrcf, sinc, tri) there is ISI (intersymbol
interference) either in the received PAM signal r(t) and/or in the signal b(t) after the matched
lter. If there is ISI, estimate (in percent of the full size) by how much the eye in the eye
diagram gets closed because of ISI.
c 20002013, P. Mathys. Last revised: 2-11-13, PM.
16

Вам также может понравиться