A Guide. Communications Library

A Guide To the Communications Library Comm Library ® SystemView by ELANIX® Copyright © 1994-2005, Eagleware Corporation All rights reserved. Eagl...
Author: Belinda Shields
9 downloads 0 Views 2MB Size
A Guide To the

Communications Library

Comm Library

®

SystemView by ELANIX® Copyright © 1994-2005, Eagleware Corporation All rights reserved. Eagleware-Elanix Corporation 3585 Engineering Drive, Suite 150 Norcross, GA 30092 USA Phone: +1 (678) 291-0995, Fax: +1 (678) 291-0971 Support e-mail: [email protected] Web: www.eagleware.com Unpublished work. All rights reserved under the U.S. Copyright Act. Restricted Rights Apply. This document may not, in whole or in part, be copied, photocopied, reproduced, translated, or reduced to any electronic medium or machine-readable form without the prior written consent of Eagleware Corporation. This document and the associated software are proprietary to Eagleware Corporation. SystemView by ELANIX, and ELANIX are registered trademarks of Eagleware Corporation. MetaSystem is a trademark of Eagleware Corporation. Windows is a trademark of Microsoft Corporation. Other trademarks or registered trademarks used in this document are the property of their respective owners.

Document Number SVU-COMM0902 Printed in the United States of America.

2 SystemView Communications Library

Tokens Listed by Group Channel Models Abbrev: Token Name: FadeChnl ............Fade........................ .................................................................................... 55 Jakes Chn............Jakes Mobile Channel ................................................................................. 77 Mpth Chn............Multipath Channel . .................................................................................... 81 NBI .....................Narrow Band Interferer............................................................................... 83 Rice Chn .............Rice Fading Channel................................................................................. 124 Rmlr Chn ............Rummler Fading Channel ......................................................................... 126

Demodulators Abbrev: Token Name: Costas .................Costas Loop ........... .................................................................................... 40 FSK Dmod..........Noncoherent MFSK Demodulator .............................................................. 86 OFDMDmod.......Orthogonal Frequency Division Demodulator (OFDM)............................. 93 PLL.....................Phase Lock Loop ... .................................................................................... 95 PPD.....................Pulse Position Demodulator...................................................................... 101 PSK Dmod..........PSK Demodulator .. .................................................................................. 104 PWD ...................Pulse Width Demodulator......................................................................... 107 QAMDet.............Quadrature Amplitude Modulation Detector ............................................ 113 TDDmux.............Time Division DeMultiplexor................................................................... 129

Encoders/Decoders Abbrev: Token Name: BER ....................Bit Error Rate (BER) Counter..................................................................... 10 Bit->Sym ............Bit to Symbol Converter ............................................................................. 13 Blk Coder ...........Block Error Correcting Coder..................................................................... 18 Blk dCode...........Block Error Correcting Decoder ................................................................. 22 Cnv Coder...........Convolutional Error Correcting Coder ....................................................... 30 Cnv dCode..........Convolutional Error Correcting Decoder.................................................... 32 DPunct ................DePuncture............. .................................................................................... 46 Gray Code...........Gray Encoder/Decoder................................................................................ 66 Punct...................Puncture ................. .................................................................................. 110 Sym->Bit ............Symbol to Bit ......... .................................................................................. 128 WalDec...............Walsh Decoder (Fast) ............................................................................... 132 WalEnc ...............Walsh Encoder....... .................................................................................. 133

3 SystemView Communications Library

Comm Library

Table of Contents

Filters Abbrev: Token Name: Equalizer.............Constant Modulus Algorithm (CMA) Equalizer......................................... 27 GoldCode............Gold Code Generator .................................................................................. 63 Int-Dmp ..............Integrate and Dump Filter ........................................................................... 68 InvSinc................Inverse Sinc Function.................................................................................. 73 WalGen...............Walsh Function Generator ........................................................................ 135

Modulators Abbrev: Token Name: DSB-AM.............Double Sideband AM Modulation .............................................................. 51 FCPT...................Frequency Controlled Pulse Train .............................................................. 60 FMPT..................Frequency Modulated Pulse Train .............................................................. 61 MFSK .................M-ary Frequency Modulation ..................................................................... 79 OFDMMod .........Orthogonal Frequency Division Modulator ................................................ 90 PPM ....................Pulse Position Modulator .......................................................................... 100 PWM...................Pulse Width Modulator ............................................................................. 109 Q Mod.................Quadrature Modulation ............................................................................. 122 TDMux ...............Time Division Multiplexor ....................................................................... 131

Processors Abbrev: Token Name: Bit Sync ..............Bit Synchronizer .... .................................................................................... 15 Compand.............Compander ............. .................................................................................... 24 cnvl Interleave ....Convolutional Interleaver ........................................................................... 37 DeIntrlv...............IEEE Standard 802.11a DeInterleaver ........................................................ 46 DeCompand ........Inverse Compander .................................................................................... 43 Divide N .............Divide by N............ .................................................................................... 48 EVM ...................Error Vector Magnitude .............................................................................. 52 Intrlv ...................IEEE Standard 802.11a Interleaver............................................................. 71 Interleave ............Interleaver .............. .................................................................................... 71 IQ Mixer .............I-Q Downconverter .................................................................................... 75 NCO....................Numerically Controlled Oscillator .............................................................. 88 PN Gen ...............PN Generator ......... .................................................................................... 98 P Shape ...............Pulse Shape ............ .................................................................................. 102 QAMMap............Quadrature Amplitude Modulation Mapper.............................................. 117 QAMDmap .........Quadrature Amplitude Modulation DeMapper ......................................... 120

Appendices Appendix A: Using SystemView to Generate Bit Error Rate (BER) Curves ....................... 139 Appendix B: The Rummler Three-Path Fade Model............................................................ 148 Appendix C: Independent Fading Channel Models (Rayleigh and Rician).......................... 151

4 SystemView Communications Library

Abbrev: Group Token Name: BER ....................Encode/Decode ......Bit Error Rate (BER) Counter .................................... 11 Bit->Sym ............Encode/Decode ......Bit to Symbol Converter ............................................. 13 Bit Sync ..............Processors ..............Bit Synchronizer ......................................................... 15 Blk Coder ...........Encode/Decode ......Block Error Correcting Coder..................................... 18 Blk dCode...........Encode/Decode ......Block Error Correcting Decoder................................. 22 Compand ............Processors ..............Compander.................................................................. 24 Cnv Coder...........Encode/Decode ......Convolutional Error Correcting Coder ....................... 30 Cnv dCode..........Encode/Decode ......Convolutional Error Correcting Decoder ................... 32 Cnvl Interleave ...Filters .....................Convolutional Interleaver ........................................... 37 Costas .................Demodulators.........Costas Loop ................................................................ 40 DeCompand........Processors ..............Inverse Compander ..................................................... 43 DeIntrlv ..............Filters .....................IEEE Standard 802.11a Deinterleaver ........................ 46 DPunct ................Encode/Decode ......DePuncture ................................................................. 46 Divide N .............Processors ..............Divide by N................................................................. 48 DSB-AM ............Modulators .............Double Sideband AM Modulation.............................. 51 Equalizer.............Filters .....................Constant Modulus Algorithm (CMA) Equalizer ........ 27 EVM ...................Processors ..............Error Vector Magnitude.............................................. 52 FadeChn..............Channel Models .....Fade ............................................................................ 55 FCPT ..................Modulators .............Frequency Controlled Pulse Train .............................. 60 FMPT..................Modulators .............Frequency Modulated Pulse Train .............................. 61 FSK Dmod..........Demodulators.........Noncoherent MFSK Demodulator.............................. 86 GoldCode............Filters .....................Gold Code Generator .................................................. 63 Gray Code...........Encode/Decode ......Gray Encoder/Decoder ............................................... 66 Int-Dmp ..............Filters .....................Integrate and Dump Filter........................................... 68 Inrtlv ...................Filters .....................IEEE Standard 802.11a Interleaver ............................ 71 Interleave ............Filters .....................Interleaver ................................................................... 71 InvSinc................Filters .....................Inverse Sinc Function ................................................. 73 IQ Mixer .............Processors ..............I-Q Downconverter..................................................... 75 Jakes Chn............Channel Models .....Jakes Mobile Channel................................................. 77 MFSK .................Modulators .............M-ary Frequency Modulation ..................................... 79 Mpth Chn............Channel Models .....Multipath Channel ...................................................... 81

5 SystemView Communications Library

Comm Library

Table of Contents Tokens Listed Alphabetically

