ilc ·chip implements high·sp,~d madems digit~liy€¦ · the fi,rst àrticle, in the same issue,...

6
By substituting sofJware for logic hardware, a single-chip microcomputer geared to signal processing can performa/l the functions of advanced modems for ordinary phone fines low cost. IlC ·chip implements madems li i I: This article is the second in a t, series on signal processing with alas t number-crunching single-chip microcomputer. The senes began with an interoiew with KevinM cDonough, programmable-products de- sign manager at TI, in the MayS7 ÜlSue (p. 1,2). The fi,rst àrticle, in the same issue, described how to implement a vocoder with the ichip: (p. 129). Using a single-chip signal processor . as the basic building block, a low-cost, high-speed modem can be programmed to operate over unconditioned lines via commercial switched telephone ·networks. Economi- cal performance is possible because,of the resultant modem's ability not only to adaptively equaiize dial- up lines for high-speed transmission, but also to achieve superior bit-error ,rates. !,;'; I '11'1 :' i. A complete. modem on a chlp , li '({ I ," ! The TMS320 one-chip can be pro- grammed to produce either a phaseJ or a frequency- modulated synchronous signal and to demodulate it. , AIso, the carrier frequency and. bit, rate can be selected to be compatible with almost any available high-speed (or low-speed) modemj; ': A versatile, high-speed modem. (Fig. 1) permits the implementation of several modulation formate· with varibus speed options from common hardware (the 320) controlled by a stored programo (The. hardware for an externai clock and the training-sequence and preamble generation are noto sho\vn.) For' example, a 320's subroutine-module feature allows calling a frequency-synthesizer routine by different modulator programs. Further- more, a basic filter aIgorithm can be changed simply by altering tapcoefficients from memory, Also, since the modem is not needed until a communications link J. Leland Langston, Member, Teçhnical Staff Texas Instruments Inc. MIS 394, P.O. Box 226015 Dallas. Texas 75265 ; is established, the 320 can provide automatic-dial or dual .. tone multifrequency (DTMF) signals. The digital input bit stream for transmission is often first scrambled to secure the data and then applied to adigital1y implemented PSK osciUator and modulator algorithm whose output goes to a bandpass filter that shapes (and limits) the spectrum of the transmitted signal. An externaI 12-bit digital- to-analog converter, followed by a 3-kHz continuous- time low-pass filter, provides an analog-signal out- put suitabIe for a phone line. Received signals from an analog phone line are first filtered by a 3-kHz antialiasing low-pass filter. Usually, an externaI-hardware automatic-gain-con- troI loop is used, but a digital loop can be im-: pIemented 'if the' analog-to-digital converter that follows the 3-kHz filter has sufficien t dynamic range. The output is, applied to a Hilbert demodulator algorithm (implemented as finite-impulse-response filter, as explained later). Decision determines which of the allowed, or expected, phases is closest to the received version and sends out corresponding data to a descrambler needed) to recover' the bit· pattern originally transmitted. A baud-sync-recovery phase-Iocked loop monitors the bit-train state transitions, using them as 'a reíerence for establishing baud synchronism; as well as the bit-sync clock and other major clock signals from a common externaI oscillatoT source. a slne generator Moreover, all the other associated modem func- tions can be easi1y controlled by a host processor .. For theseancillary communications functions, such as full-duplex operation, echo suppression, 'automat- ic 'equalization, and error co rrection, two or more 320 signal prócessors can be combined, operating in parallel or in a pipelined fashion. . I The 320 digitally implement$ sinusoidal generator that can synthesize :waves with fre- Electronlc Deslgn .. June 1982 109

Upload: others

Post on 20-Jul-2020

4 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: IlC ·chip implements high·sp,~d madems digit~lIy€¦ · The fi,rst àrticle, in the same issue, described how to implement a vocoder with the ichip: (p. 129). Using a single-chip

~(

By substituting sofJware for logic hardware, a single-chip microcomputer geared to signal processing can performa/l the functions of advanced modems for ordinary phone fines ~t low cost.

IlC ·chip implements I·

high·sp,~d madems digit~lIy li i

".~

I:

This article is the second in a t, series on signal processing with alas t number-crunching single-chip microcomputer. The senes began with an interoiew with KevinM cDonough, programmable-products de­sign manager at TI, in the MayS7 ÜlSue (p. 1,2). The fi,rst àrticle, in the same issue, described how to implement a vocoder with the ichip: (p. 129).

Using a single-chip signal processor . as the basic building block, a low-cost, high-speed modem can be programmed to operate over unconditioned lines via commercial switched telephone ·networks. Economi­cal performance is possible because,of the resultant modem's ability not only to adaptively equaiize dial­up lines for high-speed transmission, but also to achieve superior bit-error ,rates. !,;'; I

'11'1 :' i.

A complete. modem on a chlp , l:,~;: li '({ I ~ ," !

The TMS320 one-chip microcomp~te~ can be pro-grammed to produce either a phaseJ or a frequency­modulated synchronous signal and to demodulate it. , AIso, the carrier frequency and. bit, rate can be selected to be compatible with almost any available high-speed (or low-speed) modemj; ':

A versatile, high-speed modem. ~tructure (Fig. 1) permits the implementation of several modulation formate· with varibus speed options from common hardware (the 320) controlled by a stored programo (The. hardware for an externai clock and the training-sequence and preamble generation are noto sho\vn.) For' example, a 320's subroutine-module feature allows calling a frequency-synthesizer routine by different modulator programs. Further­more, a basic filter aIgorithm can be changed simply by altering tapcoefficients from memory, Also, since the modem is not needed until a communications link

J. Leland Langston, Member, Teçhnical Staff Texas Instruments Inc. MIS 394, P.O. Box 226015 Dallas. Texas 75265

;

is established, the 320 can provide automatic-dial or dual .. tone multifrequency (DTMF) signals.

The digital input bit stream for transmission is often first scrambled to secure the data and then applied to adigital1y implemented PSK osciUator and modulator algorithm whose output goes to a bandpass filter that shapes (and limits) the spectrum of the transmitted signal. An externaI 12-bit digital­to-analog converter, followed by a 3-kHz continuous­time low-pass filter, provides an analog-signal out­put suitabIe for a phone line.

Received signals from an analog phone line are first filtered by a 3-kHz antialiasing low-pass filter. Usually, an externaI-hardware automatic-gain-con­troI loop is used, but a digital loop can be im-: pIemented 'if the' analog-to-digital converter that follows the 3-kHz filter has sufficien t dynamic range. The a~d output is, applied to a Hilbert demodulator algorithm (implemented as finite-impulse-response filter, as explained later). Decision ~ogic determines which of the allowed, or expected, phases is closest to the received version and sends out corresponding data to a descrambler (ü needed) to recover' the bit· pattern originally transmitted.

A baud-sync-recovery phase-Iocked loop monitors the bit-train state transitions, using them as 'a reíerence for establishing baud synchronism; as well as the bit-sync clock and other major clock signals from a common externaI oscillatoT source.

Implementl~9 a slne generator

Moreover, all the other associated modem func­tions can be easi1y controlled by a host processor .. For theseancillary communications functions, such as full-duplex operation, echo suppression, 'automat­ic 'equalization, and error co rrection, two or more 320 signal prócessors can be combined, operating in parallel or in a pipelined fashion. . I

The 320 digitally implement$ .~ sinusoidal generator that can synthesize sin~ :waves with fre-

Electronlc Deslgn .. June .2~ 1982 109

Page 2: IlC ·chip implements high·sp,~d madems digit~lIy€¦ · The fi,rst àrticle, in the same issue, described how to implement a vocoder with the ichip: (p. 129). Using a single-chip

flC-implemented modems

qllencies of 0.5 Hz to about 4 kHz in 0.5-Hz steps with just a modest amount of memory and computa­tion time.

Two tables of 64' words each are stored in the 320'~ ROM. The first contains 64 course sine values for angles (in radians) for a single-quadrant range of 11'/2, OI' 90°, as follows: X = O, 11'/128, 211'/128, 311'/128, ... 6311'/128. The second table contains 64 fine sine values, Y, which are used to calculate angles between the course values, as follows: Y = O, 11'/8192, 271'/8192, ... 6311'/8192. Each of these 64-word tables requires a 6-bit address. Accordingly, a 12-bit overall address word must be used to define the sine of an angle completely.

The sine va lue of any angle between zero and 11'/2 can be obtained to 12-bit resolution by solving the equation sin (X + Y) = sin X cos Y + sin Y cos X. Because Y is a small angle, cos Y can be assumed very nearly equal to one without introducing much error. This approximation greatly simplifies the calcu lation and merely increases the quantization noise somewhat, which nevertheless is still abollt 70 dB below the signal level.

The cosine of X is obtained from the same table for sin X by looking up (11'/2) - X, because cos X =

Analog input

sin (11'/2) - X. Since Y is small , sin Y is looked up with just 6 bits in the fine table. Then, the value of sin (O) = sin X + sin Y cos X can be computed for the first quadrant (OS; O S; 11'/2), where O = X + Y.

Uslng ali quadran!s

To extend the range of this procedure to ali four quadrants, an arbitrary angle a must be transformed into a first quadrant angle, O, and the proper sign established. This is done by checking whether a is smaller than 90° OI' 180°. The s ine value, of course, is positive in the first two quadrants and negative in the third and fourth (Fig. 2a). In the third OI' fourth qllandrant, after subtracting 180° from a, the resu lt­ant value of the angle is fed back to establish whether it is now less than 90° (third quadran t) 01'

greater than 90° (fourth quadrant). If the latter, the remainder must be subtracted from 180° to get it into the ROM sine table's range.

Syntheslzlng a frequency

The look-up tablc merely supp lies the val ue of the sine for a given angle. To generate a sine-wave frequency, the angle, a, must be continuously in ­cremented. Then the look-up table output represents

1. Thls generallzed hlgh-speed modem, for both transmlsslon (8) and reception (b), can be particularized Into a varlety of modulatlon formaIs wllh a wide range of speed optlons by merely changing lhe slored program In lhe TMS320 mlcrocomputer's ROM.

110 Elcctronlc Dasl , n • June 24, 1982

I))

I,

t

Page 3: IlC ·chip implements high·sp,~d madems digit~lIy€¦ · The fi,rst àrticle, in the same issue, described how to implement a vocoder with the ichip: (p. 129). Using a single-chip

a digital sine-wave function that oscillateS at a frequency depending on the rate, fa, at which the output process-called sampling-is carried out. . In this overall process, called fr.equencysyntbesis, a is incremented by an equal integral: amount, tjJ, every time a sample (or look-up) is' taken.i The incremen tal angle represents a phase advanc.e~ and the number of such advances per four-quadrant sine­wave cycle with a 12-bit bit resolution look-up table is 4 (212

- 1), or 16,380 steps. Thus, for a sampling frequency of, say, 8.19 kHz, the frequency resolution of the frequency synthesizer is 8190/16,380, or 0.5 Hz. Keeping the sampling frequency constant, an initial angle must be incremented by a cp of2400 steps (52.7473°) at every sampling time to generate a 1200-Hz sine wave (Fig. 2b).

Generatlng an FSK slgnal

By changing the value of cp in Fig. 2b by an amount, ó'cp, added to every sample,an FSK signaI can be generated as follows:

aFSK = ai + (CPn+ó,tjJr)

where ai is an initial value of phase angIe. In this way the frequency corresponding to tPn changes to that corresponding to tPn + ó,tjJr to identify different parts, or bauds, of a data stream; CPc can be multivalued for a multifr.equency-shift system.

By adding an amount, ó'CPP' only to the' first sample of an identifiable data part, just the phase of that part is shifted (its frequency is unaltered),!and a PSK signal is generated. As with frequency-shift keying, ó'CPP can be multivalued for a multiphase-shift system. .

Modifications of the frequency-synthesis 'algo­ri th m can produce a host of functions other then FSK and PSK for a modem, including duaI.;.tone muItifre­q uencies for automatic dialing, linear frequency modulation, amplitude moduIation, and pulsed (tone-burst) signal generation. In addition, like an analog voltage-controlled oscillator, this 320-im­plemented frequency synthesizer can be used as a veo to implement a digital phase-Iocked loop.

A phase-Iocked loop In digitai form

Modem receivers use phase-Iocked loops for carrier tracking and coherent demodulation of an incoming complex signal, ar (Fig. 3). The 320 can be easily programmed to perform the phase-locked function digitally. An FSK signal generator (as previously described) serves as the VCO and phase detection consists simply of taking the difference. ó'a, between the veo's digital output, ao, and the received carrier signal contained in ar, which at this point is assumed also to be in digital formo After processing through a digital loop fUter, ó'a becomes ó,cP for the FSK-

In3rd & 4th quadrant.8= a-18lf ~-~r-----'" ~--r------'

(8)

Inltlal phase angle

Slne-wave output •. fo=0.5n

Frequency selectlon :;: n~

Mln. ~ Increment = (380/18.380) degrees.

Sampllng-rate clock. f.= 8190Hz

:: 0.5-Hz resolutlon

- 4000 Hz (max.) (b)

2. The slne of any angle, a, can be determlned wlth Just a 00-to-900 look-up table and thls algorlthm, (a). I' (1r/2)-a Is taken as the angle, the coslne of a Is determlned. Advanclng a or (n12)-a In successlve Incrementai amounts, rp, generates respectlvely a slne or a coslne wave (b). The algorlthm therefore functlons as a frequency syntheslzer whose frequency output can be determlned by the slze of rp and the clock rate of the algorlthm.

ar

Phase detector

Loopflller . r:-~--:-"""---:----l

a I· k. I

I I I :~>-----.o--o~ : : r' I I k, . I I I L.. _____ ~--:_---J

3. An Important element In many modems Is a phase-Iock loop. As It can for ali the other modem elements, the 320 slgnal-processor mlcrocomputer can provide thls functlon completely dlgltally. Note that the voltage-controlled­osclllator, 100p-fUter, and phase detector componénts-each are Just 320 firmware.

Electronlc Deslgn • June 24. 1982 111

Page 4: IlC ·chip implements high·sp,~d madems digit~lIy€¦ · The fi,rst àrticle, in the same issue, described how to implement a vocoder with the ichip: (p. 129). Using a single-chip

pC-implemented modems

ar in this case for the VCO-algorithm. The output of the VCO represents the input signal's carrier frequency, "o, highl)' filtered of noise and data, but still following any s low variations of the input carder's frequency ar phase. In effect, ao is the ea rri er "extracted" from the input, a,.

The loop filter, a second-order configuration, con­sists of a proportional element defined by a gain multiplier, k" and an integral element defined by coefficients k, and k,. Operati'ng at a 5-MHz clock rate, a 13-instruction sequence that implements the phase detector and filter takes just 2.6 IlS . When these functions are combined with the digital VCO algorithm, thel' form the complete digital phase­locked loop Pl'ogram, which executes in less than 20 IlS per data sample.

Demodulating a carrier

To demodulate a phase-modulated (PSK) carrier, the extracted carrier is sp lit in to in-phase (I) and quadrature (Q) components, ar sin ao and cos "o respectivel)' , bl' a Hilbert transform (see Fig. 2a again). These I and Q signals can then become carrier

references for mixing with either a so-called Costa loop' ar a Hilbert transform 3 method of providing a quadrature signal.

The Hilbert transform (Fig. 4) is the more general method, since it can handle any multilevel phase­shifted signal simply by changing the reference template. AIso, although difficult to implement in analog form, a Hi lbert transform is a relativell' sim pie function for a digital system. The transform primarily adds a 900 phase sh ift to ali Fourier compon~nts of a complex t ime-domain signal. (The transfdrm and also the equali zer are implemented with a finite-impulse-response filter, which is dis-cussed later). .

The quadrature-shifted output, S(t), from the Hilbert ,transform is mixed wi th calTier references I and Q and the unshifted input signals, S(lJ, Then the real and 'imaginary components of the s ignal, R, and Im respectively, are extracted. From these components, the arctangent, ar phase angle, of the s ignal can be determined, and decision logic can then establish the phase of that part of the signal. In addition, if the phase deviates from the modulo of

, I t

, ~~:J:=-,- To declslon' r~giC

..

4. Each of lhe functlons In thls H ilbert-tran sform demodulator Is Implemented by lhe 320 dlgitally. A devlatlon of lhe demodulated 519nal'5 phase 'rom expected (or allowed) phase states is correcled by feedlng error signal da back to lhe phase-Iocked loop (Fig. 2), to which carrier references I and a are synchronlzed.

i t l , ,

I...' ,

I· I I

.'

.' ,

" .. l~

I))

~)

Page 5: IlC ·chip implements high·sp,~d madems digit~lIy€¦ · The fi,rst àrticle, in the same issue, described how to implement a vocoder with the ichip: (p. 129). Using a single-chip

t \

r ,

(

,4,

IlC-implemented modems I I "

the al\owed phase sh ifts-for example, 7r shifts in biphase shift ke)'ing (BPSK) or 7r/2 phase shifts in quadraphase shift kel'ing (QPSK)-then an erro r­phase output, L).a, can be used to elose the loop (such as bl' correction through the phase-locked loop sl'stem of Fig, 2 and then via I and Q),

tions . Accordingl)', the FIR structure is more com­monl)' used in modems to implement low-pass, high­pass, bandpass, band-rejection, equalizer, and Hilbert transform networks.

An n-poin t FIR configuration, as shown in Fig. 5, can be made to behave like an)' one of these network tl'pes, and it will exh ibit linear phase characteristics and sharp frequency transitions merely by changing the number, value, and polarity of the coefficien ts, h(x), that are multiplied by signals tapped from the corresponding delal's Z-'. With the 320, a 50- tap FIR a lgorithm can be executed in about 20 IJS.

The arctangent can be determined with a combina­tion of tab le look-ups and linear piecewise computa­tions similar to that for generating the sine and cosine values . A table space of just 24 \'~ords provides an angle aecuracl' within 0.20

, which is suffieient for demodúlation. The algorthim requires one division and three table look-ups and takes about 20 IJS onl)' onee per baud in terva!.

Implementlng digitai fllter. and equallzers

The two basic tl'pes of digital f ilters commonll' used-the infinite-i mpulse-response (!IR) and the finite-impulse-response (F IR) filter-both can be implemented easill' with the 320. However, the !IR filter tends to display poor phase characteristics, which is highly undesirable in digital communica-

When this FIR digital filter is used to compensate for varl'ing differential phase delays and amplitude errors that mal' be in troduced by a longcommunica­tion channel, it is called an adaptive equalizer (Fig. 6) . In that case, the tap coefficients can be con­tinuous ll' adapted bl' multipll'ing the signal at each tap bl' an error s ignal, l'(e); adding this output to fixed nominal coefficients; and maintaining a run ­ning sum (integration) of the result. The filtered output s ignal, l'(n), is compared with a set of expected

. ~-

,I

~~---------------------------------,

The extensive world-wide tele­I i phone system, built over the years : 1 at enormaus expense, is over­;'. f;\;'helmingly analog. That is how jJ.~ the system was conceived and de­-/ '~~Ioped historieally. To employ

I' ~ this analog-orientcd network for ~' present-day digital communica-

J ti6ns between computers and data " terminais, and even for digitaUy

proeessed speeeh (sueh as from :vocoders and encrypters), requires

" ~6nverting the digital signals into r analog form and then baek into digital form with a device known 'as a modem . (The term umodem" comes from the device's acting as

,,1~a. modulator at the sending e?d l)l,.and as demodulator at the recelV­. ing end.)

.:.. ~Modems can be synchronous ar t asynchronous and can employ

'l';;Cveral methods for modulating H I:r-h" analog carrier, including

frequ eney-shift keying (FSK), phase-shift keying (PSK), ampli--.

tude modulation (AM), and various combinations of these methods. Low-speed modems (" 300 bits/s) allached to lelephone !ines have been largely stan­dardized as asynehronous FSK de­vices for simultaneous transmis­sion and reeeption (full-duplex modelo

At higher speeds on telephone lines, however, modems are most often synchronous and generally Iimi ted lo a half-dllplex mode­transmission or l'cception on ly­switching from one direction to the other as needed. In addition, at these higher data-transmission rates the modulalion method is not standardized, and that creates a compatibility problem for users whose equipment must commu ni­cale with many different systems (facsimile machines, for example). Thc versatility achievable when modems are implemented digital­Iy ean help solve this problem.

Page 6: IlC ·chip implements high·sp,~d madems digit~lIy€¦ · The fi,rst àrticle, in the same issue, described how to implement a vocoder with the ichip: (p. 129). Using a single-chip

• ..

... ""1

,uC-implemented modems

5. Thls flnlte-Impulse-response n-polnt fllter conflguration can be programmed to provlde the characteristlcs of almost any type of fUter ,a modem might need.

Equallzed t---I-----....;--....... aulpul. y(n)

Errar sl9nal

6. The FIR fllter can even be made to adJust automatlcally to varylng communlcatlonschannel condltions, a process called adaptlve equallzatlon.

, . "; ,'}T!;

Scram.,od~ data . . • : ;' J " ::, ,';,;' • "L, /, '.. X~

. :

Da~ (l'i + " ,:' ,; i 1'" 1;1.,;,'::: x' .

7. A pseudorandom word g~nerator implemented wlth the 320's software, whlch Is the equlvalent of thls hardware shlft­register clrcult, can encrypt digital data before It enters the modem and decrypt it at the receiver modem's output.

... -te. "' __ oIII ___ t_ 1"\ __ 1 ___ 1", __ "A 1001]

values to determine what value was most likely transmitted. S'ubtracting the expected signal from the aetual signal provides y(e).

A fundamental assumption with adaptive filters is that the channel characteristics change slowly with respect to' the signaling rate. Accordingly, the computer tap coefficients minimize the mean square error between', the expected and the received signal over several baud intervals. The nominal weighting coefficients applied to 'each tap serve to prevent transients and fast changes from disrupting the equalizer too iseverely. ,

Each tap can execute a complete algorithm in 1.2 #LS, and' therefore processing for an 18-tap equalizer filter is completed in about '25 #LS (with coefficient sealing implemen ted ·by a shift operation). Although the complete calculations are performed only once per, baud interval, ,the signal must be shifted through alI the Z-1 delays every time a sample is taken. '

Modems :'Include scramblers

, .In addition to the basic modem functions, the 320 can also provide data serambling. A data s,crambler consists of ad psuedorandom sequence generator whose output! is used to "randomize" the data bit stream and to~ preventcertain data sequences from appearing.. A. deserambler employs a similar se­quence generator. Synchronized to the scrambled transmitted data stream, the descrambler puts out a signal that is then combined with the received stream to accurately reeover the original bit stream.

The CCI'rrí V.27 scrambler (shown in simplified form in Fig. 7), which generates a pseudorandom code with hardware shift r~gisters aceording to the polynominal X'+X'+l, is an example of such a system. However, the 320 earries out the function in a diff~ren(way with 17 software instructions, which are exeeuted in 3.8 #LS. This approaeh stores the sequence in RAM and uses a tap mask to implement the equivalent shift-register function.O

i,. References . " j' ,

1. R. Rabiner and B. Gold, TheoTII mui Application of Digital . Sillmtl Processing, Prentice-Hall, Englewoo(l CUCCs, N.J., 1975.

2. Floyd M. Gardner, Phaselock Techniques, John Wiley & Sons, New York, N.Y., 1979.

3. A.V. Oppenheim and R.W~ Schafer, Digital Signal Proces8-in". Prentice-Hall,Englewood CliCfs, N.J., 1975.

4. HarrY·,~-F.; Lam, Analog and Digital Filters: Desigtl and RealizntUm,i\Prentice-Hall, Englewood CUCCs, N.J., 1979.

'I~~ li i ,(~.. I

How useful? Immediate design application Within the next year Not applicable

Circle 547

, 548 549

., i /