+ = dt t y t x r
xy
) ( ) ( ) (
Equation 1
#n this equation9
x3t4 and y3t4 are the functions being correlated
r
xy
34 is the cross-correlation function
is the time shift under consideration
5ne of the properties of this process is that when the two
wa-eforms match, you get a peak in the function at the time shift
where they match. Correlating a totally random signal against itself
produces :ero, except at the point where the time shift is :ero.
2 R!" will only correlate well against itself when it8s time shifted
by an integer multiple of the sequence length.
0hen the R!" is fed into a linear, time-in-ariant system 3such as
an RC flter4, the output of the circuit consists of a number of
age ( of $%
copies of the signal all at di?erent amplitudes and time shifts. #f
you could separate out all of the di?erent time shifts and measure
their amplitudes, you could draw the impulse response 3amplitude
against time shift4.
<owe-er, it is possible to use correlation to separate out all the
di?erent signals. #f you correlate the output signal against the
original R!", o-er a wide range of time shifts, the correlation
function will eliminate all of the signals except the component at
the current time shift. The output will then be proportional to the
amplitude of the component at that particular time shift.
The upshot of all this is that cross-correlating the output of a linear
system against a R!" fed into its input will generate the impulse
response. 2n ob-ious technique to doing this would be using a
computer with dual-channel analogue-to-digital con-erters9 the
original R!" is fed into one channel, and the system output is fed
into the other. The computer can then sample the output o-er a
defned time-period 3ideally one shorter than the R!" length4 and
perform the correlation by shifting the original R!" with respect
to the output signal.
There is another method, howe-er, and this was the one that we
used in the lab.
age A of $%
4 etails of demonstration system
2 block diagram of the lab system is shown in fgure &9
Clock
generator
Continuous
PRBS
generator
Interrupted
PRBS
generator
Clock
interrupt
logic
Sample
& Reset
signal logic
Correlator
!odule
CRO
S"stem
under
in#estigation
$RC %ilter&
S'!P() & R)S)*
!
a
i
n
C
l
o
c
k
PRBS
Interrupted
PRBS
Interrupted
Clock
Ripple
Carr" Out
S"stem
response
Figure 3
,or our lab experiment, we built a straightforward %-bit R!"
generator 3this generates a $+-bit long sequence4 using four stages
of a A%B"$(% *-bit shift register and a A%B"*( quad two-input 75R
gate. This is shown in fgure %, including the extra anti-lockup
circuitry9
=1
Clock
Output
Direction of shift
1 1
D Q D Q D Q D Q
Figure 4
The correlation method used was an interesting piece of analogue
computing. 2 third-party correlator module 3containing an
analogue multiplier and integrator4 was used to carry out the
correlation calculation and send a signal to an oscilloscope for
age * of $%
display. The correlator required a number of logic signals in order
to carry out the calculation. #n order to do the time shifting, a
modifed R!" is gi-en to the correlator as a reference. This
sequence has a one-bit delay introduced at the end of each
sequence, so it shifts with respect to the main R!" 3which is being
fed through the RC flter4 and is only in-phase e-ery $( cycles.
There8s also a "2CB@ signal that must be generated, at the end of
each R!" cycle, which the correlator to output to the scope as its
fnished its integration. #n the clock cycle following "2CB@, a
R@"@T signal is sent to discharge the integration capacitor ready
for the next calculation.
To generate the delayed R!", we built a second R!" generator
3as fgure &4 and used a %-bit counter #C 3A%B"$(&4 to count the
cycles. This chip has a Ripple Carry 5ut line 3RC54 which goes high
when the count rolls around from $$$$ to >>>>. This signal is used
to inhibit the clock on the generator using an 5R gate, as shown in
fgure +.
+,(S1-.
1
RCO
Clock in
Interrupted clock to
PRBS generator
Figure 5
This circuit generates an interrupted clock signal, which holds high
e-ery $( cycles, as shown by the timing diagram in fgure (.
1/ 1, 1. 10 1 1 0 .
!ain clock
Interrupted clock
Count
Figure 6
The R!" generator8s output is thus inhibited at the end of e-ery
sequence, allowing it to fall behind the uninhibited generator by
one bit for e-ery sequence.
age = of $%
The control signals 3"2CB@ and R@"@T4 for the correlator module
need a timing diagram looking like fgure A.
1/ 1, 1. 10 1 1 0 .
!ain clock
Count
S'!P()
R)S)*
Figure 7
To achie-e this, a single )-type was used to create a one-clock
delayed copy of the RC5 signal from the counter. This was then
used to dri-e the clock-inhibitor 3fgure %4 and formed the R@"@T
signal. The original RC5 signal became the "2CB@ signal.
This logic is shown in fgure *, together with the clock-inhibitor
logic.
1
RCO
Clock in
Interrupted clock to
PRBS generator
+,(S1-.
Q D
S'!P()
R)S)*
Figure 8
age $> of $%
The circuit tested was an RC flter circuit, with R being &k= and C
being A(n,. The theoretical impulse response of this circuit is
shown in fgure =.
Theoretical impulse response of RC filter
1
011
,11
-11
211
1111
1011
1,11
111)311 111)41, 011)41, .11)41, ,11)41, /11)41, -11)41, +11)41,
Time
A
m
p
l
i
t
u
d
e
The result seen on the oscilloscope as a result of using this system
looked like fgure $>.
*ime
'mplitude
Figure 10
This is quite a good approximation, although it8s quite steppy. 0ith
a faster clock speed and a longer R!" a better approximation
would be achie-ed.
age $$ of $%
Figure 9
! Conclusions
5.1 Discussion and recommendations
The experiments carried out demonstrate the feasibility of
measuring impulse responses using pseudo-random binary
sequences and cross-correlation. The method used in the lab is
inexpensi-e and relati-ely straightforward, although the
requirement for an oscilloscope to display the output trace may
outweigh the cost benefts of doing the computing in analogue
hardware. 2n alternati-e method would be to incorporate a
computer of some kind into the system, either a C or a fast
microprocessor system. The correlation could then be done in
software, and the only hardware requirement is the R!"
generator. #ndeed, by using a high-speed embedded microprocessor
system, one could build a portable instrument capable of displaying
the impulse response on a small BC) screen, and then sa-ing the
results back to a C for later perusal.
The resolution of the system should be addressed, using a longer
R!" and a higher clock speed. #t would ob-iously be necessary to
calibrate the instrument, so that the amplitudes and times may be
read o? accurately by the user.
age $' of $%
5.2 Full circuit diagram of PRBS generators and control logic
1
RCO
Clock in
Interrupted clock to
PRBS generator
+,(S1-.
Q D
S'!P() R)S)*
=1
1 1
D Q D Q D Q D Q
=1
1 1
D Q D Q D Q D Q
PRBS to s"stem
under in#stigation
Interrupted PRBS to
correlator
Control lines to correlator
age $& of $%
" Bi#lio$ra%hy
Tew, 2. #. 3'>>>4. )igital "equences, Correlation and Binear
"ystems, Dni-ersity of 6ork.
<orowit:, . E <ill, 0. 3$=*=4. The 2rt of @lectronics, Cambridge
Dni-ersity ress, '
nd
edition.
age $% of $%