Tokens Listed Alphabetically, Continued Abbrev: Group: Token Name: NBI .....................Channel Models .....Narrow Band Interferer............................................... 83 NCO....................Processors ..............Numerically Controlled Oscillator.............................. 88 OFDMMod .........Modulators .............Orthogonal Frequency Division Modulator................ 90 OFDMDmod.......Demodulators ........Orthogonal Frequency Division Demodulator ........... 93 PLL .....................Demodulators .........Phase Lock Loop ........................................................ 95 PN Gen ...............Processors ..............PN Generator .............................................................. 98 PPM ....................Modulators .............Pulse Position Modulator.......................................... 100 PPD.....................Demodulators .........Pulse Position Demodulator...................................... 101 P Shape ...............Processors ..............Pulse Shape ............................................................... 102 PSK Dmod..........Demodulators .........PSK Demodulator ..................................................... 104 PWD ...................Demodulators .........Pulse Width Demodulator......................................... 107 PWM...................Modulators .............Pulse Width Modulator ............................................. 109 Punct ...................Encode/Decode ......Puncture .................................................................... 110 QAMDet .............Demodulators .........Quadrature Amplitude Modulation Detector ............ 113 QAMMap............Processors ..............Quadrature Amplitude Modulation Mapper.............. 117 QAMDmap .........Processors .............Quadrature Amplitude Modulation DeMapper......... 120 Q Mod.................Modulators .............Quadrature Modulation............................................. 122 Rice Chn .............Channel Models .....Rice Fading Channel................................................. 124 Rmlr Chn ............Channel Models .....Rummler Fading Channel ......................................... 126 Sym->Bit ............Encode/Decode ......Symbol to Bit ............................................................ 128 TDDmux.............Demodulators .........Time Division DeMultiplexor................................... 129 TDMux ...............Modulators .............Time Division Multiplexor ....................................... 131 WalDec ...............Encoder/Decoder....Walsh Decoder (Fast) ............................................... 132 WalEnc ...............Encoder/Decoder....Walsh Encoder.......................................................... 133 WalGen...............Filters .....................Walsh Function Generator ........................................ 135

Appendices Appendix A: Using SystemView to Generate Bit Error Rate (BER) Curves ....................... 139 Appendix B: The Rummler Three-Path Fade Model............................................................ 148 Appendix C: Independent Fading Channel Models (Rayleigh and Rician).......................... 151

6 SystemView Communications Library

Comm Library

®

COMMUNICATIONS LIBRARY 1.0 Introduction The SystemView Communications Library contains a comprehensive set of tools to aid in the design and simulation of modern communications systems. For example, a single token contains a complete Costas Loop, and another contains a full PLL demodulator. The library makes it possible to simulate a complete communications system on your PC. The model can include errorcorrecting codes, baseband pulse shaping, modulation, channel models, demodulation, error correction, and finally, data recovery. These features, in concert with SystemView’s ability to dynamically vary parameters over system loops, and with the Communications library BER token, make it possible to produce complete BER curves in a single run. An example of this type of simulation is presented in the rice_tst.svu example. Here we compare, side by side, the BER performance of an AWGN channel, with a channel having AWGN and Rayleigh amplitude fading. Note that the theoretical BER for the fading channel is included and is overlaid with the statistical result. Appendix A provides a general discussion on generating BER curves. 2.0 Features The particulars for each function have been detailed in the body of this manual. They are listed in alphabetical order for convenience. For each token there is a description of its operation, the required user inputs, and an example .svu file that illustrates the use of the function. Additional background information is available in the appendices.

7 SystemView Communications Library

It is only natural to attempt to make your system simulation as accurate as possible. For a communications system, this means that you are likely to choose true data rates and the actual frequency parameters for the appropriate tokens. However, consider the simple problem of simulating a BPSK system with a 1 Kbps data rate modulated on a 10 MHz carrier. The SystemView sample rate must be high enough to prevent aliasing of the carrier. The absolute minimum is a 20 MHz sample rate. The numbers tell us there are 20,000 system samples per information bit. To execute the simulation over many information bits requires a prohibitively long run time. One solution is to remember that any frequency that does not violate bandwidth requirements will produce the same results. In the example cited here, the frequency of 100 KHz will yield the same results as a frequency of 10 MHz. Because of the lower carrier frequency, the SystemView sample rate can be reduced by a factor of 100, and the overall simulation will run 100 times faster. A second solution is to perform what is commonly known as a baseband simulation, in which the carrier has been removed from the analysis. In this case, the system sample rate only needs to be high enough to accommodate the information bandwidth.

8 SystemView Communications Library

Comm Library

®

COMMUNICATIONS LIBRARY

9 SystemView Communications Library

Token Name: Bit Error Rate (BER) Counter Abbreviation: BER Group: Processors Synopsis: Given the received and “truth” bits, this token calculates the bit error rate of a communication channel. See Also: Blk Coder, Blk dCode, Cnv Coder, Cnv dCode Parameters: Parameter No. Trials (bits)

Symbol N0

Threshold (V)

T

Offset (s)

Definition Number of trials used to determine error rate The value that separates a logic one from logic zero Time offset before BER count start

Token Inputs: • The decoded data. • The “truth” data that generated the decoded data Token Outputs: • BER • Cumulative Average • Total Errors

10 SystemView Communications Library

The Offset is used to delay the start of the BER counting. This allows for the group delay through your system due to filters, error correcting coders, synchronization loops, etc. The BER starts counting at the Offset time, and produces its first output after the specified number of trials from that point. Somewhere in your system you will have a source generating the original bit stream at a data rate of R bits/sec. Since the BER token expects one bit per input sample, you may need to use a Sampler token (non-interpolating) with a sample rate equal to the data source at rate R. This results in a data stream with one sample per data bit. Because of group delays in your simulation due to filters, encoders, etc., the output data can be shifted in time from the original truth data. The two bit streams must be aligned in time for the token to work properly. This time alignment must be in both data rate, and in phase. For example if a one Bps data stream is encoded via a rate ½ convolutional code, the final decoded data can be at time ticks; .5, 1.5, 2.5sec. The truth data from the source token has data tags at; 0, 1, 2sec. The token will not work with this phase offset, and an error message will be issued to that fact at run time. To correct for the phase offset use the Resampler Token set at the data rate (i.e. 1 Hz). This will bring the two time bases into alignment.

11 SystemView Communications Library

Comm Library

Discussion: The BER token inputs must be one sample per data bit. That is, each sample into the BER token is an individual bit. For each data bit the BER token compares the truth and decoded data with respect to the specified threshold. If the decode and truth are on opposite sides of the threshold, an error is declared. The token counts the number of errors Ne over the number of trials No, and outputs a value equal to the number of errors divided by the number of trials (Ne/No). This process continues on a block-by-block (bit by bit) basis throughout the simulation. For BER calculations N0 is generally set to 1. However if a frame or word error rate is of interest, set N0 to the desired block size.

To correct for group delays experienced by the received bits in your system (e.g., due to filters, encoders, decoders, etc.), the “truth” bits must be delayed. Use the Sample Delay token in the "truth" bit path to compensate for the time offset. With the sample delay set to 0, use the Sink Calculator, cross correlate the Resample output with the “truth” bit stream. The correlation peak will now be an exact integer number of samples. To obtain this number, right mouse click in the plot area and choose ‘statistics’. In the lower left hand side of the statistics form check the box. The information will give the position of the largest output (correlation peak) in units of delay ticks. Use this value as the delay parameter (in samples) for the Sample Delay token. Connect the “truth” bit stream to the Sample Delay token and then to the BER token. See Appendix A for more details on how to generate BER curves. Example: See example file rice_tst.svu. In this example, the BER token is used to compare the performance of a fading channel with a non-fading channel. This example also shows SystemView’s ability to run alternate architectures side-by-side to compare performance. See also example files blk_tst.svu, golay.svu, and cnvl.svu

12 SystemView Communications Library

Synopsis: This token converts groups of M-binary bits into one of 2M symbols. See Also: Symbol -> Bit Parameters: Parameter Bit Order

Symbol

Bits/Symbol Threshold (V)

M T

Definition Selects whether the first bit in the conversion is the LSB or the MSB The number of bits per symbol A bit is a one (1), if its amplitude is equal to or greater than the threshold, and a zero (0), if less

Token Inputs: • The binary bit stream to be converted into symbols Token Outputs: • The M-ary level symbols Discussion: A symbol is defined to be a number derived from a group of bits. (e.g. a frequency, phase, amplitude or amplitude and phase combination). Familiar sets of symbols are the points in a QAM or PSK constellation.

13 SystemView Communications Library

Comm Library

Token Name: Bit to Symbol Converter Abbreviation: Bit->Sym Group: Encode/Decode

This token assumes that there is one data bit per token-input sample. The token output, produced after each group of M-input bits, is the symbol at one sample per symbol. Thus, the token changes the input sample rate from R samples/sec to an output rate of R / M samples/sec. The output symbol levels are positive integers ranging from zero to 2 M − 1 .

For example, the data stream 110, 001, 101 converts (for M=3) into symbols (MSB first) 6, 1, and 5. This token has several applications: •

It can be used for conversion of binary data to symbols for use in an M-ary communications link. For example, if M = 3 and we multiply the encoded symbols (0,7) by π / 4 , the result is the proper phases for an 8PSK modulation system.



It provides an input to the Reed Solomon encoder token. The Reed Solomon encoder is configured to use the output of the token directly as its input.



It can be used with QAM modulation. By shifting the output of the Bit To Symbol token by the constant offset = − 2 M − 1 / 2

(

)

(you can use the Polynomial token in the Function library with a 0 = offset , a1 = 1 ) you will produce symbols with zero mean. Example: See example file btsm_tst.svu. This example takes a binary data stream and converts it into symbols using the Bit to Symbol token. It then recovers the data stream by using the Symbol to Bit token.

See also the example file qam_tst.svu. In this example we use the token to convert the binary data streams into symbols for use in the QAM modulator.

14 SystemView Communications Library

Synopsis: This token implements an early/late gate-type baseband bit synchronizer. Parameters: Parameter Nonlinearity

