Yr2 Xmas Lab

download Yr2 Xmas Lab

of 14

Transcript of Yr2 Xmas Lab

  • 8/12/2019 Yr2 Xmas Lab

    1/14

  • 8/12/2019 Yr2 Xmas Lab

    2/14

    Pseudo-Random BinarySequences and impulse

    responses

    Technical ReportMichael Prior-Jones

    Contents$ #ntroduction................................................................................&

    $.$ !ackground...........................................................................&$.' Report "tructure...................................................................&

    ' Theory of seudo-Random !inary "equences............................%& Theory of Cross-correlation and system identi cation...............(% )etails of demonstration system.................................................*+ Conclusions...............................................................................$'

    +.$ )iscussion and recommendations......................................$'

    +.' ull circuit diagram of R!" generators and control logic$&( !ibliography..............................................................................$%

    age ' of $%

  • 8/12/2019 Yr2 Xmas Lab

    3/14

    Pseudo-Random BinarySequences and impulse

    responses

    Technical ReportMichael Prior-Jones

    1 Introduction

    1.1 Background The Research and )e elopment department has been carrying outa feasibility study on the process of measuring acoustic impulseresponses using pseudo-random binary sequences. This reportdetails work done to date on this pro ect, together withrecommendations for future product de elopment.

    1.2 Report Structure"ections ' and & deal with the theories of R!" generation andcorrelation. "ection % details a laboratory experiment designed tomeasure the impulse response of an RC lter using these theories."ection + contains some recommendations for future de elopmentsin this pro ect.

    age & of $%

  • 8/12/2019 Yr2 Xmas Lab

    4/14

    2 Theory of Pseudo-Random BinarySequences

    /0hite noise1 is the term gi en to completely randomunpredictable noise, such as the hiss you hear on an untuned radio.#t has the property of ha ing components at e ery frequency. 2pseudo-random binary sequence 3 R!"4 can also ha e thisproperty, but is entirely predictable. 2 R!" is rather like a longrecurring decimal number- it looks random if you examine a shortpiece of the sequence, but it actually repeats itself e ery m bits. 5fcourse, the larger m is, the more random it looks.

    6ou can generate a R!" with a shift register and an 75R gate.Connecting the outputs of two stages of the shift register to the75R gate, and then feeding the result back into the input of theshift register will generate a R!" of some sort. "omecombinations of outputs produce longer R!"s than others- thelongest ones are called m-sequences 3where m means /maximumlength14.

    or a six-stage shift register, you can generate a (&-bit R!" byconnecting outputs + and ( to the 75R gate- as shown in gure $.

    =1

    Clock

    Output

    Direction of shift

    D Q D Q D QD Q D QD Q

    Figure 1

    5b iously, it8s possible to get a longer m-sequence using morestages to the shift register. The formula connecting these is9

    12 = nm

    0here m is the length of the m-sequence and n is the number ofshift register stages.

    age % of $%

  • 8/12/2019 Yr2 Xmas Lab

    5/14

    There is one state 3known as the forbidden state4, which does notform part of the m-sequence. This is the state where all of the shiftregisters contain :ero. #n this situation, the circuit outputs :eroes.This condition can be trapped using some extra logic, shown in there ised circuit of gure '.

    =1

    Clock

    Output

    Direction of shift

    1

    1

    D Q D Q D QD Q D QD Q

    Figure 2

    age + of $%

  • 8/12/2019 Yr2 Xmas Lab

    6/14

    3 Theory of Cross-correlation andsystem identi cation

    The impulse response of a system is a useful description of itsbeha iour- it describes how the systems output aries with time if aunit impulse is fed into it. 2 unit impulse is de ned as being of :erowidth and in nite amplitude, but with unit area. or this reason, aunit impulse is not a practical signal to generate, let alone feed intoa system;5ne could use an approximate unit impulse, but se eral problemswould occur9

    most systems would be o erloaded by such a large signal,and might be damaged

    e en if the system is not damaged, it is unlikely to maintain

    its normal characteristics when dri en with such an abnormalsignal.

  • 8/12/2019 Yr2 Xmas Lab

    7/14

    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 measuretheir amplitudes, you could draw the impulse response 3amplitudeagainst time shift4.

  • 8/12/2019 Yr2 Xmas Lab

    8/14

    4 etails of demonstration system

    2 block diagram of the lab system is shown in gure &9

    Clockgenerator

    ContinuousPRBS

    generator

    InterruptedPRBS

    generator

    Clockinterrupt

    logic

    Sample& Reset

    signal logicCorrelator

    !oduleCRO

    S"stemunder

    in#estigation$RC %ilter

    S'!P() & R)S)*

    ! ai n

    Cl o

    c k

    PRBS

    InterruptedPRBS

    InterruptedClock

    RippleCarr" Out

    S"stemresponse

    Figure 3

    or our lab experiment, we built a straightforward %-bit R!"generator 3this generates a $+-bit long sequence4 using four stagesof a A%B"$(% *-bit shift register and a A%B"*( quad two-input 75Rgate. This is shown in gure %, including the extra anti-lockup

    circuitry9

    =1

    Clock

    Output

    Direction of shift

    11

    D Q D QD Q D Q

    Figure 4

    The correlation method used was an interesting piece of analoguecomputing. 2 third-party correlator module 3containing ananalogue multiplier and integrator4 was used to carry out thecorrelation calculation and send a signal to an oscilloscope for

    age * of $%

  • 8/12/2019 Yr2 Xmas Lab

    9/14

    display. The correlator required a number of logic signals in orderto carry out the calculation. #n order to do the time shifting, amodi ed R!" is gi en to the correlator as a reference. Thissequence has a one-bit delay introduced at the end of eachsequence, so it shifts with respect to the main R!" 3which is beingfed through the RC lter4 and is only in-phase e ery $( cycles.There8s also a "2 B@ signal that must be generated, at the end of each R!" cycle, which the correlator to output to the scope as its

    nished its integration. #n the clock cycle following "2 B@, aR@"@T signal is sent to discharge the integration capacitor readyfor the next calculation.

    To generate the delayed R!", we built a second R!" generator3as gure &4 and used a %-bit counter #C 3A%B"$(&4 to count thecycles. This chip has a Ripple Carry 5ut line 3RC54 which goes highwhen the count rolls around from $$$$ to >>>>. This signal is usedto inhibit the clock on the generator using an 5R gate, as shown in

    gure +.

    +,(S1-.

    1

    RCO

    Clock in

    Interrupted clock toPRBS generator

    Figure 5This circuit generates an interrupted clock signal, which holds highe ery $( cycles, as shown by the timing diagram in gure (.

    1/1,1.10 1 0 .

    !ain clock

    Interrupted clock

    Count

    Figure 6

    The R!" generator8s output is thus inhibited at the end of e erysequence, allowing it to fall behind the uninhibited generator byone bit for e ery sequence.

    age = of $%

  • 8/12/2019 Yr2 Xmas Lab

    10/14

    The control signals 3"2 B@ and R@"@T4 for the correlator moduleneed a timing diagram looking like gure A.

    1/1,1.10 1 0 .

    !ain clock

    Count

    S'!P()

    R)S)*

    Figure 7

    To achie e this, a single )-type was used to create a one-clockdelayed copy of the RC5 signal from the counter. This was then

    used to dri e the clock-inhibitor 3 gure %4 and formed the R@"@Tsignal. The original RC5 signal became the "2 B@ signal.This logic is shown in gure *, together with the clock-inhibitorlogic.

    1

    RCO

    Clock in

    Interrupted clock to

    PRBS generator

    +,(S1-. QD

    S'!P()

    R)S)*

    Figure 8

    age $> of $%

  • 8/12/2019 Yr2 Xmas Lab

    11/14

    The circuit tested was an RC lter circuit, with R being &k= and Cbeing A(n . The theoretical impulse response of this circuit isshown in gure =.

    Theoretical impulse res ponse of RC filter

    0

    ,

    -

    2

    1

    10

    1,

    )3 1 )4 , 0 )4 , . )4 , , )4 , / )4 , - )4 , + )4 ,

    Time

    A m p l i t u d e

    The result seen on the oscilloscope as a result of using this systemlooked like gure $>.

    *ime

    'mplitude

    Figure 10

    This is quite a good approximation, although it8s quite steppy. 0itha faster clock speed and a longer R!" a better approximationwould be achie ed.

    age $$ of $%

    Figure 9

  • 8/12/2019 Yr2 Xmas Lab

    12/14

    ! Conclusions

    5.1 Discussion and recommendations

    The experiments carried out demonstrate the feasibility ofmeasuring impulse responses using pseudo-random binarysequences and cross-correlation. The method used in the lab isinexpensi e and relati ely straightforward, although therequirement for an oscilloscope to display the output trace mayoutweigh the cost bene ts of doing the computing in analoguehardware. 2n alternati e method would be to incorporate acomputer of some kind into the system, either a C or a fastmicroprocessor system. The correlation could then be done insoftware, 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 displayingthe impulse response on a small BC) screen, and then sa ing theresults 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 tocalibrate the instrument, so that the amplitudes and times may beread o? accurately by the user.

    age $' of $%

  • 8/12/2019 Yr2 Xmas Lab

    13/14

    5.2 Full circuit diagram of PRBS generators and control logic

    1

    RCO

    Clock in

    Interrupted clock toPRBS generator

    +,(S1-. QD

    S'!P() R)S)*

    =1

    11

    D Q D QD Q D Q

    =1

    11

    D Q D QD Q D Q

    PRBS to s"stemunder in#stigation

    Interrupted PRBS to

    correlator

    Control lines to correlator

    age $& of $%

  • 8/12/2019 Yr2 Xmas Lab

    14/14

    " Bi#lio$ra%hyTew, 2. #. 3'>>>4. )igital "equences, Correlation and Binear"ystems, Dni ersity of 6ork.