Bit Rate (Hz) MF Integ Time (sec) Delay (sec) Loop Gain Filter Constant

Symbol Definition Choose between absolute value or squarelaw nonlinearity R The nominal bit rate of the bipolar bit stream T1 The integration time of the bit-matched filter T2 The time separation between the early and late gate samples µ The gain parameter of the tracking loop a The loop filter constant 1 + a / s

Token Inputs: • The baseband data waveform that the synchronizer is to track Token Outputs: • A sampling clock with one sample per bit that is locked in phase to the input signal



The loop error signal

15 SystemView Communications Library

Comm Library

Token Name: Bit Synchronizer Abbreviation: Bit Sync Group: Processors

Discussion: This token acts as a bit synchronizer for a baseband waveform. A functional block diagram is shown in figure 1a, and the equivalent SystemView block diagram is shown in figure 1b. The matched filter, token 7 (having parameter T1), the nonlinearity (token 2), and the early/late delay control (token 0 with parameter T2) forms a discrimination curve. Adjusting T1 (token 7), and T2 (token 0), changes the shape of the curve. The Frequency Modulated Pulse Train (FMPT) token, samples this curve at a nominal rate of once per bit time. These samples are processed by the loop filter and fed back to the FMPT token as an error signal that adjusts the sample rate accordingly. When the sampler is aligned with the zero crossing of the discrimination curve, no further error occurs and the clock is locked to the incoming signal.

The initial parameters for this token may be computed as follows. Using R as the data rate of the input signal, the following values are a good starting point for proper loop operation: Matched filter integration time: T1 = 1/R Delay: T2 = 1/R Loop filter constant: a = 0 (if the received data is also R) Loop gain: µ = 0.5

Figure 1a. Bit Sync functional block diagram

16 SystemView Communications Library

Comm Library

Figure 1b. Bit Sync token equivalent SystemView block diagram

References: (1) Proakis, J. G., Digital Communications, (New York, McGraw Hill, 1989).

17 SystemView Communications Library

Token Name: Block Error Correcting Coder Abbreviation: Blk Coder Group: Encode/Decode Synopsis: This token performs block error correction encoding. See Also: Cnv Coder, Blk dCode, Cnv dCode Parameters: Parameter Code Type

Code Length (bits/symbols) Info Bits (bits/symbols) Error Correct (bits/symbols) Threshold (V), or No. Symbol Levels Time Offset (sec) Pad Zeros

Symbol Definition The BCH, Reed-Solomon, or Golay block code type n The length of the encoded message block k The number of information bits/symbols used to encode the transmitted n-bit message t The number of bits/symbols the code is capable of correcting T The value that separates a logic one from a logic zero for binary, or the number of symbol levels for non-binary The time marker indicating the first valid information bit/symbol k0 For Reed-Solomon code, the number of zeros used to shorten the code

Token Inputs: • The information bit stream at one sample per bit for the BCH and Golay codes • The information symbol stream at one sample per symbol for RS code

18 SystemView Communications Library

Discussion: This token implements a complete block error correcting coder. The code types supported are as follows:

BCH Codes: The Bose, Chaudhuri, and Hocquenghem (BCH) codes form a large class of powerful random error-correcting cyclic codes. A subclass of the binary BCH codes is the primitive BCH codes. The primitive BCH codes are the most important subclass from the standpoint of both theory and implementation. The decoding algorithm employed is Berlekamp’s iterative algorithm for finding the error location polynomial. For details of this algorithm see references to Berlekamp (1) and Lin (2). The Reed-Solomon codes are the most important subclass of non-binary BCH codes. Description of the Codes: For any positive integers m ( m ≥ 3 ) and t ( t < 2 m − 1 ), there exists a binary BCH code with the following parameters: • Block length: n = 2 m − 1



Number of parity-check digits: n − k ≤ m ⋅ t



Minimum distance: d min ≥ 2t + 1

This code is capable of correcting any combination of t or fewer errors in a block of n = 2 m − 1 digits, and is called a t-error correcting BCH code. Golay Codes: Golay codes are multiple error-correcting codes. Since their discovery by Golay, they have been the subject of study by many code theorists and mathematicians. The (23, 12, 3) Golay code is the most frequently used. The Golay code is a perfect code in that it corrects all triple errors, but no more than three errors. 19 SystemView Communications Library

Comm Library

Token Outputs: • The encoded message at one sample per bit or symbol (the output clock rate is n/k times the input rate)

Reed-Solomon (RS) Codes: In addition to the binary codes, there are non-binary codes. If p is a prime number and q is any power of p, there are codes with code symbols from a qsymbol alphabet. These codes are called q-ary codes. For any choice of positive integers s and t, there exists a q-ary BCH code of length n = q s − 1 , which corrects any combination of t or fewer errors and requires no more than 2st parity-check digits. The Reed-Solomon codes are a special subset for which s = 1. A t-error correcting Reed-Solomon code has the following parameters:



Block length:

n = q–1



Number of parity digits:

n–k = 2t



Minimum distance:

d = 2t + 1

The token input is the binary information at one sample per symbol. Starting from the specified time offset, for every k information symbols, the coder produces the correct block code word of n symbols. The token output is one sample per encoded symbol at a rate equal to (n/k) times the token input rate. For the RS codes, SystemView allows the user to shorten the number of information bits. Consider a nominal [255, 239, 8] RS code. It is possible to send codes of the form [255- k0 , 239- k0 , 8]. This is accomplished by entering the value of k0 into the Pad Zeros parameter window, and k=239- k0 into the Info Bits parameter window. The code rate is now (255- k0 )/(239- k0 ) times the input rate. The encoder pads take k bits and then pads them with k0 zeros. Since the code is systematic, after the encoder the k0 zeros are removed from the data stream.

20 SystemView Communications Library

m

p olynomia l

3

1+ x + x 3

4

1+ x + x 4

5

1+ x 2 + x 5

6

1+ x + x 6

7

1+ x 3 + x 7

8

1+ x 2 + x 3 + x 4 + x 8

9

1+ x 4 + x 9

10

1+ x 3 + x10

Example: See example files blk_tst.svu, golay.svu, and rs_tst.svu. References (1) Sklar, B., Digital Communications Fundamentals and Applications, Prentice Hall 2001, ISBN 0-13-084788-7 (2) Elwyn R. Berlekamp, Algebraic Coding Theory, (New York, McGrawHill, 1968). (3) Shu Lin and Daniel J. Costello, Jr., Error Control Coding, (New Jersey, Prentice-Hall, 1983).

21 SystemView Communications Library

Comm Library

Primitive Polynomials: Primitive polynomials are a fundamental element of the code process. These polynomials are the same ones that generate maximal length sequences used in spread spectrum communications. The polynomials used in the encoder and decoders are,

Token Name: Block Error Correcting Decoder Abbreviation: Blk dCode Group: Encode/Decode Synopsis: This token performs block error correction decoding. See Also: Blk Coder, Cnv Coder, Cnv dCode Parameters: Parameter Block Code Type

Code Length (bits/symbols) Info Bits (bits/symbols) Error Correct (bits/symbols) Threshold (V), or No. Symbol Levels Time Offset

Symbol Definition The BCH, Reed-Solomon, or Golay block code type n The number of bits/symbols in the encoded message k The number of message bits/symbols

t T

The number of error bits/symbols the code is capable of correcting The value that separates a logic one from a logic zero for binary, or the number of symbol levels for non-binary The time marker indicating the first valid encoded bit/symbol in seconds or delay units

Token Inputs: • The encoded block message at one sample per bit for the BCH and Golay codes, and one sample per symbol for the Reed-Solomon codes

22 SystemView Communications Library

Discussion: This token decodes the recovered encoded bits/symbols after a hard decision. The time marker indicates when the first bit/symbol of the first block is valid. From that time on, the token takes n input bits and, using the selected decoding algorithm, recovers the k message bits on a block-by-block basis. The output is one sample per information bit. Therefore, the token output sample rate is k/n times the token input rate. Example: See example file blk_tst.svu, golay.svu, and rs_tst.svu. References (1) Sklar, B., Digital Communications Fundamentals and Applications, Prentice Hall 2001, ISBN 0-13-084788-7

23 SystemView Communications Library

Comm Library

Token Outputs: • The decoded bit stream at one sample per decoded bit for the BCH and Golay codes, and one sample per decoded symbol for the Reed Solomon codes (the output sample rate is k/n times the input sample rate)

Token Name: Compander Abbreviation: Compand Group: Processors Synopsis: The token limits the dynamic range of an analog signal before the A/D process. Parameters: Parameter Compand Type Maximum Input (V)

Symbol Definition Select either µ -law or A-law type

Amax

The maximum value (± Amax) of the token input

Token Inputs: • The signal to be compounded Token Outputs: • The companded signal Discussion: Companders are used to reduce the quantization noise in a PCM signal by effectively matching the distribution of the quantization bin spacing to the distribution of the input-signal amplitude.

The most common application of companders is to adapt high dynamic range signals, usually speech, to the limited dynamic range of an A/D converter. The process, as described, is to pre-distort the signal so that it fits the allowed dynamic range. It should be noted that this is a non-linear process and introduces unwanted frequency components into the spectrum of the desired signal. The inverse, expander function, is also nonlinear and must be treated with the same care. Ideally, the complementary nature of these functions would recover the original signal. The impact of intermediate processes, like filtering, can add other distortions that must be carefully managed.

24 SystemView Communications Library

The mathematical relations of the compander are: µ =255 law: This form of the compander is the standard adopted in the United States.

y (t) = A max sgn[ x (t)]ln(1 + µ x(t) / A max ) / ln(1 + µ ) = A max

x(t) ≤ A max x(t) > A max

A=100 law: This form is the standard in Europe.

y (t) = Ax (t) / [1 + lnA]

, 0 ≤ x(t) < A max / A

A|x(t)| )] A max , A max / A ≤ x(t) ≤ A max [1 + lnA] , x (t) > A max

sgn[x(t)][1 + ln( y(t)

=

y(t) =

A max A max

The token is thus normalized such that y = A max when x = A m ax

25 SystemView Communications Library

Comm Library

It should also be noted that while this process is associated with non-uniform quantization, the effect is achieved by applying the companded signal to a uniform quantizer, and is not quite the same as applying an uncompressed signal to a non-uniform quantizer. In such a situation, no signal distortion is introduced. Signal recovery, however, requires a D/A with the exact inverse of the A/D.

Example: See example file cmpd_tst.svu. In this example we run the compander and de-compander in tandem. The input source is a Gaussian signal having a unity variance. The DeCompand token is set such that when K max = A max the operations are inverses of each other up to K max . If the input signal is less than Kscale, the recovered output is equal to the input. If the input is greater than Kscale the output equals 1. References (1) Sklar, B., Digital Communications Fundamentals and Applications, Prentice Hall 2001, ISBN 0-13-084788-7

26 SystemView Communications Library

Synopsis: This token will implement the CMA equalizer algorithm used to remove Multipath and interference effects in communication systems. Parameters: Parameter Tap Initial Conditions

Number of FIR Taps Number of IIR Taps Loop Gain Error Avg. CMA Constant Monitor Tap

Symbol Definition This sets the initial values of the filter taps (select one of the three options) n The number of taps in the Finite Impulse Response (FIR) section of the filter m The number of taps in the IIR section of the filter µ The gain constant for the error signal p The number of feedback error signal samples averaged (filtered) A The CMA amplitude reference for computing the error signal The tap value that will be available as a token output

Token Inputs: • The in-phase (I, cosine) baseband waveform of the signal being equalized



The quadrature (Q, sine) baseband waveform of the signal being equalized

27 SystemView Communications Library

Comm Library

Token Name: Constant Modulus Algorithm (CMA) Equalizer Abbreviation: Equalizer Group: Filters

Token Outputs: • The in-phase part of the equalized signal



The quadrature part of the equalized signal



The error signal



The in-phase part of the monitored tap coefficient



The quadrature part of the monitored tap coefficient

Discussion: The Constant Modulus Algorithm (CMA) equalizer is one of several algorithms used to remove the effects of multipath, interference, or other channel distortions from a signal. Other algorithms include decision feedback equalizers (DFE) and Viterbi equalizers (VE). The CMA is a blind algorithm in that it does not depend on a known reference to derive an error signal.

Note that the CMA equalizer is applicable only to those signals with a constant modulus (e.g., MPSK and FM). Complex arithmetic operations are implied, in the CMA equalizer in figure 2.

Figure 2. CMA equalizer block diagram 28 SystemView Communications Library

Y (k) =

j =n

j=m

j =1

j =1

∑ Cj (k)X(k − j + 1) + ∑ Dj (k)Y(k − j)

The raw and filtered errors are calculated as: e(k) = 2A 2 − Y (k)

2

p

eˆ (k) =

1 ∑ e(k − j + 1) p j =1

The filter coefficients are updated as follows; C j (k + 1) = C j (k) + µeˆ(k )Y (k)X * (k − j) Dj (k + 1) = Dj (k) + µeˆ(k)Y(k)Y* (k − j) Using a sampler or decimating token before the CMA token can control the number of samples per symbol, seen by the equalizer. The token updates the output, and all of the weights at the sample rate into the token. For unity initial conditions, the real part of the tap coefficients are set to one, and the imaginary part is set to zero. There must be at least one FIR tap, but the number of IIR taps can be zero. References: (1) Proakis, J G., Digital Communications, (New York, McGraw Hill, 1989). (2) Treichler, J. R. and Agee, B. G., A New Approach to Multipath Correction of Constant Modulus Signals, (IEEE Trans. ASSP; Vol. ASSP-11, No. 2, April 1983).

29 SystemView Communications Library

Comm Library

The output of the equalizer at the k-th time sample is given by:

Token Name: Convolutional Error Correcting Coder Abbreviation: Cnv Coder Group: Encode/Decode Synopsis: This token performs convolutional error correction encoding. See Also: Blk Coder, Blk dCode, Cnv dCode Parameters: Parameter Output Bits Information Bits

Constraint Length (bits) Threshold (V) Code polynomial Time Offset (sec)

Symbol Definition n The number of output bits per k input bits k The number of input bits used to produce n output bits L The total number of input bits used by the encoder to produce one output bit T The value that separates a logic one from a logic zero The polynomial (OCTAL) that describes the encoder connections The time marker indicating the first valid information bit

Token Inputs: • The information bit stream, at one sample per bit Token Outputs: • The encoded bit stream at one sample per bit (the output sample rate is the n input rate times the code rate R = ) k

30 SystemView Communications Library

This token implements a complete convolutional error correcting coder. The coder assumes that the input is one sample per input bit. The output is also n one sample per bit, but at the new encoded bit rate ( times the input rate). k The time offset specifies when the data into this token is valid. The codes supported by this token are taken from Proakis. In addition to the codes in that table which are the defaults for a [k, n, l], any other code polynomial can be inserted in the code parameter window box. Example: See example cnvl.tst.svu. In this example we run two complete BER systems with hard- and soft-decision decoding. Notice the improvement in BER performance with soft decoding. References: (1) Sklar, B., Digital Communications Fundamentals and Applications, Prentice Hall 2001, ISBN 0-13-084788-7 (2) Proakis, J G., Digital Communications, McGraw-Hill, Inc., 1989, pp 466471.

31 SystemView Communications Library

Comm Library

Discussion: Convolutional codes are widely used. This is due to the use of the Viterbi decoding algorithm used in the decoder. Unlike block codes, it is also relatively easy to implement a soft-decision decoding algorithm that results in approximately 2 dB of performance gain when using three-bit soft-decision logic.

Token Name: Convolutional Error Correcting Decoder Abbreviation: Cnv dCode Group: Encode/Decode Synopsis: This token performs convolutional error correction decoding. See Also: Blk Coder, Blk dCode, Cnv Coder Parameters: Parameter Output Length

Information Bits Constraint Length Path Length Code Polynomial Threshold (V) Time Offset Decision Type Soft Bits Bin Size (V) High Signal Mean (V) Noise Density (dB)

Symbol Definition n The number of encoded bits per k information bits k The number of input bits used by the encoder to produce n bits L The constraint length of the desired code The number of states used by the Viterbi algorithm to decode the message The code polynomial (OCTAL) that represents the encoder structure T The value that separates a logic one from a logic zero The time marker indicating the first valid information bit Hard- versus soft-decision logic b The number of soft-decision bits S The size of each soft-decision quantization bin µ The expected value of the logic one signal offset from the threshold T Eb The noise power spectral density used in No the soft-decision logic

32 SystemView Communications Library

Comm Library

Token Inputs: • The encoded bit stream at one sample per bit Token Outputs:



The decoded bit stream at one sample per bit (the output rate is times the input rate and the code rate is R =

k or 1/R n

k ) n

Discussion: This token implements a complete hard or soft-decision convolutional error correcting decoder using the Viterbi decoding algorithm. The token assumes that the input is one sample per encoded bit. The output is one sample per decoded bit. The time offset indicates when the data into the token is valid.

As a general rule the path length should be four or five times the constraint length L. The soft-decision bins are symmetric around the specified threshold T having the specified width S: [T-2S to T-S], [T-S to T], [T to T+S], [T+S to T+2S], as shown in Figure 3. The soft-decision weighting is derived from identical Gaussian distributions P( x|± µ ) centered at T+ µ and T- µ as follows:

P ( x|± µ ) =

1 2πσ 2

Where,

σ=

e



( x − ( T ± µ )) 2 2σ 2

µ Es N0

33 SystemView Communications Library

And, Es =

k E n b

The weights used by the decoder are the logarithm of the probability that the received signal falls into the particular decision region. In order to work properly, the soft decoder requires an estimate of the output probability function for the signal P( x|± µ ) . This information combined with the bin size S is used to calculate the weighting function used by the decoding algorithm. If the bin size S is too large or too small, the soft decoder reverts to a hard-decision decoder. In between, there is an optimum value of S for E E each b . This optimum value is particularly sensitive to b . N0 N0 T ± µ are the amplitudes of the data bits into the decoder in the absence of noise. Normally T=0, but SystemView provides the flexibility for other choices.

Theory shows that a three bit soft decoding recovers about 2.0 dB of the 2.5 dB loss associated with the hard decision. Figure 3 shows a typical situation. In this case, b=3, which divides the probability space into eight regions (four regions ≥ T, four regions ≤ T). The size S is chosen to be µ / 2.5.

34 SystemView Communications Library

0

2

1

4

6

8

T-µ

10

12

T+3S

800.e-3

T+S

T 600.e-3

400.e-3

S=µ/2.5

200.e-3

0 0

2

4

6

8

10

12

Figure 3. Soft-decision boundaries Example: See example cnvl_tst.svu. In this example, two simple communication systems using the convolutional encoder are shown. One system is decoded via a hard decision, while the other is decoded with a 3-bit soft decision. The example produces the side-by-side BER curves for the two cases. Note the improvement when using the soft decision. References: (1) Proakis, J.G., Digital Communications, (New York, McGraw Hill, 1989). (2) Shu Lin and Costellio, D. J., Error Control Coding, (Prentice Hall, 1983).

35 SystemView Communications Library

Comm Library

S ystemView b y ELANIX

Token Name: Convolutional Interleaver Abbreviation: Cnvl Data Interleave Group: Processors Synopsis: This token performs convolutional interleaving, of a block of data. See Also: Block Interleaver Parameters: Parameter Interleave/deinterleave

No. of registers Register Length (samples) Time Offset Time Offset options

Symbol Definition Radio button. Choose the desired operation N The number of registers used in the interleaver. See discussion below. J The length of the registers used in the interleaver. See discussion below. The value that separates a logic one from a logic zero Radio button. Choose between specifying the offset in seconds, or in samples.

Token Inputs: • The block of data (x) to be interleaved/deinterleaved Token Outputs: • The interleaved/deinterleaved block of data (y). Discussion: Interleaving techniques are widely used, including convolutional interleaving. Two structures are shown here, a shift register implementation shown in the first figure A and a simple four register convolutional interleaver

36 SystemView Communications Library

Comm Library

In the first figure, the code symbols are sequentially shifted into the bank of N registers; each successive register provides J symbols more storage than did the proceeding one The zeroth register provides no storage (the symbol is transmitted immediately.) With each new code symbol the commutator switches to a new register, and the new code symbol is shifted in while the oldest code symbol in that register is shifted out to the modulator/transmitter. After the (N-1)th register, the commutator returns to the zeroth register and starts again. The deinterleaver performs the inverse operation, and the input and output commutators for both the interleaving and deinterleaving must be synchronized

37 SystemView Communications Library

The second figure illustrates an example of a convolutional four-register (j=1) interleaver being loaded by a sequence of code symbols. The synchronized deinterleaver is shown simultaneously feeding the deinterleaved symbols to the decoder. Figure a shows symbols 1 to 4 being loaded: the Xs represent unknown states. Figure b shows the first four symbols shifted within the register and the entry of symbols 5 to 8 to the interleaver input. Figure c shows symbols 9 to 12 entering the interleaver. The deinterleaver is now filled 38 SystemView Communications Library

Example: None References: Sklar, B., Digital Communications, Prentice Hall, Inc., 2001, pp 466-468.

39 SystemView Communications Library

Comm Library

with message symbols, but nothing useful is being fed to the decoder yet. Finally, figure d shows symbols 13 to 16 entering the interleaver, and at the output of the deinterleaver, symbols 1 to 4 are being passed to the decoder. The process continues until the entire codeword sequence, in its original preinterleaved form, is presented to the encoder.

Token Name: Costas Loop Abbreviation: Costas Group: Demodulators Synopsis: This token implements a third-order Costas loop, which is often used to coherently demodulate PSK signals. See Also: SystemView example file costas.svu Parameters: Parameter VCO Frequency (Hz)

VCO Phase (deg) Mod Gain (Hz/V) 1/s Coefficient 1/s2 Coefficient

Symbol Definition fc The frequency of the down-converting VCO φ0 The initial phase of the VCO The modulation gain of the VCO a The coefficient of the 1/s term in the loop filter 1 + a / s + b / s 2 b The coefficient of the 1/s2 term in the loop filter 1 + a / s + b / s 2

Token Inputs: • The PSK signal to be demodulated Token Outputs: • The demodulated Inphase I(t) signal • The demodulated Quadrature Q(t) signal • The VCO Inphase cos signal • The VCO Quadrature sine signal

40 SystemView Communications Library

Costas loop block diagram For BPSK modulation, the received signal is of the form; x (t ) = A ⋅ sin( 2 πfct + α + φk ), φk = 0, π = A ⋅ ak sin( 2 πfct + α ), ak = ±1

Where φk = 0, π represents the PSK phase modulation. The in-phase and quadrature signals are: I (t ) = x (t ) cos 2 πfot = A ⋅ ak sin( 2 πfct + α ) cos 2 πfot

= A ⋅ ak cos[2 π( fc − fo )t + α ] + an ignored term at fc + fo Q(t ) = A ⋅ ak sin[ 2 π( fc − fo )t + α ]

41 SystemView Communications Library

Comm Library

Discussion: Q (t) and I (t), as defined below, contain both the upper and lower frequency mixing products at the outputs of this token. To recover the data, the user needs to apply an appropriate external LPF to each of these signals.

Note that the product of I(t)*Q(t), which is used to form the error signal, is independent of a k . After filtering, the error signal is defined as; e(t ) = A2 sin( 2β(t ))

Where,

β(t ) = 2 π( fc − fo )t + α The system is in lock, (e (t) = 0), when β (t ) = 0, π / 2, π , and 3π / 2. the points π / 2, and 3π / 2 are unstable, while both of the other lock points are stable. When in lock, all of the data goes to the inphase I(t) signal, but there is a 0, ± π ambiguity that cannot be removed. For this reason, the data must be differentially encoded. The loop filter transfer function F(s) is given by:

F(s) = 1 +

a b + 2 s s

Example: See example file cost_tst.svu. This example has the same parameters as the costas.svu example. The loop locks to the input, which has a Doppler offset as well as an unknown phase. References: (1) Proakis, J G., Digital Communications, (New York, McGraw Hill, 1989), p 312.

42 SystemView Communications Library

Synopsis: This token is used to restore the dynamic range of a signal that has been processed by a compander. It performs the expansion of both µ-law and Alaw companded signals. See Also: Compander Parameters: Parameter Compand Type Input Scaling (V)

Symbol Definition Select either µ -law or A-law type K scale Selected to scale the input between ± 1

Token Inputs: • The signal to be inverse companded Token Outputs: • The inverse companded signal Discussion: Companders are used to reduce the quantization noise in PCM signals. The compander compresses the dynamic range of a signal before A/D conversion. The inverse compander restores the original signal. The constant K scale is used to normalize the input signal. If |x(t)| > K scale , then x(t) is limited to K scale .

The mathematical relations of the inverse compander are:

µ =255 law:

43 SystemView Communications Library

Comm Library

Token Name: Inverse Compander Abbreviation: DeCompand Group: Processors

This form is the standard adopted in the United States.

y (t ) = K scale

sgn[ x ( t )]

µ

(e

(

| x ( t )| ln( 1+ µ )) K scale

− 1) When, x (t ) ≤ Kscale

A=100 law:

This form is the standard in Europe. y ( t ) = K scale sgn[ x ( t )]

e

(

| x ( t )| ( 1+ ln( A )) −1 K scale

A

x (t )(1 + ln A) y (t ) = A

when, 1 ≥

when,

1 | x (t )| ≥ K scale 1 + ln( A)

| x (t )| 1 ≤ K scale 1 + ln( A)

When K scale = Amax (from the Compander token), the two tokens are matched to each other in that the output of the DeCompander is equal to the input to the Compander for x (t) ≤ Amax . References (1) Sklar, B., Digital Communications Fundamentals and Applications, Prentice Hall 2001, ISBN 0-13-084788-7

44 SystemView Communications Library

Synopsis: This token will implement the block deinterleaver associated with the IEEE 802.11a WLAN standard.

See Also: IEEE Standard 802.11a Interleaver

Parameters: Parameter NONE

Symbol

Definition

Token Inputs: •

The data to be deinterleaved

Token Outputs: •

The deinterleaved data

Discussion: This block deinterleaver acts on a group of 192 samples per block, at one sample per symbol (bit). It is a two-stage interleaver. There is a 192-sample group delay through the token. The specific algorithm is detailed in the reference cited below. The interleaver followed immediately with the deinterleaver will reproduce the original data with a 364-sample group delay.

References: IEEE Standard 802.11a 1999 for Wireless LAN Medium Access Control (MAC) and Physical Layer (PHY) specifications, High-speed Physical Layer in the 5 GHz band.

45 SystemView Communications Library

Comm Library

.11a

Token Name: IEEE Standard 802.11a DeInterleaver Abbreviation: DeIntrlv.11a Group: Filters Data

Token Name: DePuncture Abbreviation: Dpunct Group: Encoders/Decoders

Synopsis: This token performs the inverse of the puncture operation used to change the effective rate of a convolutional error correcting code.

Parameters: Parameter Constraint Length

Code Rate Start Offset (sec)

Symbol Definition l The constraint length of the rate ½ convolutional encoder output to be punctured K Determines the puncture rate and pattern to be used Determines the start time of the bit pattern to be punctured

Token Inputs: • The soft decision value of the transmitted punctured data stream

Token Outputs: • The DePuncture data steam where the punctured bits are reinserted as null symbols

46 SystemView Communications Library

The Start Offset parameter is used to account for arbitrary group delay from the encoder, through various elements of the simulation, to the decoder. This delay is easily determined by cross-correlating the encoder output with the decoder input.

Example: See example file PUNCTURE.svu. This example provides a complete BER simulation of a convolutional encoder with Puncture/DePuncture. The Puncture token removes the data bits according to the Puncture table, and the DePuncture token reinserts the null symbol before the convolutional decoder. The convolutional decoder must be set to work with soft decisions.

References:

Yutaka Yasuda, et.al. High-Rate Punctured Convolutional Codes for Soft Decision Viterbi Decoding, IEEE Transactions On Communications, Vol. COM-32, No. 3, March 1984, P 315

47 SystemView Communications Library

Comm Library

Discussion: Refer to the Puncture token description in this manual for a discussion of the puncture operation and pertinent tables. This token performs the inverse operation of the Puncture token by reinserting the punctured bits. It is assumed that the convolutional decoder that follows is operating on soft decisions. The inserted symbols are entered as ‘null’ symbols so no weight is given to them in the decoding process.

Token Name: Divide by N Abbreviation: Divide N Group: Processors Synopsis: This token divides the frequency of the input clock or sine wave by an integer factor equal to N. Parameters: Parameter Divide By Threshold (V)

Symbol Definition N The divide-by value of N The value that determines the Low-toT High crossing of the input The numeric value assigned to the output designating “high,” or True The numeric value assigned to the output designating “low,” or False Ctl The value that determines divide by N or N + 1. If the signal is equal to or greater than Ctl, divide by N + 1.

True Output (V) False Output (V) Cntrl Threshold

Token Inputs: • The signal x (t) that is to be frequency divided. (Signal)



The divide control. (Divide Cntrl) Divide by N:

Divide Cntrl = Cntrl Threshold

48 SystemView Communications Library

Operates as if there is a Low connected to the N control input. There is no warning message for an unconnected N control input. Discussion: The input is nominally either a sine wave or a square wave. The output is a rectangular wave, with a choice of either a 50% duty cycle, or a duty cycle dependent on N.

The Threshold parameter allows the choice between bipolar (A, -A) input signals, or logic (0, A) input signals. The Divide Cntrl selects either the divide-by-N, or divide-by-N+1 mode. If the Divide Cntrl input is not connected, the Cntrl Threshold parameter is disabled, and the token acts as if the Cntrl Threshold parameter is set infinitely high. Therefore, if the Divide Cntrl input is not connected, the token divides by N, regardless of the Cntrl Threshold parameter setting. There is no warning message for an unconnected Divide Cntrl input. The value of the Divide Cntrl input may change state at any time; but inside the token, the state of the input is updated only at the instant of a Low-to-High threshold crossing of the x(t) input signal. Token output (0) always has a 50% duty cycle: For an EVEN N parameter, the token divides by counting the positive-going Low-to-High threshold crossings of the x (t) input signal.

For an ODD N parameter, the token divides by counting the Low-to-High positive-going threshold crossings of the x (t) input signal. The token also uses the High-to-Low threshold crossings to help generate a 50% duty cycle output. (At start-up, the first crossing is used, regardless of the direction.)

49 SystemView Communications Library

Comm Library

Token Outputs: • The frequency divided signal (0), always with a 50% duty cycle. • The frequency divided signal (1), with the duty cycle dependent on N.

Token output (1) has a duty cycle dependent on N: For an EVEN or ODD N parameter, the token divides by counting only the Low-to-High positive-going threshold crossings of the x(t) input signal. For an EVEN N parameter this results in a 50% duty cycle. For an ODD N parameter this results in a duty cycle that is not 50%. Example: See example file div_n.svu. The system is an indirect frequency synthesizer where the output of the VCO is divided by 20 before being locked to the 10Hz reference.

50 SystemView Communications Library

Synopsis: This token implements a standard double sideband AM (DSBAM) modulator. See Also: QAM, MFSK Parameters: Parameter Amplitude (V) Frequency (Hz) Phase (deg)

Symbol Definition A The amplitude of the modulated carrier fc The frequency of the modulated carrier The phase of the modulated carrier φ

Mod Index

m

The modulation index

Token Inputs: • The signal to be modulated onto the carrier Token Outputs: • The modulated carrier Discussion: This token implements a complete DSB-AM modulator. y (t ) = A ⋅ (1 + m ⋅ x (t ) ) ⋅ sin(2πf ct + φ ) Example: See example file dsb_tst.svu. The modulating signal is band limited Gaussian noise. To view the signal spectrum in the analysis window, select the Spectrum tab in the Sink Calculator. The baseband noise spectra are transferred to the upper and lower sidebands of the carrier. There is a carrier component in the spectra as well.

51 SystemView Communications Library

Comm Library

Token Name: Double Sideband AM Modulation Abbreviation: DSB-AM Group: Modulators

Token Name: Error Vector Magnitude Abbreviation: EVM Group: Processors Synopsis: This token performs statistical analysis on the quality of a receiver system. It compares the actual received I, Q constellation point with the theoretically correct value. These measurements are commonly employed to determine the quality of wireless systems such as IS95 CDMA. Parameters: Parameter Normalization

Symbol Definition N The vector magnitude of the constellation point furthest from the constellation origin

Token Inputs: • I and Q channel values of the desired constellation point • I and Q channel values of the actual constellation point Token Outputs: • Error vector magnitude • Error magnitude • Phase error Discussion: The error vector magnitudes consist of three measurements as shown in the figure below, and are commonly employed as a figure of merit for communication systems by comparing the set of received constellation points with the theoretical ideal. Many systems specifications (including IS95) include EVM requirements for equipment used to implement the system. Many test equipment manufacturers include EVM statistics as part of their analysis suites. 52 SystemView Communications Library

desired Id, Qd error vector magnitude received Ir, Qr

angle error

Definitions: error vector magnitude(%) (k)

= [100 / N][(Id k − Irk ) 2 + (Qd k − Qrk ) 2 ]1/ 2

error magnitude (%)(k)

= [100 / N] (Id 2k + Qd 2k ) 1/2 − (Irk2 + Qrk2 ) 1/2

angle error(k)

= Tan -1 (Qd k / Id k ) − Tan −1 (Qrk / Irk )

Example: See the EVM.svu example file. This file shows EVM operation as it calculates three statistics: error vector magnitude, error magnitude, and phase error. A constellation is corrupted by noise. The token compares the ‘truth’ and ‘corrupted’ data points to calculated the appropriate instantaneous error values. The Cumulative Average token is used to smooth the instantaneous results.

53 SystemView Communications Library

Comm Library

magnitude error

References:

Hewlett Packard Product Note: 89400-14A, and Product Note: 89400-8

54 SystemView Communications Library

Synopsis: This token allows users to specify a general-baseband (complex) fading model. The channel structure is read in through a user input file, allowing for arbitrary channel models.

Parameters: Parameter Carrier frequency

Symbol Definition The RF carrier frequency of the signal f0

Velocity Number of terms

v n

Number of paths Channel file name

m

The velocity of the mobile platform The number of terms used in the Jakes model The number of paths in the model The name of the text file containing the desired channel model data, (delays and gains)

Token Inputs: • The I channel of the complex input signal • The Q channel of the complex input signal Token Outputs: • The I channel of the fading signal • The Q channel of the fading signal

55 SystemView Communications Library

Comm Library

Token Name: Fade Channel Abbreviation: FadeChn Group: Channel Models

Discussion: The general fading channel model is given by the equation: m

ch r (t) + jch i (t) = ∑ G k [c kr (t) + jc ki (t)]δ (t − τ k ) k =1

Where m is the number of paths which are modeled as a complex flat fading Jakes model;, In Jakes’ model, the following definitions apply: N

ci (t) =[ 2∑cos(βk)cos(2π f k t) + 2cos(α)cos(2π f mt) ] 2N +1 k =1

[

N

cq (t) = 2∑sin(βk)cos(2π f k t) + 2 sin(α)cos(2π f mt) k =1

]

2N +1

f m = Maximum Doppler frequency = [v/c]fo f k = f m cos(2π k/L) L = 2(2N + 1)

α = π/4 β k = πk / N N = The number of terms in the Jakes model.

A range N = 8 - 10 is usually sufficient. Also, τ k is the delay of the k’th path and G k is the relative gain. These parameters are read in through the external file as described below. The token complex multiplies the input complex, I,Q data with the above channel model expression to producing the complex I, Q output data.

56 SystemView Communications Library

Gain(dB) Delay (usec) 0.0 0.0 -3.0 2.0 -6.0 4.0 When choosing the number of paths, m, may be any integer from 1 to the total number of taps in the file. The token will implement the first m entries. The first line of the file is the number of taps in the model. The second line is a single line header. IMPORTANT NOTE: A header is required. Without a header the first line of data will not be processed. After the last tap entry you may also add other descriptive information if you desire. A 6-tap format is shown below. Gain (dB) Delay (usec) 0 0 0 3.2 0 6.4 0 9.6 0 12.8 0 16.0 GSM Parameters for Testing Adaptive Equalizers The number of terms, n, used in the Jakes’ model is arbitrary. The more terms used, the better the representation, but the longer the computation takes in the simulation. An n of about 10 suffices for most situations. The Jakes model depends on a maximum Doppler frequency value that is given by f dmax = [v / c]f 0 where c is the speed of light.

57 SystemView Communications Library

Comm Library

File Format: The input channel file describes the fading model. It contains the relative gain and delay for each element in the above summation. The format for a 3-tap model is shown below:

This token is a baseband model requiring both real (I) and imaginary (Q) components of the signal at baseband. No carrier is required. This will greatly improve the simulation speed. If a simple Jakes channel is desired, set the number of taps to 1. The following channel model tables are included with the library: EQx.txt HTx_12a.txt HTx_12b.txt HTx_6a.txt HTx_6b.txt JTC_commercial_a.txt JTC_commercial_b.txt JTC_commercial_c.txt JTC_indoor_a.txt JTC_indoor_b.txt JTC_indoor_c.txt JTC_outdoor_lowrise_a.txt JTC_outdoor_lowrise_b.txt JTC_outdoor_lowrise_c.txt JTC_outdoor_res__low_a.txt JTC_outdoor_res__low_b.txt JTC_outdoor_res__low_c.txt JTC_outdoor_urban_a.txt JTC_outdoor_urban_b.txt JTC_outdoor_urban_c.txt RAx_6a.txt RAx_6b.txt Tux_12a.txt Tux_12b.txt Tux_6a.txt Tux_6b.txt

58 SystemView Communications Library

References:

Kaveh Pahlavan & Allen H. Levesque, Wireless Information Networks, John Wiley & Sons, 1995.

59 SystemView Communications Library

Comm Library

Example: See example file CHANNEL.svu In this example the input signal is constant. The token uses one of the included channel models (in text file format). The Q and I outputs of the token are converted to amplitude and phase. After running the example, this data is in the form of a histogram, to show the proper Raleigh amplitude and constant phase statistics.

Token Name: Frequency Controlled Pulse Train Abbreviation: FCPT Group: Modulators Synopsis: This token produces output pulses of the specified width according to the threshold crossings of the input signal. See Also: FMPT Parameters: Parameter Amplitude (V) Time Offset (sec)

Threshold (V)

Definition The amplitude of the output pulses The time delay between the input threshold crossing and the output pulse The value that separates a logic one from a logic zero in the input signal The width of the output pulse

Pulse Width (sec) Token Inputs: • Any desired input signal

Token Outputs: • A pulse train with pulse separation determined by the positive-going threshold crossings of the input signal Discussion: When the input signal crosses the specified threshold from below, the token output is a pulse having the above parameters. Example: See example file fcpt_tst.svu. The input is band limited Gaussian noise. The output is a pulse when the input crosses zero from below.

60 SystemView Communications Library

Synopsis: This token frequency modulates a pulse train. See Also: Frequency Controlled Pulse Train, FCPT Parameters: Parameter Amplitude (V) Frequency (Hz) Phase (deg) Mod. Gain (Hz/V)

Pulse Width (sec)

Symbol Definition The amplitude of the output pulse train f0 The nominal frequency of the pulse train φ0 The initial phase of the pulse train µ The modulation gain of the FM modulator that produces the pulses The time width of the output pulse train

Token Inputs: • The signal that modulates the frequency of the pulse train Token Outputs: • The frequency modulated pulse train Discussion: The phase of the modulated pulse train is given by:

φ (t ) = 2π f0 t + 2πµ ∫ x(t)dt + φ 0

Mod(2π )

61 SystemView Communications Library

Comm Library

Token Name: Frequency Modulated Pulse Train Abbreviation: FMPT Group: Modulators

The token produces a pulse of the specified width whenever φ (t) crosses zero degrees phase from below. This is similar to the VCO token, where a pulse train, at the positive going crossing of the VCO sine wave, replaces the output sine wave. This token can be used as a frequency controlled sampling function used as part of a bit sync loop or an early/late gate PN tracking loop. Example: See example file fmpt_tst.svu. The input to the token is a sine wave. The output pulse train is frequency modulated by the input. Compare the FMPT outputs with the output of the FM modulator in the example.

62 SystemView Communications Library

Synopsis: This token generates the Gold codes commonly used in CDMA spread spectrum systems such as GPS. Parameters: Parameter Polynomial 1

Polynomial 2 Initial 1 Initial 2 Logic level 1 Logic level 0 Shift register size Clock threshold

Symbol Definition The feedback configuration of the first PN sequence used to describe the code The feedback configuration of the second PN sequence used to describe the code The initial state of the PN sequence that describes code 1 The initial state of the PN sequence that describes code 2 The physical output value representing represent a logical 1 in Gold code The physical output value representing a logical 0 in Gold code The number of shift registers used to describe the length of the Gold code The value that separates a logical one from a logical zero in the clock token used to drive the Gold code token

Token Inputs: • Clock token used to drive the Gold Code PN generators.

63 SystemView Communications Library

Comm Library

Token Name: Gold Code Generator Abbreviation: GoldCode Group: Filters/Data

Token Outputs: • Desired Gold code. • Output of the 1st Pn signal used to generate the Gold code. • Output of the 2nd Pn signal used to generate the Gold code. Discussion: Gold codes are commonly employed as a basis set for CDMA spread spectrum systems. The Global Positioning System (GPS) uses Gold codes. Gold codes are well documented in the literature and texts on spread spectrum systems. They are popular because of the low (but not zero) cross-correlation between members of the set. This cross-correlation is lower than the maximum correlation of PN sequences alone. The structure of the codes is shown in the figure below. Initial conditions 1 PN generator #1 x PN generator #2

G old C ode

Initial conditions 2

Gold Code Generator The two PN generators are of the same length but with different feedback taps. Not all pairs of PN codes are permitted, only “preferred” pairs as discussed in the references. Fixing the initial conditions of PN #1, and varying the initial conditions of PN #2 to obtain the family of Gold codes.

Example: See example file GOLD.svu. This example shows the Gold Code token driven by a clock source. The three outputs are the Gold code and the individual PN codes used to generate it. 64 SystemView Communications Library

Comm Library

References:

Robert C. Dixon, Spread Spectrum Systems with Commercial Applications, John Wiley & Sons, 1994

65 SystemView Communications Library

Token Name: Gray Encoder/Decoder Abbreviation: Gray Code Group: Encode/Decode Synopsis: This token performs the Gray encoding and decoding of binary words. Parameters: Parameter Select Operation Select Order

Word Size Threshold (V)

Definition Choose between encoder and decoder Choose the Most Significant Bit (MSB) or Least Significant Bit (LSB) as the first bit of the input code word The number of input bits to be encoded Separates a logical one from a logical zero

Token Inputs: • The binary bit stream at one sample per bit to be encoded or decoded Token Outputs: • The Gray encoded or decoded binary bit stream Discussion: Consider an 8PSK system with [1,1,1] input bits. This pattern would normally be transmitted as a phase of 7 π /4. At the decoder, the most likely errors are the phases 6 π /4, and 8 π /4 (or 0). In the latter case, the decoded bit pattern would be [0,0,0]. Thus, a nearest-neighbor symbol error will produce three bit errors.

Gray encoding is a procedure for ensuring that nearest-neighbor symbol errors only produce one bit error. Table 1 shows the encoding for 8PSK. The encoded bits, when used with the Bit-to-Symbol token, will produce the transmitted phases as shown in Table 1.

66 SystemView Communications Library

Gray Output Bits 000 001 011 010 111 110 100 101

Transmitted Phase 0 π /4 1 π /4 3 π /4 2 π /4 7 π /4 6 π /4 4 π /4 5 π /4

Table 1. 8PSK Gray Encoding To see the effect of the Gray encoding, let the input bits be [1,1,1]. From the above table, the transmitted phase is now 5 π /4 (rather than 7 π /4). The nearest phase error 4 π /4, decodes 5 π /4 into [1,0,0] and is then Gray decoded to [1,1,0], thus producing only one bit error. In the same way, the nearest neighbor, 6 π /4, Gray decodes to [1,0,1], again producing only one bit error. Considerations:



The encoder and decoder operations are not interchangeable, and must be used in that order.



The MSB/LSB selection must be the same for both operations.



When used with a Bit-to-Symbol token, the MSB/LSB selection for those tokens must agree with the Gray encoder selection.



There is one symbol group delay in both decode and encode, operations.

References: (1) Proakis, J G., Digital Communications, (New York, McGraw Hill, 1989).

67 SystemView Communications Library

Comm Library

Input Bits 000 001 010 011 100 101 110 111

Token Name: Integrate and Dump Filter Abbreviation: Int-Dmp Group: Filters Synopsis: This token will implement a complete integrate and dump matched filter. Parameters: Parameter Integration Time (sec) Offset (sec)

Output Selection

Symbol Definition T The time window of the filter τ A time offset that specifies the start time of the integration One of the following outputs: Continuous, Impulse, or Hold Value

Token Inputs: • The signal x (t) to be filtered Token Outputs: • The filtered signal y (t) as defined below:

y ( t ) = x ( t ) ⊗ h( t ) 1 h( t ) = , 0 ≤ t ≤ T T = 0, otherwise Thus,

y(t) = 0, 0 ≤ t < τ t

=

1 x(α )dα , τ < t < τ + T T ∫τ t

1 = x(α )dα , t > τ + T T t −∫T 68 SystemView Communications Library

The offset time, τ, controls when the filter first starts to integrate (i.e., turns on). The filter has three modes of operation. 1) Continuous: In this mode, the output y(t) is given by the expression defined as the Token Output. It is equivalent to filtering the input signal using a filter with frequency response

H( f ) =

sin(πfT ) (πfT )

The filter turns on at t = τ, so the first valid time output is at t = τ + T . Note, once t > τ + T , the output is independent of τ . Thus, if T=1 sec, and τ 2=1.4 sec, then the output of those filters will be identical for t >1+1.4 (or 2.4 sec). 2) Hold Value: In this mode, y(t) defined as the Token Output is sampled at t = τ + T , τ + 2T , etc. The current sample value is held until the next sample is taken. 3) Impulse: In this mode, y(t) defined as the Token Output is sampled at t = τ + T , τ + 2T , etc. The output is set to zero between each of these sample times. Example: See example file i&d_tst.svu. In this example we impulse the filter producing the output pulse. This signal is then filtered by an identical token, which produces the triangular matched filter response of the system. This is an example of the continuous mode. As a further example we drive the token with Gaussian noise to illustrate the impulse and sample and hold modes.

69 SystemView Communications Library

Comm Library

Discussion: Despite its common name, the integration need not be reset (dumped) at the end of each integration period T. There is no inter-symbol interference for a matched filter of this type. Sampling at T, 2T, etc., recovers the data for each individual input bit with no interference from other bits.

Token Name: IEEE Standard 802.11a Interleaver Abbreviation: Intrlv.11a Group: Filters Data

11a

Synopsis: This token will implement the block interleaver associated with the IEEE 802.11a WLAN standard.

See Also: IEEE Standard 802.11a DeInterleaver

Parameters: Parameter NONE

Symbol

Definition

Token Inputs: •

The data to be interleaved

Token Outputs: •

The interleaved data

Discussion: This block interleaver acts on a group of 192 samples per block, at one sample per symbol (bit). It is a two-stage interleaver. There is a 192-sample group delay through the token. The specific algorithm is detailed in the reference cited below. The interleaver followed immediately with the deinterleaver will reproduce the original data with a 364-sample group delay.

References: IEEE Standard 802.11a 1999 for Wireless LAN Medium Access Control (MAC) and Physical Layer (PHY) specifications, High-speed Physical Layer in the 5 GHz band.

70 SystemView Communications Library

Synopsis: This token implements a standard block Interleaver. Parameters: Parameter Mode Rows Columns

Symbol

k n

Definition Select interleave or de-interleave Number of rows in the interleaver Number of columns in the interleaver

Token Inputs: • The data to be interleaved Token Outputs: • The interleaved data Discussion: This token is a block interleaver. Interleavers are commonly used to spread the effects of channel fading so that error-correcting codes are more effective. The data is input by rows, and output by columns (see Figure 5). The deinterleaver must have k and n reversed from the interleaver. The group delay through the combined interleave/de-interleave process is 2kn samples. The input to the interleaver is not restricted to a digital format. Any data format (signal or waveform) can be used.

71 SystemView Communications Library

Comm Library

Token Name: Interleaver Abbreviation: Interleave Group: Processors

A(1,1) A(2,1) -----A(k,1)

A(1,2) A(2,2) -----A(k,2)

---------------------

A(1,n).. A(2,n) -----A(k,n)

Figure 5. Interleaver data rows and columns The data is read in as: A(1,1), A(1,2), ----, A(1,n), A(2,1), ----,A(2,n), ----,A(k,1), ----, A(k,n) The data is read out as: A(1,1), A(2,1),----, A(k,1), A(1,2), ----, A(k,2), ----, A(1,n),----, A(k,n)

72 SystemView Communications Library

Synopsis: This token performs the inverse filter operation for a [sinx/x](sinc) function Parameters: Parameter Symbol Time

Symbol Definition T Time or inverse rate of NRZ signal

Token Inputs: • The input signal to be filtered Token Outputs: • The desired filtered output signal Discussion: The power spectral density of an NRZ data waveform, of rate T, has a sinc (πfT)^2 shape. In communication systems it is common to limit the occupied signal bandwidth by using baseband pulse shaping filters such as raised cosine and root-raised cosine. The proper way to generate these signals is to impulse the filters once every T seconds with a value relating to the data (+/-1). Sometimes (from a hardware standpoint) it is difficult to drive the filters with the impulses, so the NRZ waveform is used. In this case, the output spectra, is the product of the desired pulse spectra, and the sinc spectra of the NRZ waveform. The inverse sinc filter is then used to remove the sinc portion of the spectra and finally produce the desired output.

This token generates a filter H(f) such that: H ( f )[e 2πjfT − 1] / 2πjfT = 1 If fs is the system sample rate, then the relation fsT = m = integer must hold.

73 SystemView Communications Library

Comm Library

Token Name: Inverse Sinc Function Abbreviation: InvSinc Group: Filters/Data

Example: See example file INVSINC.svu. This example shows the operation of the Inverse Sinc token by recovering the basic data impulses from the NRZ waveform. This operation is compared to the equivalent operation created with the Sampler and Hold tokens from the SystemView Operator library.

74 SystemView Communications Library

Synopsis: This token mixes (multiplies) the input modulated signal at RF with sine and cosine signals having the specified frequency. This token is normally used to down-convert an RF signal, thereby producing inphase and quadrature baseband signals. Parameters: Parameter LO Amplitude (V)

Frequency (Hz) IQ Rotate Phase (deg) Amplitude Error (dB) Phase Error (deg)

Symbol Definition A The amplitude of the sine and cosine signals f0 The frequency of the sine and cosine signals φ Reference phase of the sine and cosine signals Aerr Amplitude imbalance between the sine and cosine signals φ err The amount of phase error relative to 90 degrees (between the sine and cosine signals)

Token Inputs: • The signal x(t)to be frequency converted Token Outputs: • 0: Inphase Signal I (t ) = x (t ) Acos(2πf 0t + φ ) • 1: Quadtrature Signal Q( t ) = x ( t ) A(10

Aerr 20

) sin(2πf 0 t + φ + φerr )

75 SystemView Communications Library

Comm Library

Token Name: I-Q Downconverter Abbreviation: IQ Mixer Group: Processors

Discussion: This token implements a basic element of communication system demodulation. The Q and I outputs of this token are usually followed by an external filter which selects one of the sidebands (usually the lower, or difference frequency). The user must supply this filter. The error terms duplicate the real-world effects of phase and amplitude mismatch in the downconversion process. A phase mismatch causes “leakage” of the I signal into the Q signal path and visa versa. Example: See example file qam_tst.svu. As part of the QAM example, the IQ Mixer token is used to down-convert the modulated signal into I and Q baseband signals. Also see the example Cost_tst.svu.

76 SystemView Communications Library

Synopsis: This token will implement Jakes’ algorithm for generating a mobile channel model. See Also: NBI Chn, Rice Chn, Rmlr Chn, Mpath Chn Parameters: Parameter No. Terms Max Doppler (Hz)

Symbol Definition N The desired number of terms in the model fm The maximum Doppler frequency spread

Token Inputs: • The input signal x(t) to which the fading channel algorithm is applied Token Outputs: • The received fading signal y(t) Discussion: The output of the token, y(t), is given by:

y(t) = ri (t) xˆ (t) − rq (t)x(t) Where ˆx (t) is the Hilbert Transform of x(t). The Hilbert transform is a band pass operation. Make sure that the signal of interest lies between the frequency limits .1 f s ≤ f ≤ .4f s f s is the system sample rate.

77 SystemView Communications Library

Comm Library

Token Name: Jakes Mobile Channel Abbreviation: Jakes Chn Group: Channel Models

In Jakes’ model, the following definitions apply: N

r i (t ) = [ 2 ∑ cos( β k ) cos(2π f k t ) + 2cos(α )cos( 2π f m t ) ] / 2 N + 1 k =1

N

r q (t ) = [ 2 ∑ sin( β k )cos( 2π f k t ) + 2 sin(α )cos( 2π f m t ) ] / 2 N + 1 k =1

f m = Maximum Doppler frequency = [v/c]fo f k = f m cos(2π k/L) L = 2(2N + 1)

α = π/4 β k = πk / N N = the number of terms in the Jakes model. A range N = 8 - 10 is usually sufficient. The terms ri (t) and rq(t) are the components of the low frequency equivalent transfer function of the channel. The frequency power spectrum of the channel is P( f ) = [πf m 1 − ( f / f m ) 2 ] −1

Example: See the example file jake_tst.svu.

78 SystemView Communications Library

Parameters: Parameter Transition Phase (deg)

Amplitude (V) Number of Tones Min Frequency (Hz) Frequency Step (Hz) Rate (Hz) Minimum Input (V) Maximum Input (V)

Symbol Definition Choose between three types of MFSK modulation A Peak amplitude of the output carrier N The number of FM tones in the modulated sequence f min The lowest output tone frequency of the set ∆f The frequency separation between the tones 1/T The symbol rate of the modulating information. The lowest value of the input modulating voltage. The highest value of the input modulating voltage.

Token Inputs: • The modulating signal x(t) Token Outputs: • The frequency modulated signal y(t) of the form:

y (t ) = Asin(2πf min t + 2π∆fx∃( kT )t + φ k ), kT ≤ t ≤ ( k + 1) T

Where x∃(kT) is an integer 0< x∃(kT)