Commblks
Commblks
Blockset                      ®
                       For Use with Simulink
Computation
Visualization
Programming
User’s Guide
Version 2
           How to Contact The MathWorks:
 ☎
 PHONE
           508-647-7000                           Phone
           508-647-7001                           Fax
   FAX
  ✉MAIL
           The MathWorks, Inc.
           3 Apple Hill Drive
                                                  Mail
Natick, MA 01760-2098
           http://www.mathworks.com               Web
INTERNET   ftp.mathworks.com                      Anonymous FTP server
           comp.soft-sys.matlab                   Newsgroup
  @
  E-MAIL
           support@mathworks.com
           suggest@mathworks.com
                                                  Technical support
                                                  Product enhancement suggestions
           bugs@mathworks.com                     Bug reports
           doc@mathworks.com                      Documentation error reports
           subscribe@mathworks.com                Subscribing user registration
           service@mathworks.com                  Order status, license renewals, passcodes
           info@mathworks.com                     Sales, pricing, and general information
Preface
Typographical Conventions . . . . . . . . . . . . . . . . . . . . . . . . . . . . xx
                                                                                                                i
                       Transmitting Along a Noisy Channel . . . . . . . . . . . . . . . . . . . .                     1-16
                       Mapping the Received Data . . . . . . . . . . . . . . . . . . . . . . . . . . . .              1-18
                       Buffering to Convert Scalars to Vectors . . . . . . . . . . . . . . . . . .                    1-20
                       Decoding the Convolutional Code . . . . . . . . . . . . . . . . . . . . . . .                  1-21
                       Computing the Error Rate . . . . . . . . . . . . . . . . . . . . . . . . . . . . .             1-24
                       Displaying the Error Rate . . . . . . . . . . . . . . . . . . . . . . . . . . . . .            1-26
                       Other Blocks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .   1-26
ii   Contents
   Companding a Signal . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-24
   Selected Bibliography for Source Coding . . . . . . . . . . . . . . . . . 2-26
Interleaving . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .   2-46
  Interleaving Features of the Blockset . . . . . . . . . . . . . . . . . . . .                  2-46
  Block Interleavers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .       2-46
  Convolutional Interleavers . . . . . . . . . . . . . . . . . . . . . . . . . . . .             2-47
  Selected Bibliography for Interleaving . . . . . . . . . . . . . . . . . . .                   2-51
                                                                                                        iii
                       Digital Modulation Features of the Blockset . . . . . . . . . . . . . .                         2-65
                       Representing Signals for Digital Modulation . . . . . . . . . . . . . .                         2-68
                       Delays in Digital Modulation . . . . . . . . . . . . . . . . . . . . . . . . . .                2-69
                       Upsampled Signals and Rate Changes . . . . . . . . . . . . . . . . . . .                        2-72
                       Examples of Digital Modulation . . . . . . . . . . . . . . . . . . . . . . . .                  2-75
                       Selected Bibliography for Digital Modulation . . . . . . . . . . . . .                          2-83
                    Channels . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .   2-84
                      Channel Features of the Blockset . . . . . . . . . . . . . . . . . . . . . . .                   2-84
                      AWGN Channel . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .           2-84
                      Fading Channels . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .          2-85
                      Binary Symmetric Channel . . . . . . . . . . . . . . . . . . . . . . . . . . . .                 2-88
                      Selected Bibliography for Channels . . . . . . . . . . . . . . . . . . . . .                     2-89
                    Synchronization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .          2-90
                      Synchronization Features of the Blockset . . . . . . . . . . . . . . . .                         2-90
                      Overview of PLL Simulation . . . . . . . . . . . . . . . . . . . . . . . . . . .                 2-91
                      Implementing an Analog Baseband PLL . . . . . . . . . . . . . . . . .                            2-91
                      Implementing a Digital PLL . . . . . . . . . . . . . . . . . . . . . . . . . . .                 2-92
                      Selected Bibliography for Synchronization . . . . . . . . . . . . . . .                          2-92
                                                                                Function Reference
                3
                    Alphabetical List of Functions . . . . . . . . . . . . . . . . . . . . . . . . . 3-2
                      comm_links . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-3
                      commlib . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-4
                                                                                       Block Reference
                4
                    Communications Sources . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-3
iv   Contents
Source Coding . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-7
Interleaving . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-13
  Block Interleaving . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-13
  Convolutional Interleaving . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-15
Modulation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .   4-18
 Digital Baseband Modulation . . . . . . . . . . . . . . . . . . . . . . . . . .                 4-18
 Analog Baseband Modulation . . . . . . . . . . . . . . . . . . . . . . . . . .                  4-24
 Digital Passband Modulation . . . . . . . . . . . . . . . . . . . . . . . . . .                 4-26
 Analog Passband Modulation . . . . . . . . . . . . . . . . . . . . . . . . . .                  4-31
Channels . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-34
Synchronization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-36
                                                                                                        v
                Binary-Input RS Encoder . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-77
                Binary Linear Decoder . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-79
                Binary Linear Encoder . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-81
                Binary-Output RS Decoder . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-82
                Binary Symmetric Channel . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-84
                Binary Vector Noise Generator . . . . . . . . . . . . . . . . . . . . . . . . . 4-86
                Bit to Integer Converter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-89
                BPSK Demodulator Baseband . . . . . . . . . . . . . . . . . . . . . . . . . 4-90
                BPSK Modulator Baseband . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-92
                Charge Pump PLL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-94
                Complex Phase Difference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-97
                Complex Phase Shift . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-98
                Continuous-Time Eye and Scatter Diagrams . . . . . . . . . . . . . . 4-99
                Convolutional Deinterleaver . . . . . . . . . . . . . . . . . . . . . . . . . . 4-103
                Convolutional Encoder . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-105
                Convolutional Interleaver . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-107
                CPFSK Demodulator Baseband . . . . . . . . . . . . . . . . . . . . . . . 4-109
                CPFSK Demodulator Passband . . . . . . . . . . . . . . . . . . . . . . . 4-112
                CPFSK Modulator Baseband . . . . . . . . . . . . . . . . . . . . . . . . . 4-115
                CPFSK Modulator Passband . . . . . . . . . . . . . . . . . . . . . . . . . . 4-118
                CPM Demodulator Baseband . . . . . . . . . . . . . . . . . . . . . . . . . 4-121
                CPM Demodulator Passband . . . . . . . . . . . . . . . . . . . . . . . . . 4-125
                CPM Modulator Baseband . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-130
                CPM Modulator Passband . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-134
                Data Mapper . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-139
                DBPSK Demodulator Baseband . . . . . . . . . . . . . . . . . . . . . . . 4-142
                DBPSK Modulator Baseband . . . . . . . . . . . . . . . . . . . . . . . . . 4-144
                Deinterlacer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-146
                Derepeat . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-147
                Descrambler . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-150
                Differential Decoder . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-152
                Differential Encoder . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-153
                Discrete Modulo Integrator . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-154
                Discrete-Time Eye and Scatter Diagrams . . . . . . . . . . . . . . . 4-156
                Discrete-Time VCO . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-159
                DPCM Decoder . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-161
                DPCM Encoder . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-163
                DQPSK Demodulator Baseband . . . . . . . . . . . . . . . . . . . . . . . 4-165
                DQPSK Modulator Baseband . . . . . . . . . . . . . . . . . . . . . . . . . 4-167
                DSB AM Demodulator Baseband . . . . . . . . . . . . . . . . . . . . . . 4-171
vi   Contents
DSB AM Demodulator Passband . . . . . . . . . . . . . . . . . . . . . .                        4-173
DSB AM Modulator Baseband . . . . . . . . . . . . . . . . . . . . . . . .                      4-175
DSB AM Modulator Passband . . . . . . . . . . . . . . . . . . . . . . . . .                    4-176
DSBSC AM Demodulator Baseband . . . . . . . . . . . . . . . . . . . .                          4-178
DSBSC AM Demodulator Passband . . . . . . . . . . . . . . . . . . . .                          4-180
DSBSC AM Modulator Baseband . . . . . . . . . . . . . . . . . . . . . .                        4-182
DSBSC AM Modulator Passband . . . . . . . . . . . . . . . . . . . . . .                        4-183
Enabled Quantizer Encode . . . . . . . . . . . . . . . . . . . . . . . . . . .                 4-185
Error Rate Calculation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .             4-187
FM Demodulator Baseband . . . . . . . . . . . . . . . . . . . . . . . . . . .                  4-194
FM Demodulator Passband . . . . . . . . . . . . . . . . . . . . . . . . . . .                  4-196
FM Modulator Baseband . . . . . . . . . . . . . . . . . . . . . . . . . . . . .                4-198
FM Modulator Passband . . . . . . . . . . . . . . . . . . . . . . . . . . . . .                4-200
Gaussian Noise Generator . . . . . . . . . . . . . . . . . . . . . . . . . . . .               4-202
General Block Deinterleaver . . . . . . . . . . . . . . . . . . . . . . . . . .                4-205
General Block Interleaver . . . . . . . . . . . . . . . . . . . . . . . . . . . .              4-207
General Multiplexed Deinterleaver . . . . . . . . . . . . . . . . . . . .                      4-208
General Multiplexed Interleaver . . . . . . . . . . . . . . . . . . . . . . .                  4-210
General QAM Demodulator Baseband . . . . . . . . . . . . . . . . . .                           4-212
General QAM Demodulator Passband . . . . . . . . . . . . . . . . . .                           4-214
General QAM Modulator Baseband . . . . . . . . . . . . . . . . . . . .                         4-217
General QAM Modulator Passband . . . . . . . . . . . . . . . . . . . .                         4-219
GMSK Demodulator Baseband . . . . . . . . . . . . . . . . . . . . . . . .                      4-222
GMSK Demodulator Passband . . . . . . . . . . . . . . . . . . . . . . . .                      4-225
GMSK Modulator Baseband . . . . . . . . . . . . . . . . . . . . . . . . . .                    4-228
GMSK Modulator Passband . . . . . . . . . . . . . . . . . . . . . . . . . .                    4-231
Hamming Decoder . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .            4-234
Hamming Encoder . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .            4-236
Helical Deinterleaver . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .          4-238
Helical Interleaver . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .        4-241
Insert Zero . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .    4-244
Integer-Input RS Encoder . . . . . . . . . . . . . . . . . . . . . . . . . . . .               4-246
Integer-Output RS Decoder . . . . . . . . . . . . . . . . . . . . . . . . . . .                4-248
Integer to Bit Converter . . . . . . . . . . . . . . . . . . . . . . . . . . . . .             4-250
Integrate and Dump . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .             4-251
Interlacer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .   4-253
Linearized Baseband PLL . . . . . . . . . . . . . . . . . . . . . . . . . . . .                4-254
Matrix Deinterleaver . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .           4-256
Matrix Helical Scan Deinterleaver . . . . . . . . . . . . . . . . . . . . .                    4-257
Matrix Helical Scan Interleaver . . . . . . . . . . . . . . . . . . . . . . .                  4-259
                                                                                                       vii
                Matrix Interleaver . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .         4-262
                M-DPSK Demodulator Baseband . . . . . . . . . . . . . . . . . . . . . .                        4-264
                M-DPSK Demodulator Passband . . . . . . . . . . . . . . . . . . . . . .                        4-267
                M-DPSK Modulator Baseband . . . . . . . . . . . . . . . . . . . . . . . .                      4-270
                M-DPSK Modulator Passband . . . . . . . . . . . . . . . . . . . . . . . .                      4-274
                M-FSK Demodulator Baseband . . . . . . . . . . . . . . . . . . . . . . .                       4-277
                M-FSK Demodulator Passband . . . . . . . . . . . . . . . . . . . . . . . .                     4-280
                M-FSK Modulator Baseband . . . . . . . . . . . . . . . . . . . . . . . . . .                   4-283
                M-FSK Modulator Passband . . . . . . . . . . . . . . . . . . . . . . . . . .                   4-286
                Modulo Integrator . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .          4-289
                M-PAM Demodulator Baseband . . . . . . . . . . . . . . . . . . . . . . .                       4-290
                M-PAM Demodulator Passband . . . . . . . . . . . . . . . . . . . . . . .                       4-293
                M-PAM Modulator Baseband . . . . . . . . . . . . . . . . . . . . . . . . .                     4-297
                M-PAM Modulator Passband . . . . . . . . . . . . . . . . . . . . . . . . .                     4-301
                M-PSK Demodulator Baseband . . . . . . . . . . . . . . . . . . . . . . .                       4-305
                M-PSK Demodulator Passband . . . . . . . . . . . . . . . . . . . . . . . .                     4-308
                M-PSK Modulator Baseband . . . . . . . . . . . . . . . . . . . . . . . . . .                   4-311
                M-PSK Modulator Passband . . . . . . . . . . . . . . . . . . . . . . . . . .                   4-316
                MSK Demodulator Baseband . . . . . . . . . . . . . . . . . . . . . . . . .                     4-319
                MSK Demodulator Passband . . . . . . . . . . . . . . . . . . . . . . . . .                     4-321
                MSK Modulator Baseband . . . . . . . . . . . . . . . . . . . . . . . . . . .                   4-324
                MSK Modulator Passband . . . . . . . . . . . . . . . . . . . . . . . . . . . .                 4-326
                Mu-Law Compressor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .              4-329
                Mu-Law Expander . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .            4-330
                Multipath Rayleigh Fading Channel . . . . . . . . . . . . . . . . . . .                        4-331
                OQPSK Demodulator Baseband . . . . . . . . . . . . . . . . . . . . . . .                       4-334
                OQPSK Demodulator Passband . . . . . . . . . . . . . . . . . . . . . . .                       4-336
                OQPSK Modulator Baseband . . . . . . . . . . . . . . . . . . . . . . . . .                     4-339
                OQPSK Modulator Passband . . . . . . . . . . . . . . . . . . . . . . . . .                     4-342
                Phase-Locked Loop . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .            4-345
                PM Demodulator Baseband . . . . . . . . . . . . . . . . . . . . . . . . . . .                  4-348
                PM Demodulator Passband . . . . . . . . . . . . . . . . . . . . . . . . . . .                  4-350
                PM Modulator Baseband . . . . . . . . . . . . . . . . . . . . . . . . . . . . .                4-352
                PM Modulator Passband . . . . . . . . . . . . . . . . . . . . . . . . . . . . .                4-353
                PN Sequence Generator . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .              4-355
                Poisson Int Generator . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .            4-358
                Puncture . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .   4-360
                QPSK Demodulator Baseband . . . . . . . . . . . . . . . . . . . . . . . .                      4-362
                QPSK Modulator Baseband . . . . . . . . . . . . . . . . . . . . . . . . . . .                  4-364
                Quantizer Decode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .         4-367
viii Contents
Random Deinterleaver . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .            4-368
Random-Integer Generator . . . . . . . . . . . . . . . . . . . . . . . . . . .                4-369
Random Interleaver . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .          4-372
Rayleigh Noise Generator . . . . . . . . . . . . . . . . . . . . . . . . . . . .              4-373
Rectangular QAM Demodulator Baseband . . . . . . . . . . . . . .                              4-376
Rectangular QAM Demodulator Passband . . . . . . . . . . . . . . .                            4-379
Rectangular QAM Modulator Baseband . . . . . . . . . . . . . . . . .                          4-383
Rectangular QAM Modulator Passband . . . . . . . . . . . . . . . . .                          4-387
Rician Fading Channel . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .             4-391
Rician Noise Generator . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .            4-394
Sampled Quantizer Encode . . . . . . . . . . . . . . . . . . . . . . . . . . .                4-397
Scrambler . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .   4-399
SSB AM Demodulator Baseband . . . . . . . . . . . . . . . . . . . . . .                       4-401
SSB AM Demodulator Passband . . . . . . . . . . . . . . . . . . . . . . .                     4-403
SSB AM Modulator Baseband . . . . . . . . . . . . . . . . . . . . . . . . .                   4-405
SSB AM Modulator Passband . . . . . . . . . . . . . . . . . . . . . . . . .                   4-408
Triggered Read From File . . . . . . . . . . . . . . . . . . . . . . . . . . . .              4-411
Triggered Write to File . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .           4-414
Uniform Noise Generator . . . . . . . . . . . . . . . . . . . . . . . . . . . .               4-416
Viterbi Decoder . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .       4-419
Voltage-Controlled Oscillator . . . . . . . . . . . . . . . . . . . . . . . . .               4-424
Windowed Integrator . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .           4-426
                                                                                                      ix
x   Contents
Preface
What Is the Communications Blockset? . . . . . . . . .xii
Typographical Conventions . . . . . . . . . . . . . . xx
Preface
xii
                                                                                   Related Products
Related Products
            The MathWorks provides several products that are especially relevant to the
            kinds of tasks you can perform with the Communications Blockset. They are
            listed in the table below. In particular, the Communications Blockset requires
            these products:
            • MATLAB®
            • Simulink
            • Signal Processing Toolbox
            • Communications Toolbox
            • DSP Blockset
            Note The toolboxes listed below all include functions that extend MATLAB’s
            capabilities. The blocksets all include blocks that extend Simulink’s
            capabilities.
Product Description
                                                                                               xiii
Preface
Product Description
xiv
                                                                                 Using This Guide
            Expected Background
            This guide assumes that you already have background knowledge in the
            subject of communications. If you do not yet have this background, then you
            can acquire it using a standard communications text or the books listed in one
            of this guide’s sections whose titles begin with “Selected Bibliography.”
                                                                                               xv
Preface
Chapter Description
xvi
                                                                        Configuration Information
Configuration Information
            To determine if the Communications Blockset is installed on your system, type
              ver
            Note For the most up-to-date information about system requirements, see
            the system requirements page, available in the support area of the
            MathWorks Web site (http://www.mathworks.com/support).
                                                                                             xvii
Preface
     Technical Conventions
                 This section discusses the terminology that this document uses to describe the
                 signal types that the Communications Blockset supports. To learn how the
                 blockset processes each kind of signal, see “Signal Support” on page 2-3.
                 • A scalar signal is one that contains a single element. The signal could be a
                   one-dimensional array with one element, or a matrix of size 1-by-1.
                 • A vector signal is one that contains one or more elements, arranged in a
                   series. The signal could be a one-dimensional array, a matrix that has
                   exactly one column, or a matrix that has exactly one row. The number of
                   elements in a vector is called its length or, sometimes, its width.
xviii
                                                               Technical Conventions
                                                                                 xix
Preface
     Typographical Conventions
                           This guide uses some or all of these conventions.
      Menu names, menu items, and         Boldface with an initial      Choose the File menu.
      controls                            capital letter
xx
                                                                                           1
Getting Started with the
Communications Blockset
The Example Model . . .      .   .   .   .   .   .   .   .   .   .   .   .   .   .   1-3
Overview of the Simulation   .   .   .   .   .   .   .   .   .   .   .   .   .   .   1-3
Building the Model . . . .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   1-5
Exploring the Model . . .    .   .   .   .   .   .   .   .   .   .   .   .   .   .   1-9
                             This chapter describes a particular example in detail, to help you get started
                             using the Communications Blockset. The description here assumes very little
                             prior knowledge of MATLAB or Simulink. It assumes that you have a basic
                             knowledge about communications subject matter. More specialized knowledge
                             about convolutional coding might be useful for the two parts marked
                             “Technical,” but is not essential for using the example to learn about the
                             Communications Blockset environment.
                             This chapter:
1-2
                                                                                   The Example Model
                  Tip In this document, you can click on blocks in the figure above to see more
                  information about how they behave within the example.
                                                                                                  1-3
1   Getting Started with the Communications Blockset
                             Then, the simulation decodes the convolutional code while trying to correct as
                             many noise-induced errors as possible. The decoding also involves some
                             intermediate steps to prepare the received data for the decoding block. Finally,
                             the simulation compares the decoded information to the original message
                             signal in order to compute and display an error rate.
                             The table below indicates which blocks from the Communications Blockset
                             appear in the model, the order they appear in the model, and the purpose each
                             one serves.
        Sampled Quantizer              Map received data to appropriate three-bit values to prepare for
        Encode                         soft-decision decoding.
Viterbi Decoder Decode the convolutional code using the Viterbi algorithm.
The model also uses some blocks from Simulink and the DSP Blockset:
1-4
                                                                 The Example Model
2 From the library’s File menu, select New and then select Model. This opens
  a new model window called untitled. You will build the example model in
  this window.
3 From the model window’s File menu, select Save. Choose an appropriate
  location and filename for the model you are about to build. You should save
  the model frequently while you are editing it, to avoid losing any work.
5 In the Comm Sources library, find the icon for the Bernoulli Random Binary
  Generator block. Drag it into the model window.
6 In the model window (not the Comm Sources library window), double-click
  on the Bernoulli Random Binary Generator icon. This opens the block’s
  parameter dialog box, also called its mask.
7 In the mask, type new values in the parameter fields to change the default
  parameter values to the ones shown in the right image below.
                                                                                1-5
1   Getting Started with the Communications Blockset
You have now placed and configured the first block for this example model.
                             • To open the main DSP Blockset library, type dsplib at the MATLAB prompt.
                             • To open the main Simulink library, type simulink3 at the MATLAB prompt.
                             Now, the basic procedure for placing blocks is similar to the procedure you used
                             for the Bernoulli Random Binary Generator block:
                             1 From the product’s main library, navigate to the library or sublibrary where
                                the block resides.
1-6
                                                                   The Example Model
Apply this basic procedure to the blocks listed below. For now, just place each
block anywhere within your model window. The next section gives tips for
connecting the blocks to each other.
Below are the blocks that you should gather and configure in your model
window. Each bullet lists the name and library location of the block, while each
subbullet indicates how to change the parameters from their default values.
                                                                                   1-7
1   Getting Started with the Communications Blockset
1-8
                                                                     The Example Model
  end. As an alternative to using the right mouse button, you can also use the
  left mouse button while holding down the Ctrl key.
• To delete a connection line, first select it by positioning the cursor along the
  line and pressing the mouse button. Then select Cut from the model
  window’s Edit menu.
• To undo the addition or deletion of a block or line, choose Undo from the
  model window’s Edit menu. You can also reverse the effect of an Undo
  command by using the Redo option from the model window’s Edit menu.
• To reverse the orientation of a block’s icon, select the block and choose Flip
  block from the model window’s Format menu. To rotate a block’s icon, select
  the block and choose Rotate block from the model window’s Format menu.
• “Read” the block diagram starting with the Bernoulli Random Binary
  Generator block in the upper left corner, following the arrows, and ending
  with the Display block in the center.
  Note that the block marked “Info” does not function during the simulation
  but rather links to the HTML version of this documentation.
• Double-click on any block to see its parameter dialog box. This dialog box
  briefly describes the block, shows its parameter values if the block has
  parameters, allows you to change any of the parameter values, and also
  includes a Help button that links to the detailed HTML reference page for
  the block.
• To see the blockset library in which any Communications Blockset block
  resides, right-click on the block, select Link options, and then select Go to
  library block. This shows you where to find the block if you later want to use
  it in your own model. The Link options function is inactive for built-in
  Simulink blocks, such as the Display block.
                                                                                     1-9
1   Getting Started with the Communications Blockset
1-10
                                                                      Components of the Example
           Since the Sample time parameter is 1 second, the block generates one binary
           number each second. Since the Probability of a zero parameter is 0.5, the
           block generates the bits so that 0 and 1 are equally probable. The Initial seed
           parameter initializes the random number generator; if you change the Initial
           seed parameter, then the block generates a different random sequence.
           Because the Frame-based outputs check box is checked, the block produces a
           frame-based scalar signal instead of a sample-based scalar signal. This is done
                                                                                             1-11
1   Getting Started with the Communications Blockset
1-12
                                                                Components of the Example
                                                                     First output
                                       +
Second output
Each summing node represents modulo-2 addition. Each box marked z-1
represents a memory register that holds the input values from previous sample
times. Since there are six memory registers, the output at a given time depends
on seven input values, including the current one. Thus the constraint length of
the code is 7. Since the code has one input and two outputs, the code rate is 1/2.
A pair of octal numbers called the code generator indicates the connections from
the memory registers to the modulo-2 summing nodes. The pair [171 133]
describes the encoder in the figure.
The Trellis structure parameter in the Convolutional Encoder block tells the
block which code to use when processing data. In this case, the poly2trellis
function, in the Communications Toolbox, converts the constraint length and
the pair of octal numbers into a valid trellis structure that the block uses in its
processing.
                                                                                      1-13
1   Getting Started with the Communications Blockset
                             Computing the Code Generator. The code generator is a 1-by-2 matrix of octal
                             numbers because the encoder has one input and two outputs. The first element
                             in the matrix indicates which input values contribute to the first output, and
                             the second element in the matrix indicates which input values contribute to the
                             second output.
                             For example, the first output in the encoder diagram is the modulo-2 sum of the
                             rightmost and the four leftmost elements in the diagram’s array of input
                             values. The seven-digit binary number 1111001 captures this information, and
                             is equivalent to the octal number 171. The octal number 171 thus becomes the
                             first entry of the code generator matrix. Here, each triplet of bits uses the
                             leftmost bit as the most significant bit.
                             The second output corresponds to the binary number 1011011, which is
                             equivalent to the octal number 133. The code generator is therefore [171 133].
1-14
                                                             Components of the Example
The Unbuffer block is a multirate block, which means that its input sample
rate differs from its output sample rate. In this case, the Unbuffer block
receives one length-two codeword every second and outputs a scalar every half
second.
Exact Sample Time of a Signal. To check the sample time of any signal in the
model, attach a Probe block to the signal’s line. The Probe block resides in
Simulink’s Signals & Systems library. Simply drag a Probe block into the
model window, attach its input port to the signal line you want to examine, and
then update the diagram by selecting Update diagram from the model
window’s Edit menu. The first number after the Ts or Tf notation on the Probe
block’s icon is the length of time between updates of that signal. (In the case of
frame-based signals, the Tf notation indicates that the number shown is the
period of the entire frame signal, not the period of each row of the frame.) For
more information, see the reference entry for the Probe block in the Simulink
documentation set. In this model, a Probe block attached to the line that leads
out of the Unbuffer block shows a sample time of 0.5 second.
Relative Sample Times in the Model. Another way to explore sample times is to turn
on the sample time coloring feature for the whole model. Use the Sample time
colors option in the model window’s Format menu to toggle the coloring
feature on and off. If sample time coloring is on, then blocks with the same
sample time have the same color. In this example, the Unbuffer block becomes
yellow because it is a multirate block. Also, the blocks before and after the
                                                                                     1-15
1   Getting Started with the Communications Blockset
                             Unbuffer block have different colors because they have different sample times.
                             For more information about sample times, refer to Simulink documentation.
1-16
                                                         Components of the Example
Gaussian noise to the data stream. The AWGN Channel block uses a Gaussian
distribution whose variance is determined using these mask parameters:
The AWGN Channel block can compute the variance in other ways as well, but
this example chooses this mode by setting the Mode parameter to Signal to
noise ratio (Es/No).
Like the Bernoulli Random Binary Generator block, the AWGN Channel block
requires an Initial seed parameter that initializes the random number
generator. If you change the Initial seed parameter, then the block generates
a different random sequence. The Initial seed parameters of the AWGN
Channel block and the Bernoulli Random Binary Generator block do not need
to match.
                                                                                1-17
1   Getting Started with the Communications Blockset
                             Note The input to the AWGN Channel block is a complex Simulink signal,
                             not a real one (See “Digression: Exploring Data Types” on page 1-16.). This
                             causes the AWGN Channel block to add complex noise, dividing the calculated
                             variance equally between the real and imaginary components.
                             1 Convert the received data signal to a real signal by removing its imaginary
                                part. It is reasonable to assume that the imaginary part of the received data
                                does not contain essential information, because the imaginary part of the
                                transmitted data is zero (ignoring small roundoff errors) and because the
                                channel noise is not very powerful.
                             2 Map the resulting real signal to an integer between 0 and 7, to prepare for
                                the soft-decision algorithm described in the next section.
1-18
                                                               Components of the Example
                                                                                       1-19
1   Getting Started with the Communications Blockset
1-20
                                                            Components of the Example
                                                                                    1-21
1   Getting Started with the Communications Blockset
1-22
                                                             Components of the Example
The table below lists the interpretations of the eight possible input values for
this example.
0 Most confident 0
3 Least confident 0
4 Least confident 1
7 Most confident 1
How Decoder’s Interpretation Influences Choice of Mapping. The table above helps
explain the design of the mapping process described in “Mapping the Received
Data” on page 1-18. For example, if the original message contains a 1, then the
Viterbi Decoder block makes a correct decision if and only if it receives an input
between 4 and 7. On the other hand, the 1 in the message gets mapped to -1 by
the BPSK Modulator Baseband block and to a number near -1 by the AWGN
Channel block. This means that the Sampled Quantizer Encode block should
be configured so as to map input numbers near -1 to output numbers between
4 and 7. As the Quantization partition and Quantization codebook
parameters for the Sampled Quantizer Encode block indicate, it maps input
numbers less than 0 to output numbers between 4 and 7. The schematic below
suggests how knowledge about the modulator, channel, and decoder decisions
(solid arrows) can help you design intermediate steps like the mapping
procedure (dashed arrow).
                                                                                     1-23
1   Getting Started with the Communications Blockset
                                                                                                      Decoder
                                         BPSK            AWGN             Mapping                     Interpretation
                                 1                -1            near -1             4, 5, 6, or 7                         1
                              Code bit          Symbol                               Decision value                    Recovered
                                                                                                                       Code bit
                                                                                                      Decoder
                                         BPSK            AWGN             Mapping                     Interpretation
                                 0                1             near 1              0, 1, 2, or 3                         0
                              Code bit          Symbol                               Decision value                    Recovered
                                                                                                                       Code bit
                             • The error rate, which is the quotient of the next two quantities below
                             • The total number of errors, that is, comparisons between unequal elements
                             • The total number of comparisons that the block made
                             Since the block’s Output data parameter is Port, the block sends its error
                             statistics to the output port. At the output port, a Display block receives and
                             displays the error statistics.
1-24
                                                            Components of the Example
Tip If you build your own model using the Error Rate Calculation block and
get an error rate close to .5 for binary data, then you should check whether the
Receive delay value is the correct delay for the model.
In this case, the Receive delay value is 49 samples, which is one more than the
Traceback depth value (48) in the Viterbi Decoder block. The extra
one-sample delay comes from the initial delay in the Buffer block. Because the
                                                                                   1-25
1   Getting Started with the Communications Blockset
                             Buffer block must collect two scalar samples before it can output one vector, its
                             first meaningful output occurs at time 1 second, not time 0.
                             Other Blocks
                             The Terminator and Info blocks do not perform a function during the
                             simulation, yet they serve other purposes.
                             Terminator Blocks
                             The Terminator blocks, from Simulink’s Signals & Systems library, attach to
                             output ports whose signals are not used in the rest of the model. Simulink
                             warns you if it finds an output port that is not attached to another block.
                             Terminator blocks prevent warnings from occurring.
                             Info Block
                             The block marked “Info” is a customized version of Simulink’s Model Info block.
                             It is customized so that double-clicking on it displays the HTML version of this
                             documentation in the Help browser.
1-26
                                                                        Learning More About the Example
 Change sequences of    Change the Initial seed parameter in the Bernoulli Random Binary
 random numbers         Generator block and/or the AWGN Channel block to another positive
                        integer.
 Change distribution    Change the Probability of a zero parameter in the Bernoulli Random
 of random numbers      Binary Generator block to another number between 0 and 1.
 in message signal
 Change amount of       Change the Es/No parameter in the AWGN Channel block to another
 noise in channel       real number. Alternatively, change the Mode parameter to Signal to
                        noise ratio (SNR) or Variance from mask and set the associated SNR
                        or Variance parameter, respectively.
 Change traceback       Change the Traceback depth parameter in the Viterbi Decoder block
 depth in decoder       to another positive integer, and also change the Receive delay
                        parameter in the Error Rate Calculation block to that integer plus one.
                                                                                                   1-27
1   Getting Started with the Communications Blockset
        Change convolutional       Change the Trellis structure parameters in both the Convolutional
        code                       Encoder and Viterbi Decoder blocks. For example, change it to
                                   poly2trellis(9,[753 561]).
                                   Note that if the new code rate is not 1/2, then you might need to change
                                   other parts of the model to ensure that the signal sizes and sample
                                   times are appropriate throughout the model.
        Change number of           Change the Number of soft decision bits in the Viterbi Decoder block,
        soft-decision bits         and also change the Quantization partition and Quantization
                                   codebook parameters in the Sampled Quantizer Encode block. For
                                   example, change these three parameters to 2, [-.5 0 .5], and
                                   [3 2 1 0], respectively.
1-28
                                                       Learning More About the Example
                                                                                    1-29
1   Getting Started with the Communications Blockset
1-30
                                                            2
Using the
Communications Blockset
Signal Support . . . . . . . . . . . . . . . . . . . 2-3
Interleaving . . . . . . . . . . . . . . . . . . . . 2-46
Channels . . . . . . . . . . . . . . . . . . . . . 2-84
Synchronization . . . . . . . . . . . . . . . . . . 2-90
2   Using the Communications Blockset
2-2
                                                                                         Signal Support
Signal Support
           As of Release 12, Simulink supports matrix signals in addition to
           one-dimensional arrays, and frame-based signals in addition to sample-based
           signals. This section describes how the Communications Blockset processes
           certain kinds of matrix and frame-based signals. To learn the terminology that
           this document uses to describe signal attributes, see “Technical Conventions”
           on page xviii.
           • Most blocks do not process matrix signals that have more than one row and
             more than one column.
           • In their numerical computations, blocks that process scalars do not
             distinguish between one-dimensional scalars and one-by-one matrices. If the
             block produces a scalar output from a scalar input, then the block preserves
             dimension.
           • If a block can process sample-based vectors, then:
           To find out whether a block processes scalar signals, vector signals, or both,
           refer to its entry in the reference section.
                                                                                                    2-3
2   Using the Communications Blockset
2-4
                                                                        Signal Support
• Most blocks do not process frame-based matrix signals that have more than
  one row and more than one column.
• Most blocks do not process frame-based row vectors and do not support
  multichannel functionality.
• Blocks that process continuous-time signals do not process frame-based
  inputs. Such blocks include the analog modulation blocks and the analog
  phase-locked loop blocks.
• Blocks for which a frame-based multichannel operation would make sense,
  even if the blocks do not currently support such operation, reject
  sample-based vectors because their interpretation is ambiguous.
  Frame-based vectors, however, have an unambiguous interpretation. Blocks
  interpret a frame-based row vector as multiple channels at a single instant
  of time, and interpret a frame-based column vector as multiple samples from
  a single time series (that is, a single channel).
• Some blocks, such as the digital baseband modulation blocks, can produce
  multiple output values for each value of a scalar input signal. In such cases,
  a frame-based one-by-one matrix input results in a frame-based column
  vector output. By contrast, a sample-based scalar input results in a
  sample-based scalar output with a smaller sample time.
                                                                                   2-5
2   Using the Communications Blockset
      Communications Sources
                             Every communication system contains one or more sources. You can find
                             sources in Simulink’s Sources library, in the DSP Blockset’s DSP Sources
                             library, and in the Communication Blockset’s Comm Sources library.
                             You can open the Comm Sources library by double-clicking on its icon in the
                             main Communications Blockset library (commlib), or by typing
                                commsource2
                             This section describes these capabilities, considering first random and then
                             nonrandom signals.
                             • Random bits
                             • Random integers
                             • Pseudorandom integers
                             • Random real numbers
                             This section discusses the sample time parameter, seed parameter and signal
                             attribute parameters that are common to many random source blocks, and
                             then discusses each category of random source.
2-6
                                                               Communications Sources
                                                                                    2-7
2   Using the Communications Blockset
                             The table below indicates how to set certain block parameters depending on the
                             kind of signal you want to generate.
                              Sample-based,
                              one-dimensional
                              Sample-based row
                              vector
                              Sample-based column
                              vector
Frame-based
2-8
                                                                Communications Sources
Example. The model in the figure below illustrates that one random source
block can produce various kinds of signals. The annotations in the model
indicate how each copy of the block is configured. Notice how each block’s
configuration affects the type of connector line (single or double) and the signal
dimensions that appear above each connector line. In the case of the Rayleigh
Noise Generator block, the first two block parameters (Sigma and Initial seed)
determine the number of channels in the output; for analogous indicators in
other random source blocks, see their individual reference entries.
Random Bits
The Bernoulli Random Binary Generator and Binary Vector Noise Generator
blocks both generate random bits, but differ in the way that you specify the
                                                                                     2-9
2   Using the Communications Blockset
                             Random Integers
                             The Random-Integer Generator and Poisson Int Generator blocks both
                             generate vectors containing random nonnegative integers. The
                             Random-Integer Generator block uses a uniform distribution on a bounded
                             range that you specify in the block mask. The Poisson Int Generator block uses
                             a Poisson distribution to determine its output. In particular, the output can
                             include any nonnegative integer.
                             Pseudorandom Symbols
                             The PN Sequence Generator block generates a sequence of pseudorandom
                             symbols. Such a sequence can be used in a pseudorandom scrambler and
                             descrambler, or in a direct-sequence spread-spectrum system.
2-10
                                                                Communications Sources
Distribution Block
The particular mask parameters depend on the block. See each block’s
individual entry in the reference section for details.
Nonrandom Signals
Blocks in the Comm Sources library can create nonrandom signals by reading
from a file or by simulating a voltage-controlled oscillator (VCO):
• The Triggered Read from File block reads a record from a file whenever an
  input trigger signal has a rising edge. You can set up the block to read at
  every rising edge of the trigger, or every kth rising edge of the trigger for a
  positive number k.
• A voltage-controlled oscillator is one part of a phase-locked loop. The
  Voltage-Controlled Oscillator and Discrete-Time VCO blocks implement
  voltage-controlled oscillators. These blocks produce continuous-time and
  discrete-time output signals, respectively. Each block’s output signal is
  sinusoidal, and changes its frequency in response to the amplitude
  variations of the input signal.
                                                                                    2-11
2   Using the Communications Blockset
       Communications Sinks
                             The Communications Blockset provides sinks and display devices that
                             facilitate analysis of communication system performance. You can open the
                             Comm Sinks library by double-clicking on its icon in the main Communications
                             Blockset library (commlib), or by typing
                                commsink2
                             This section describes these capabilities. Other sinks are in Simulink’s Sinks
                             library and in the DSP Blockset’s DSP Sinks library.
                             Writing to a File
                             The Triggered Write to File block writes data to a file whenever an input
                             trigger signal has a rising edge. You can set up the block to write at every rising
                             edge of the trigger, or every kth rising edge of the trigger for a positive number
                             k. The data can have an ASCII, integer, or floating-point format. If the
                             destination file already exists, then this block overwrites it. For more details,
                             see the reference page for the Triggered Write to File block.
                             For untriggered writing of MAT files, use Simulink’s To File block.
                             Error Statistics
                             The Error Rate Calculation block compares input data from a transmitter with
                             input data from a receiver. It calculates these error statistics:
                             • The error rate
                             • The number of error events
                             • The total number of input events
2-12
                                                                  Communications Sinks
The block reports these statistics either as final values in the workspace or as
running statistics at an output port.
You can use this block either with binary inputs to compute the bit error rate,
or with symbol inputs to compute the symbol error rate. You can use
frame-based or sample-based data. Also, if you use frame-based data, then you
can have the block consider certain samples and ignore others.
The example in the section “Examples of Convolutional Coding” on page 2-42
illustrates the use of the Error Rate Calculation block.
Eye Diagrams
An eye diagram is a simple and convenient tool for studying the effects of
intersymbol interference and other channel impairments in digital
transmission. When this blockset constructs an eye diagram, it plots the
received signal against time on a fixed-interval axis. At the end of the fixed
interval, it wraps around to the beginning of the time axis. Thus the diagram
consists of many overlapping curves. One way to use an eye diagram is to look
for the place where the “eye” is most widely opened, and use that point as the
decision point when demapping a demodulated signal to recover a digital
message.
The two blocks, Continuous-Time Eye and Scatter Diagrams and
Discrete-Time Eye and Scatter Diagrams, both produce eye diagrams. One
processes continuous-time signals and the other processes discrete-time
signals. The blocks also differ in the way you determine the decision timing: the
Continuous-Time Eye and Scatter Diagrams block draws a vertical line to
indicate a decision every time a trigger signal has a rising edge, whereas the
Discrete-Time Eye and Scatter Diagrams block draws a similar line
periodically according to a mask parameter.
An example appears in “Example: Using Eye and Scatter Diagrams” on
page 2-14.
Scatter Diagrams
A scatter diagram of a signal plots the signal’s value at a given decision point.
In the best case, the decision point should be at the time when the eye of the
signal’s eye diagram is the most widely open.
                                                                                    2-13
2   Using the Communications Blockset
                             To open the completed model, click here in the MATLAB Help browser. To
                             build the model, gather and configure these blocks:
                             • Sine Wave, in the DSP Blockset DSP Sources library (not the Sine Wave
                               block in the Simulink Sources library)
                               - Set Frequency to .502
                               - Set Output complexity to Complex
                             • Discrete-Time Eye and Scatter Diagrams
                               - Set Diagram type to Eye and Scatter Diagrams
                               - Set Sample time for plot update to 1/30
                             Running the model produces the plots below. In the eye diagram, one set of
                             traces represents the real part of the signal and the other set of traces
                             represents the imaginary part of the signal.
2-14
Communications Sinks
                2-15
2   Using the Communications Blockset
       Source Coding
                             Source coding, also known as quantization or signal formatting, is a way of
                             processing data in order to reduce redundancy or prepare it for later
                             processing. Analog-to-digital conversion and data compression are two
                             categories of source coding.
                             Source coding divides into two basic procedures: source encoding and source
                             decoding. Source encoding converts a source signal into a digital signal using a
                             quantization method. The symbols in the resulting signal are nonnegative
                             integers in some finite range. Source decoding recovers the original
                             information from the source coded signal.
                             For background material on the subject of source coding, see the works listed
                             in “Selected Bibliography for Source Coding” on page 2-26.
2-16
                                                                       Source Coding
Partitions
A quantization partition defines several contiguous, nonoverlapping ranges of
values within the set of real numbers. To specify a partition as a parameter,
list the distinct endpoints of the different ranges in a vector.
For example, if the partition separates the real number line into the sets
• {x: x ≤ 0}
• {x: 0< x ≤ 1}
• {x: 1 < x ≤ 3}
• {x: 3 < x}
Notice that the length of the partition vector is one less than the number of
partition intervals.
Codebooks
A codebook tells the quantizer which common value to assign to inputs that fall
into each range of the partition. Represent a codebook as a vector whose length
is the same as the number of partition intervals. For example, the vector
   [-1,0.5,2,3]
Quantizing a Signal
This section shows how the Sampled Quantizer Encode, Enabled Quantizer
Encode, and Quantizer Decode blocks use the partition and codebook
parameters. (The Enabled Quantizer Encode block does not appear in an
example, but its behavior is similar to that of the Sampled Quantizer Encode
                                                                                  2-17
2   Using the Communications Blockset
                             To open the completed model, click here in the MATLAB Help browser. To
                             build the model, gather and configure these blocks:
2-18
                                                                        Source Coding
To open the completed model, click here in the MATLAB Help browser. To
build the model, gather and configure these blocks:
• Sine Wave, in the Simulink Sources library (not the Sine Wave block in the
  DSP Blockset DSP Sources library)
                                                                                    2-19
2   Using the Communications Blockset
                             To open the completed model, click here in the MATLAB Help browser. To
                             build the model, gather and configure these blocks:
2-20
                                                                       Source Coding
DPCM Terminology
To determine an encoder for such a quantizer, you must supply not only a
partition and codebook as described in “Representing Quantization
Parameters” on page 2-17, but also a predictor. The predictor is a function that
the DPCM encoder uses to produce the educated guess at each step. Instead of
quantizing x itself, the encoder quantizes the predictive error, which is the
difference between the educated guess and the actual value. The special case
when the numerator is linear and the denominator is 1 is called delta
modulation.
                                                                                   2-21
2   Using the Communications Blockset
                             For more information about how DPCM works, see [1] in “Selected
                             Bibliography for Source Coding” on page 2-26, or look underneath the masks of
                             the DPCM Encoder and DPCM Decoder blocks.
                             Representing Predictors
                             This blockset implements predictors using an IIR filter. Just as you can specify
                             a filter using a rational function of z-1, you specify the predictor by giving its
                             numerator and denominator. In block masks, the numerator and denominator
                             are vectors that list the coefficients in order of ascending powers of z-1.
                             The numerator’s constant term must be zero. This makes sense conceptually
                             because the filter’s output is meant to predict the present signal without
                             actually knowing its value.
                             In most applications, the denominator is the constant function 1.
2-22
                                                                       Source Coding
To open the completed model, click here in the MATLAB Help browser. To
build the model, gather and configure these blocks:
• Sine Wave, in the DSP Blockset DSP Sources library (not the Sine Wave
  block in the Simulink Sources library)
  - Set Frequency to 3
  - Set Sample time to .01
• DPCM Encoder
  - Set Predictor numerator to [0, 1]
  - Set Quantization partition to [-10:9]/10
  - Set Quantization codebook to [-10:10]/10
  - Set Sample time to .01
• DPCM Decoder
  - Set Predictor numerator, Quantization codebook, and Sample time to
    the values given for the DPCM Encoder block
• Terminator, in the Simulink Signals & Systems library
• Scope, in the Simulink Sinks library
  - After double-clicking on the block to open it, click on the Properties icon
    and set Number of axes to 2.
Connect the blocks as shown in the figure. Also, from the model window’s
Simulation menu, choose Simulation parameters; then in the Simulation
Parameters dialog box, set Stop time to 1.
Running the model produces scope images similar to those below. (To make the
axis ranges and titles exactly match those below, right-click on each plot area
in the scope and select Axes properties.)
                                                                                  2-23
2   Using the Communications Blockset
                             Companding a Signal
                             In certain applications, such as speech processing, it is common to use a
                             logarithm computation, called a compressor, before quantizing. The inverse
                             operation of a compressor is called an expander. The combination of a
                             compressor and expander is called a compander.
                             This blockset supports two kinds of companders: µ-law and A-law companders.
                             The reference pages for the A-Law Compressor, A-Law Expander, Mu-Law
                             Compressor, and Mu-Law Expander blocks list the relevant expander and
                             compressor laws.
                             Now, the model in the figure below performs two computations. One
                             computation uses the Sampled Quantizer Encode block with a partition
                             consisting of length-one intervals. The second computation uses the Mu-Law
                             Compressor block to implement a µ-law compressor, the Sampled Quantizer
2-24
                                                                       Source Coding
Encode block to quantize the compressed data and, finally, the Mu-Law
Expander block to expand the quantized data.
To open the completed model, click here in the MATLAB Help browser. To
build the model, gather and configure these blocks:
                                                                                2-25
2   Using the Communications Blockset
                                distor = sum((nocompander-sig).^2)/length(sig);
                                distor2 = sum((withcompander-sig).^2)/length(sig);
                                [distor distor2]
ans =
0.5348 0.0397
                             This output shows that the distortion is smaller for the second scheme. This is
                             because equal-length intervals are well suited to the logarithm of the data but
                             not as well suited to the data itself.
2-26
                                                                                     Block Coding
Block Coding
           Error-control coding techniques detect and possibly correct errors that occur
           when messages are transmitted in a digital communication system. To
           accomplish this, the encoder transmits not only the information symbols but
           also extra redundant symbols. The decoder interprets what it receives, using
           the redundant symbols to detect and possibly correct whatever errors occurred
           during transmission. You might use error-control coding if your transmission
           channel is very noisy or if your data is very sensitive to noise. Depending on the
           nature of the data or noise, you might choose a specific type of error-control
           coding.
           Block coding is a special case of error-control coding. Block coding techniques
           maps a fixed number of message symbols to a fixed number of code symbols. A
           block coder treats each block of data independently and is a memoryless device.
           For background material on the subject of block coding, see the works listed in
           “Selected Bibliography for Block Coding” on page 2-39.
                                                                                                2-27
2   Using the Communications Blockset
Cyclic codes
BCH codes
                             Note The blocks in this blockset are designed for error-control codes that use
                             an alphabet having 2 or 2m symbols.
2-28
                                                                         Block Coding
                                                                                 2-29
2   Using the Communications Blockset
                             The figure below illustrates this situation. In this example, the encoder
                             receives a four-bit message and produces a five-bit codeword at time 0. It
                             repeats this process with a new message at time 1.
                                 0      0                      0   1
                                 1      1                      0   0
                                          message   Encoder    1   1    code
                                 1      0
                                 0      0                      1   0
                                                               0   0
                                t=1 t=0
                                                              t=1 t=0
                             For all coding techniques except Reed-Solomon, the message vector must have
                             length K and the corresponding code vector has length N. For Reed-Solomon
                             codes, the message vector must have length M*K and the corresponding code
                             vector has length M*N. Here M is an integer greater than or equal to 3 that
                             satisfies N = 2M-1.
                             If the input to a block coding block is a frame-based vector, then it must be a
                             column vector instead of a row vector.
                             To produce sample-based messages in the binary format, you can configure the
                             Bernoulli Random Binary Generator block so that its Probability of a zero
                             parameter is a vector whose length is that of the signal you want to create. To
                             produce frame-based messages in the binary format, you can configure the
                             same block so that its Probability of a zero parameter is a scalar and its
                             Samples per frame parameter is the length of the signal you want to create.
                             Using Serial Signals. If you prefer to structure messages and codewords as scalar
                             signals, where several samples jointly form a message word or codeword, then
                             you can use the Buffer and Unbuffer blocks in the DSP Blockset. Be aware that
                             buffering involves latency and multirate processing. See the reference page for
                             the Buffer block for more details. If your model computes error rates, then the
                             initial delay in the coding-buffering combination influences the Receive delay
                             parameter in the Error Rate Calculation block. If you are unsure about the
                             sample times of signals in your model, then selecting Sample time colors from
                             the model’s Format menu, or attaching Probe blocks (from the Simulink
                             Signals & Systems library) to connector lines might help.
2-30
                                                                         Block Coding
Note In this context, Simulink expects the first bit to be the least significant
bit in the symbol. “First” means the smallest index in a vector or the smallest
time for a series of scalars.
The figure below illustrates the equivalence between binary and integer
signals for a Reed-Solomon encoder. The case for the decoder would be similar.
  t=0                           t=0
   0                             6
   1                             7
   1                             4
   1                             0
   1              Vector of 5    4                Integer format
   1       three-bit symbols                          versus
   0                                              Binary format
   0 Vector of 3*5 bits
   1
   0
   0
   0
   0
   0
   1
To produce sample-based messages in the integer format, you can configure the
Random-Integer Generator block so that M-ary number and Initial seed
parameters are vectors of the desired length and all entries of the M-ary
number vector are 2M. To produce frame-based messages in the integer
format, you can configure the same block so that its M-ary number and Initial
seed parameters are scalars and its Samples per frame parameter is the
length of the signal you want to create.
                                                                                   2-31
2   Using the Communications Blockset
                             To open the completed model, click here in the MATLAB Help browser. To
                             build the model, gather and configure these blocks:
2-32
                                                                       Block Coding
Connect the blocks as in the figure above. Also, use the Signal dimensions
feature from the model window’s Format menu. After possibly updating the
diagram if necessary (Update diagram from the Edit menu), the connector
lines show relevant signal attributes. The connector lines are double lines to
indicate frame-based signals, and the annotations next to the lines show that
the signals are column vectors of appropriate sizes.
To open the completed model, click here in the MATLAB Help browser. To
build the model, gather and configure these blocks:
                                                                                 2-33
2   Using the Communications Blockset
                             • Integer-Input RS Encoder
                               - Set Codeword length N to 15
                             • Gain, in the Simulink Math library
                               - Set Gain to [0 0 0 0 0, ones(1,10)]
                             • Integer-Output RS Decoder
                               - Set Codeword length N to 15
                             • Scope, in the Simulink Sinks library. Get two copies of this block.
                             • Sum, in the Simulink Math library
                               - Set List of signs to |-+
                             Connect the blocks as in the figure above. Also, from the model window’s
                             Simulation menu, choose Simulation parameters; then in the Simulation
                             Parameters dialog box, set Stop time to 500.
                             The vector length numbers appear on the connecting lines only if you select
                             Signal dimensions from the model’s Format menu. Notice that the encoder
                             accepts a vector of length 5 (which is K in this case) and produces a vector of
                             length 15 (which is N in this case). The decoder does the opposite. Also, the
                             Initial seed parameter in the Random-Integer Generator block is a vector of
                             length 5 because it must generate a message word of length 5.
                             Running the model produces the scope images below. Your plot of the error
                             counts might differ somewhat, depending on your Initial seed value in the
                             Random-Integer Generator block. (To make the axis range exactly match that
                             of the left scope in the figure, right-click on the plot area in the scope and select
                             Axes properties.)
2-34
                                                                                                        Block Coding
Difference Between Original Message and Recovered Message Number of Errors Before Correction
                           The plot on the right is the number of errors that the decoder detected while
                           trying to recover the message. Often the number is five because the Gain block
                           replaces the first five symbols in each codeword with zeros. However, the
                           number of errors is less than five whenever a correct codeword contains one or
                           more zeroes in the first five places.
                           The plot on the left is the difference between the original message and the
                           recovered message; since the decoder was able to correct all errors that
                           occurred, each of the five data streams in the plot is zero.
                                                                                                                2-35
2   Using the Communications Blockset
                             Generator Matrix. The process of encoding a message into an [N,K] linear block
                             code is determined by a K-by-N generator matrix G. Specifically, a 1-by-K
                             message vector v is encoded into the 1-by-N codeword vector vG. If G has the
                             form [Ik, P] or [P, Ik], where P is some K-by-(N-K) matrix and Ik is the K-by-K
                             identity matrix, then G is said to be in standard form. (Some authors, such as
                             Clark and Cain [1], use the first standard form, while others, such as Lin and
                             Costello [2], use the second.) The linear block coding blocks in this blockset
                             require the Generator matrix mask parameter to be in standard form.
                             Decoding Table. A decoding table tells a decoder how to correct errors that might
                             have corrupted the code during transmission. Hamming codes can correct any
                             single-symbol error in any codeword. Other codes can correct, or partially
                             correct, errors that corrupt more than one symbol in a given codeword.
                             The Binary Linear Decoder block allows you to specify a decoding table in the
                             Error-correction truth table parameter. Represent a decoding table as a
                             matrix with N columns and 2N-K rows. Each row gives a correction vector for
                             one received codeword vector.
                             If you do not want to specify a decoding table explicitly, then set that parameter
                             to 0. This causes the block to compute a decoding table using the syndtable
                             function in the Communications Toolbox.
                             Cyclic Codes
                             For cyclic codes, the codeword length N must have the form 2M-1, where M is
                             an integer greater than or equal to 3.
                             Generator Polynomials. Cyclic codes have special algebraic properties that allow
                             a polynomial to determine the coding process completely. This so-called
                             generator polynomial is a degree-(N-K) divisor of the polynomial xN-1. Van Lint
                             [4] explains how a generator polynomial determines a cyclic code.
                             The Binary Cyclic Encoder and Binary Cyclic Decoder blocks allow you to
                             specify a generator polynomial as the second mask parameter, instead of
2-36
                                                                          Block Coding
If you do not want to specify a generator polynomial, then set the second mask
parameter to the value of K.
Hamming Codes
For Hamming codes, the codeword length N must have the form 2M-1, where
M is an integer greater than or equal to 3. The message length K must equal
N-M.
BCH Codes
For BCH codes, the codeword length N must have the form 2M-1, where M is
an integer greater than or equal to 3. The message length K can have only
particular values. To see which values of K are valid for a given N, use the
bchpoly function in the Communications Toolbox. For example, in the output
below, the second column lists all possible message lengths that correspond to
a codeword length of 31. The third column lists the corresponding
error-correction capabilities.
   params = bchpoly(31)
                                                                                    2-37
2   Using the Communications Blockset
params =
                                        31   26     1
                                        31   21     2
                                        31   16     3
                                        31   11     5
                                        31    6     7
                             Error Information. The BCH Decoder block allows you to state the
                             error-correction capability of the code, as the Error-correction capability T
                             parameter. Providing the value here speeds the computation. If you do not
                             know the code’s error-correction capability, then setting this parameter to zero
                             causes the block to calculate the error-correction capability when initializing.
                             You can find out the error-correction capability using the bchpoly function in
                             the Communications Toolbox.
                             The BCH Decoder block also returns error-related information during the
                             simulation. The second output signal indicates the number of errors that the
                             block detected in the input codeword. A negative integer in the second output
                             indicates that the block detected more errors than it could correct using the
                             coding scheme.
                             Reed-Solomon Codes
                             Reed-Solomon codes are useful for correcting errors that occur in bursts. The
                             codeword length N of a Reed-Solomon code must have the form 2M-1, where M
                             is an integer greater than or equal to 3. The error correction capability of a
                             Reed-Solomon code is floor((N-K)/2). Since N is an odd number, the coding
                             is more efficient when the message length K is also odd.
                             Effect of Nonbinary Symbols. One difference between Reed-Solomon codes and the
                             other codes supported in this blockset is that Reed-Solomon codes process
                             symbols in GF(2M) instead of GF(2). Each such symbol is specified by M bits.
                             The nonbinary nature of the Reed-Solomon code symbols causes the
                             Reed-Solomon blocks to differ from other coding blocks in these ways:
                             • You can use the integer format, via the Integer-Input RS Encoder and
                               Integer-Output RS Decoder blocks.
2-38
                                                                         Block Coding
• The binary format forms a message from M*K (not K) samples and a
  codeword from M*N (not N) samples.
• The binary format expects the vector lengths to be M*K (not K) for messages
  and M*N (not N) for codewords.
                                                                                   2-39
2   Using the Communications Blockset
       Convolutional Coding
                             Convolutional coding is a special case of error-control coding. Unlike a block
                             coder, a convolutional coder is not a memoryless device. Even though a
                             convolutional coder accepts a fixed number of message symbols and produces a
                             fixed number of code symbols, its computations depend not only on the current
                             set of input symbols but on some of the previous input symbols.
                             For background material on the subject of convolutional coding, see the works
                             listed in “Selected Bibliography for Convolutional Coding” on page 2-45.
2-40
                                                                 Convolutional Coding
• If you design your encoder using a diagram with shift registers and modulo-2
  adders, then you can compute the code generator polynomial matrix and
  subsequently use the poly2trellis function (in the Communications
  Toolbox) to generate the corresponding trellis structure mask parameter
  automatically. For an example, see “Example: A Rate 2/3 Feedforward
  Convolutional Encoder” on page 2-42.
• If you design your encoder using a trellis diagram, then you can construct the
  trellis structure in MATLAB and use it as the mask parameter.
To use this encoder with one of the convolutional coding blocks, simply place a
poly2trellis command such as
   poly2trellis(5,[35 31]);
                                                                                   2-41
2   Using the Communications Blockset
2-42
                                                                  Convolutional Coding
shift register, including the current input bits. Counting memory spaces in
each shift register in the diagram and adding one for the current inputs leads
to a constraint length of [5 4].
To determine the code generator parameter as a 2-by-3 matrix of octal
numbers, use the element in the ith row and jth column to indicate how the ith
input contributes to the jth output. For example, to compute the element in the
second row and third column, notice that the leftmost and two rightmost
elements in the second shift register of the diagram feed into the sum that
forms the third output. Capture this information as the binary number 1011,
which is equivalent to the octal number 13. The full value of the code generator
matrix is [27 33 0; 0 5 13].
To use the constraint length and code generator parameters in the
Convolutional Encoder and Viterbi Decoder blocks, use the poly2trellis
function to convert those parameters into a trellis structure.
How to Simulate the Encoder. Below is a model that simulates this encoder.
To open the completed model, click here in the MATLAB Help browser. To
build the model, gather and configure these blocks:
                                                                                   2-43
2   Using the Communications Blockset
                             Notes on the Model. The matrix size annotations appear on the connecting lines
                             only if you select Signal Dimensions from the model’s Format menu. Notice
                             that the encoder accepts a 2-by-1 frame-based vector and produces a 3-by-1
                             frame-based vector, while the decoder does the opposite. The Samples per
                             frame parameter in the first Bernoulli Random Binary Generator block is 2
                             because the block must generate a message word of length 2, while that
                             parameter in the second Bernoulli Random Binary Generator block is 3
                             because the block must perturb a codeword of length 3.
                             Also notice that the Receive delay parameter in the Error Rate Calculation
                             block is 68, which is the vector length (2) of the recovered message times the
                             Traceback depth value (34) in the Viterbi Decoder block. If you examined the
                             transmitted and received signals as matrices in the MATLAB workspace, then
                             you would see that the first 34 rows of the recovered message consists of zeros,
2-44
                                                                Convolutional Coding
while subsequent rows are the decoded messages. Thus the delay in the
received signal is 34 vectors of length 2, or 68 samples.
Running the model produces display output similar to that shown in the figure.
The three numbers in the Display block indicate the error rate, the total
number of errors, and the total number of comparisons that the Error Rate
Calculation block made during the simulation. (The first two numbers vary
depending on your Initial seed value in the Bernoulli Random Binary
Generator blocks.) Because the simulation runs from time 0 to time 500, the
block compares 501 pairs of vectors of length 2, hence 1002 pairs of samples.
However, 68 of the received samples constitute the initial delay, so the total
number of comparisons by the end of the simulation is 934.
[3] Clark, George C. Jr. and J. Bibb Cain. Error-Correction Coding for Digital
Communications. New York: Plenum Press, 1981.
[4] Gitlin, Richard D., Jeremiah F. Hayes, and Stephen B. Weinstein. Data
Communications Principles. New York: Plenum, 1992.
[5] Viterbi, Andrew J. “An Intuitive Justification and a Simplified
Implementation of the MAP Decoder for Convolutional Codes.” IEEE Journal
on Selected Areas in Communications, vol. 16, February 1998. 260-264.
                                                                                 2-45
2   Using the Communications Blockset
       Interleaving
                             An interleaver permutes symbols according to a mapping. A corresponding
                             deinterleaver uses the inverse mapping to restore the original sequence of
                             symbols. Interleaving and deinterleaving can be useful for reducing errors
                             caused by burst errors in a communication system.
                             You can open the Interleaving library by double-clicking on its icon in the main
                             Communications Blockset library (commlib), or by typing
                                          comminterleave2
                             Block Interleavers
                             A block interleaver accepts a set of symbols and rearranges them, without
                             repeating or omitting any of the symbols in the set. The number of symbols in
                             each set is fixed for a given interleaver. The interleaver’s operation on a set of
                             symbols is independent of its operation on all other sets of symbols.
2-46
                                                                              Interleaving
The Random Interleaver block chooses a permutation table randomly using the
Initial seed parameter that you provide in the block mask. By using the same
Initial seed value in the corresponding Random Deinterleaver block, you can
restore the permuted symbols to their original ordering.
The Algebraic Interleaver block uses a permutation table that is algebraically
derived. It supports Takeshita-Costello interleavers and Welch-Costas
interleavers. These interleavers are described in [4].
Convolutional Interleavers
A convolutional interleaver consists of a set of shift registers, each with a fixed
delay. In a typical convolutional interleaver, the delays are nonnegative
integer multiples of a fixed integer (although a general multiplexed interleaver
allows arbitrary delay values). Each new symbol from the input signal feeds
into the next shift register and the oldest symbol in that register becomes part
of the output signal. The schematic below depicts the structure of a
convolutional interleaver by showing the set of shift registers and their delay
values D(1), D(2),...,D(N). The blocks in this library have mask parameters that
indicate the delay for each shift register. The delay is measured in samples.
                                                                                      2-47
2   Using the Communications Blockset
z-D(1)
z-D(N)
2-48
                                                                            Interleaving
are placed in the array. See the reference page for the Helical Interleaver block
for more details and an example.
Note For proper synchronization, the delay in your model between the
interleaver output and the deinterleaver input must be an integer multiple of
the number of shift registers. You can use the Integer Delay block in the DSP
Blockset to adjust delays manually, if necessary.
      s(C – 1)
   CN --------------------
                         -
              N
where C is the Number of columns in helical array parameter, N is the
Group size parameter, and s is the Helical array step size parameter.
                                                                                    2-49
2   Using the Communications Blockset
                             To open the completed model, click here in the MATLAB Help browser. To
                             build the model, gather and configure these blocks:
2-50
                                                                            Interleaving
comparison =
        0       0     -1
        1      -2     -2
        2      -3     -3
        3       3     -1
        4      -2     -2
        5      -3     -3
        6       6     -1
        7       1     -2
        8      -3     -3
        9       9     -1
       10       4     -2
       11      -3     -3
       12      12      0
       13       7      1
       14       2      2
       15      15      3
       16      10      4
       17       5      5
       18      18      6
       19      13      7
       20       8      8
In this output, the first column contains the original symbol sequence. The
second column contains the interleaved sequence, while the third column
contains the restored sequence.
The negative numbers in the interleaved and restored sequences come from the
interleaving blocks’ initial conditions, not from the original data. The first of
the original symbols appears in the restored sequence only after a delay of 12
symbols. The delay of the interleaver-deinterleaver combination is the product
of the number of shift registers (3) and the maximum delay among all shift
registers (4).
                                                                                    2-51
2   Using the Communications Blockset
                             [2] Clark, George C. Jr. and J. Bibb Cain. Error-Correction Coding for Digital
                             Communications. New York: Plenum Press, 1981.
                             [3] Forney, G., D., Jr. “Burst-Correcting Codes for the Classic Bursty Channel.”
                             IEEE Transactions on Communications, vol. COM-19, October 1971. 772-781.
                             [4] Heegard, Chris and Stephen B. Wicker. Turbo Coding. Boston: Kluwer
                             Academic Publishers, 1999.
                             [5] Ramsey, J. L. “Realization of Optimum Interleavers.” IEEE Transactions on
                             Information Theory, IT-16 (3), May 1970. 338-345.
                             [6] Takeshita, O. Y. and D. J. Costello, Jr. “New Classes Of Algebraic
                             Interleavers for Turbo-Codes.” Proc. 1998 IEEE International Symposium on
                             Information Theory, Boston, Aug. 16-21, 1998. 419.
2-52
                                                                              Analog Modulation
Analog Modulation
           In most media for communication, only a fixed range of frequencies is available
           for transmission. One way to communicate a message signal whose frequency
           spectrum does not fall within that fixed frequency range, or one that is
           otherwise unsuitable for the channel, is to alter a transmittable signal
           according to the information in your message signal. This alteration is called
           modulation, and it is the modulated signal that you transmit. The receiver
           then recovers the original signal through a process called demodulation. This
           section describes how to modulate and demodulate analog signals with the
           Communications Blockset. After giving instructions for accessing the analog
           modulation blocks, it goes on to discuss these topics:
                                                                                              2-53
2   Using the Communications Blockset
                             Single-sideband                  Double-sideband
                             suppressed-carrier               suppressed-carrier
                             (SSB)                            (DSB-SC)
                             where Y1 and Y2 are amplitude terms, fc is the carrier frequency and θ is the
                             carrier signal’s initial phase. A baseband simulation recognizes that this
                             equals
                                                               jθ   j2πf c t
                                Re  ( Y 1 ( t ) + jY 2 ( t ) )e  e
                                      î                             þ
2-54
                                                                     Analog Modulation
and models only the part inside the curly brackets. Here j is the square root of
-1. The complex vector y is a sampling of the complex signal (Y1(t) + jY2(t)) ejθ.
Example Using a Modulator. In the figure below, both Probe blocks show a sample
time of 1 second in their icons. (The display Ts:[1 0] indicates a sample time
of 1 second and a sample time offset of 0.) Setting the Sample time parameter
in the FM Modulator Baseband block to 1 is appropriate because the input to
this block also has a sample time of 1 second.
                                                                                     2-55
2   Using the Communications Blockset
                             To open the completed model, click here in the MATLAB Help browser. To
                             build the model, gather and configure these blocks:
                             • Sine Wave, in the Simulink Sources library (not the Sine Wave block in the
                               DSP Blockset DSP Sources library)
                               - Set Sample time to 1
                             • FM Modulator Baseband, in the Analog Baseband sublibrary of the
                               Modulation library
                               - Set Sample time to 1
                             • Two copies of Probe, in the Simulink Signals & Systems library
                               - Uncheck all boxes except Probe sample time
                             Connect the blocks as in the figure. Then select Update diagram from the
                             model window’s Edit menu, which updates the display on each Probe block’s
                             icon. (Running the model is not instructive because it does not represent a
                             complete system.)
2-56
                                                                      Analog Modulation
3 Set the Max step size and Initial step size parameters to numerical values
  (that is, not auto) that are appropriate for your model.
Example Using Step Size Relative to Carrier Period. The model below illustrates why
the simulation step size in a passband simulation must be appropriate for a
given carrier frequency. The first Scope image shows the correct result of
modulating a constant signal using double-sideband suppressed-carrier
amplitude modulation, while the second Scope image shows incorrect results.
The incorrect results occur because the simulation step size is too large relative
to the modulation carrier frequency.
In this case, the DSBSC AM Modulator Passband block uses a Carrier
frequency parameter of 100. That is, the carrier’s period is .01 second and an
appropriate simulation step size is no larger than .005. Therefore, a simulation
step size of .01 second is too large to satisfy the Nyquist criterion. However, a
simulation step size of .001 second is sufficiently small.
                                                                                      2-57
2   Using the Communications Blockset
                                                 Correct results;
                                         simulation step size of
                                        .001 is small compared
                                               to carrier period
                                               Incorrect results;
                                            simulation step size
                                              of .01 is too large
                             To open the completed model, click here in the MATLAB Help browser. To
                             build the model, gather these blocks with their default parameters:
                             • Constant, in the Simulink Sources library
                             • DSBSC AM Modulator Passband, in the Analog Passband sublibrary of the
                               Modulation library
                             • Scope, in the Simulink Sinks library
                             Connect the blocks as in the figure. Also, from the model window’s Simulation
                             menu, choose Simulation parameters; then in the Simulation Parameters
                             dialog box, set Stop time to 1.
2-58
                                                                     Analog Modulation
To generate the correct results as in the first Scope image in the figure, return
to the Simulation Parameters dialog box and set both the Max step size and
Initial step size parameters to .001. Then run the model and use the Scope
window’s zooming tools to study the sinusoidal output curve. You can also
generate incorrect results as in the second Scope image in the figure, by
changing the Max step size and Initial step size parameters to .01 and
running the model again.
Before building the model, first execute this command at the MATLAB prompt.
   [num,den] = butter(2,25*.01); % Design Butterworth filter.
                                                                                     2-59
2   Using the Communications Blockset
                             Here, 2 is the order of the Butterworth filter, 25 is the carrier signal frequency
                             and .01 is the sample time of the signal in Simulink. The variables num and den
                             represent the numerator and denominator, respectively, of the filter’s transfer
                             function. These variables reside in the MATLAB workspace, where Simulink
                             can access them during the simulation. The butter function is in the Signal
                             Processing Toolbox.
                             Now to open the completed model, click here in the MATLAB Help browser. To
                             build the model, gather and configure these blocks:
                               - After double-clicking on the block to open it, click on the Properties icon
                                 and set Number of axes to 2
                             Connect the blocks as in the figure. Running the model produces the scope
                             image below. The image reflects the original and recovered signals, with a
                             moderate filter cutoff.
2-60
                                                                        Analog Modulation
Other Filter Cutoffs. To see the effect of a lowpass filter with a higher cutoff
frequency, type
   [num,den] = butter(2,25*.01*3.9); % Design Butterworth filter.
at the MATLAB prompt and then run the simulation again. The new result is
the left image in the figure below. The higher cutoff frequency allows the
carrier signal to interfere with the demodulated signal.
To see the effect of a lowpass filter with a lower cutoff frequency, type
   [num,den] = butter(2,25*.01/4); % Design Butterworth filter.
at the MATLAB prompt and then run the simulation again. The new result is
the right image in the figure below. The lower cutoff frequency narrows the
bandwidth of the demodulated signal.
                                                                                     2-61
2   Using the Communications Blockset
                             To open the completed model, click here in the MATLAB Help browser. To
                             build the model, gather and configure these blocks:
                             • Sine Wave, in the DSP Blockset DSP Sources library (not the Sine Wave
                               block in the Simulink Sources library)
                               - Set Frequency to 1
2-62
                                                                 Analog Modulation
Connect the blocks as in the figure. Also, from the model window’s Simulation
menu, choose Simulation parameters; then in the Simulation Parameters
dialog box, set Stop time to 5. Running the model produces the scope image
below.
                                                                                2-63
2   Using the Communications Blockset
       Digital Modulation
                             Like analog modulation, digital modulation alters a transmittable signal
                             according to the information in a message signal. However, in this case, the
                             message signal is a discrete-time signal that can assume finitely many values.
                             This section describes how to modulate and demodulate digital signals with the
                             Communications Blockset. After giving instructions for accessing the digital
                             modulation blocks, it goes on to discuss these topics:
                             For background material on the subject of digital modulation, see the works
                             listed in “Selected Bibliography for Digital Modulation” on page 2-83.
2-64
                                                                  Digital Modulation
The Digital Baseband and Digital Passband libraries have sublibraries of their
own. You can open each of these sublibraries by double-clicking on the icon
listed in the table below, or by typing its name at the MATLAB prompt.
                                                                                 2-65
2   Using the Communications Blockset
2-66
                                                                   Digital Modulation
                                                                                2-67
2   Using the Communications Blockset
2-68
                                                                     Digital Modulation
In binary input mode, the Constellation ordering (or Symbol set ordering,
depending on the type of modulation) parameter indicates how the block maps
a group of K input bits to a corresponding integer. If this parameter is set to
Binary, then the block maps [u(1) u(2) ... u(K)] to the integer
   å u ( i )2 K – i
   i=1
and subsequently behaves as if this integer were the input value. Notice that
u(1) is the most significant bit.
For example, if M = 8, Constellation ordering (or Symbol set ordering) is set
to Binary, and the binary input word is [1 1 0], then the block internally
converts [1 1 0] to the integer 6. The block produces the same output as in the
case when the input is 6 and the Input type parameter is Integer.
If Constellation ordering (or Symbol set ordering) is set to Gray, then the
block uses a Gray-coded arrangement. The explicit mapping is described in
“Algorithm” on the reference page for the M-PSK Modulator Baseband block.
                                                                                    2-69
2   Using the Communications Blockset
                             they occur. If more than one situation applies to a given model, then the
                             separate delays are additive.
2-70
                                                                      Digital Modulation
Note If this model used the OQPSK method instead of DBPSK, then the
proper Receive delay parameter would be 2 instead of 1.
To open the completed model, click here in the MATLAB Help browser. To
build the model, gather and configure these blocks:
                                                                                    2-71
2   Using the Communications Blockset
        Modulation        Sample-based      Output vector is a scalar. Output sample time is 1/S times the
                                            input sample time.
2-72
                                                                                     Digital Modulation
 Demodulation   Frame-based      Number of integers or binary words in the output vector is 1/S
                                 times the number of samples in the input vector. Output
                                 sample time equals the input sample time.
 Demodulation   Sample-based     Output signal contains one integer or one binary word.
                                 Output sample time is S times the input sample time.
                   Digital passband blocks can also process upsampled data, but only as an
                   intermediate internal format. For more information about this, see the
                   description of the Baseband samples per symbol parameter on the reference
                   page for any digital passband modulation block. Also note that passband blocks
                   process only sample-based data, not frame-based data.
                                                                                                    2-73
2   Using the Communications Blockset
                             Frame-Based Upsampling
                                                                 1
                                                                 1
                                    0
                                              Modulator         -1                                      Output sample time = Input sample time
                                    4
                                                                -1                                      Output length = 2* (# of input integers)
                                    2
                                                                 j
                                                                 j
                               Frame-based column vectors
Sample-Based Upsampling
                             The schematics below illustrate how a demodulator (other than OQPSK or one
                             from the CPM sublibrary) processes three doubly-sampled symbols using both
                             frame-based and sample-based inputs. In both cases, the Samples per symbol
                             parameter is 2. Notice that the sample-based schematic includes an output
                             delay of one sample period.
2-74
                                                                  Digital Modulation
To open the completed model, click here in the MATLAB Help browser. To
build the model, gather and configure these blocks:
Use the blocks’ default parameters unless otherwise instructed. Connect the
blocks as in the figure. Running the model produces the plot below. The plot
reflects the transitions among the eight DQPSK constellation points.
                                                                               2-75
2   Using the Communications Blockset
                             This plot illustrates π/4-DQPSK modulation, because the default Phase offset
                             parameter in the DQPSK Modulator Baseband block is pi/4. To see how the
                             phase offset influences the signal constellation, change the Phase offset
                             parameter in the DQPSK Modulator Baseband block to pi/8 or another value.
                             Run the model again and observe how the plot changes.
2-76
                                                                    Digital Modulation
To open the completed model, click here in the MATLAB Help browser. To
build the model, gather and configure these blocks:
Running the model produces a scatter diagram like the one below. Your plot
might look somewhat different, depending on your Initial seed value in the
Random-Integer Generator block. Because the modulation technique is
16-QAM, the plot shows 16 clusters of points. If there were no noise, then the
plot would show the 16 exact constellation points instead of clusters around the
constellation points.
                                                                                   2-77
2   Using the Communications Blockset
2-78
                                                                 Digital Modulation
The first step of this example is to build the model. To open the completed
model, click here in the MATLAB Help browser. To build the model, gather and
configure these blocks:
  L = 5; % Symbols to display
  pmat = [];
                                                                               2-79
2   Using the Communications Blockset
2-80
                                                                    Digital Modulation
• The input signal’s sampling rate of 10 is less than the carrier frequency of
  100.
• The modulated signal’s sampling rate of 3000 exceeds the sum of twice the
  carrier frequency and twice the input sampling rate.
• The input sample time of 1/10 is an integer multiple of the output sample
  time of 1/3000, while the modulated signal is not oversampled.
These requirements are mentioned on the reference page for the M-PSK
Modulator Passband block.
To open the completed model, click here in the MATLAB Help browser. To
build the model, gather and configure these blocks:
                                                                                 2-81
2   Using the Communications Blockset
2-82
                                                                 Digital Modulation
You might want to vary the modulation technique to see how this plot would
change. For example, you can try replacing the M-PSK Modulator Passband
block with the M-DPSK Modulator Passband or OQPSK Modulator Passband
block.
                                                                               2-83
2   Using the Communications Blockset
       Channels
                             Communication channels introduce noise, fading, interference, and other
                             distortions into the signals that they transmit. Simulating a communication
                             system involves modeling a channel based on mathematical descriptions of the
                             channel. Different transmission media have different properties and are
                             modeled differently. In a simulation, the channel model usually fits directly
                             between the transmitter and receiver, as shown below.
                             AWGN Channel
                             An AWGN channel adds white Gaussian noise to the signal that passes
                             through it. Gaussian noise is discussed on the reference page for the Gaussian
                             Noise Generator block. The AWGN Channel block can process either
                             sample-based or frame-based data, and it lets you specify the variance of the
                             noise in one of four ways:
2-84
                                                                                                Channels
An example using the AWGN Channel block is in “Getting Started with the
Communications Blockset” on page 1-1.
Fading Channels
The Channels library includes Rayleigh and Rician fading blocks that can
simulate real-world phenomena in mobile communications. These phenomena
include multipath scattering effects in the Rayleigh case, as well as Doppler
shifts that arise from relative motion between the transmitter and receiver.
This section discusses:
• How to categorize the possible paths along which a signal can travel from the
  transmitter to the receiver in the situation that you want to model
• How to choose and configure a fading channel block based on the
  categorization
• An example that uses fading channels
                                                 Reflected Path 1
                                                                                     Receiver
                                            th
                                   Direct Pa
                                                                             h   2
                                                                          Pat
             Transmitter
                                                                            ed
                                                                        lect
                                                                    Ref
The situation in the figure is just an example. In general, you should analyze
your system by considering these questions:
                                                                                                    2-85
2   Using the Communications Blockset
                             • Are there any reflected paths along which a signal can travel from
                               transmitter to receiver? If so, how many?
                             • Is there a direct path from transmitter to receiver?
                             • What is the relative motion between the transmitter and receiver?
                             The first two questions will help you choose which fading channel block(s) to
                             use in your simulation, while the third question will help you choose
                             appropriate parameters for the blocks.
                             If a signal can use more than one reflected path, then a single instance of the
                             Multipath Rayleigh Fading Channel block can model all of them
                             simultaneously. The number of paths that the block uses is the length of either
                             the Delay vector or the Gain vector parameter, whichever length is larger. (If
                             both of these parameters are vectors, then they must have the same length; if
                             exactly one of these parameters is a scalar, then the block expands it into a
                             vector whose size matches that of the other vector parameter.)
                             The relative motion between the transmitter and receiver influences the values
                             of the blocks’ parameters. For more details, see their reference pages, as well
                             as the works listed in “Selected Bibliography for Channels” on page 2-89 if
                             necessary.
2-86
                                                                               Channels
Another example is the model below, which uses both the Multipath Rayleigh
Fading Channel and the Rician Fading Channel blocks in parallel. This
combination of blocks simulates a mobile communication link in which the
transmitted signal can travel to the receiver along a direct path as well as along
three indirect paths. (The number of indirect paths is three because the
Multipath Rayleigh Fading Channel block’s Gain vector parameter is a vector
of length three. Although the Delay vector parameter is a scalar, its value is
applied to each of the three paths.)
To open the completed model, click here in the MATLAB Help browser. To
build the model, gather and configure these blocks:
• DSP Constant, in the DSP Blockset DSP Sources library
  - Set Constant value to j*ones(10000,1)
  - Check the Frame-based output check box
  - Set Frame period to .01
• Rician Fading Channel, with default parameter values
• Multipath Rayleigh Fading Channel
  - Set Delay vector to [0 2e-6 3e-6]
  - Set Gain vector to [0 -3 1]
• Sum, in the Simulink Math library
• To Workspace, in the Simulink Sinks directory
  - Set Save format to Array
Connect the blocks as shown above. Also, from the model window’s Simulation
menu, choose Simulation parameters; then in the Simulation Parameters
dialog box, set Stop time to 0.6.
                                                                                     2-87
2   Using the Communications Blockset
                             Tip To reduce execution time by logging less data to the workspace, set the
                             Decimation parameter in the To Workspace block to 100. Then the variable
                             simout will contain fewer entries, but its graph will look similar.
                             Run the model. After the simulation stops, plot the faded signal’s power (versus
                             sample number) by executing this command at the MATLAB prompt.
                                simout = simout.'; plot(20*log10(abs(simout(:))))
2-88
                                                                          Channels
                                                                                2-89
2   Using the Communications Blockset
       Synchronization
                             In order to interpret information correctly, a communication receiver must be
                             synchronized with the corresponding transmitter. A phase-locked loop, or PLL,
                             can help accomplish this synchronization when used in conjunction with other
                             components. A PLL is an automatic control system that adjusts the phase of a
                             local signal to match the phase of the received signal. The PLL design works
                             best for narrowband signals.
                             For details about phase-locked loops, see the works listed in “Selected
                             Bibliography for Synchronization” on page 2-92.
2-90
                                                                         Synchronization
     s(t)            e(t)
                             Filter
                 S(t)
                            VCO
Different PLLs use different phase detectors, filters, and VCO characteristics.
Some of these attributes are built into the PLL blocks in this blockset, while
others depend on parameters that you set in the block mask:
• You specify the filter’s transfer function in the block mask using the
  Lowpass filter numerator and Lowpass filter denominator parameters.
  Each of these parameters is a vector that lists the coefficients of the
  respective polynomial in order of descending exponents of the variable s. To
  design a filter, you can use functions such as butter, cheby1, and cheby2 in
  the Signal Processing Toolbox.
• You specify the key VCO characteristics in the block mask. All four PLL
  blocks use a VCO input sensitivity parameter. Some blocks also use VCO
  quiescent frequency, VCO initial phase, and VCO output amplitude
  parameters.
• The phase detector for each of the PLL blocks is a feature that you cannot
  change from the block mask.
• Baseband PLL
• Linearized Baseband PLL
                                                                                     2-91
2   Using the Communications Blockset
                             The linearized model and the nonlinearized model differ in that the linearized
                             model uses the approximation
sin ( ∆θ ( t ) ) ≅ ∆θ ( t )
2-92
                     3
Function Reference
3   Function Reference
3-2
                                                                             comm_links
Purpose       3comm_links
              Display library link information for Communications Blockset blocks
Syntax        comm_links
              comm_links(sys)
              comm_links(sys,mode)
Description   comm_links displays library link information for blocks in the current model
              that are linked to the Communications Blockset. For each block in the current
              model, comm_links replaces the block name with the full pathname to the
              block’s library link in the Communications Blockset. Blocks linked to the
              current Communications Blockset libraries are highlighted in blue. Blocks
              linked to older versions of the Simulink portion of the Communications Toolbox
              are highlighted in red. Blocks at all levels of the model are analyzed.
              A summary report indicating the number of blocks linked to each blockset
              version is also displayed in the MATLAB command window. The highlighting
              and link display are disabled when the model is executed or saved, or when
              comm_links is executed a second time from the MATLAB command line.
              comm_links(sys) toggles the display of block links in system sys. If sys is the
              current model (gcs), this is the same as the earlier comm_links syntax.
              comm_links(sys,mode) directly sets the link display state, where mode can be
              'on', 'off', or 'toggle'. The default is 'toggle'.
                                                                                                3-3
commlib
Purpose       3commlib
              Open the main Communications Blockset library
Syntax        commlib
              commlib(n)
              commlib n
Description   commlib opens the current version of the main Communications Blockset
              library.
3-4
                                                                                           4
Block Reference
Communications Sources . . . . . . . . . . . . . . 4-3
Interleaving . . . . . . . . . . . . . . . . . . . . 4-13
Block Interleaving . . . . . . . . . . . . . . . . . . 4-13
Convolutional Interleaving . . . . . . . . . . . . . . . 4-15
Modulation . . . . . . .        .   .   .   .   .   .   .   .   .   .   .   .   .   4-18
Digital Baseband Modulation .   .   .   .   .   .   .   .   .   .   .   .   .   .   4-18
Analog Baseband Modulation      .   .   .   .   .   .   .   .   .   .   .   .   .   4-24
Digital Passband Modulation .   .   .   .   .   .   .   .   .   .   .   .   .   .   4-26
Analog Passband Modulation .    .   .   .   .   .   .   .   .   .   .   .   .   .   4-31
Channels . . . . . . . . . . . . . . . . . . . . . 4-34
Synchronization . . . . . . . . . . . . . . . . . . 4-36
                      To access an older version of the library (for example, if you are modifying one
                      of your legacy models), then you should use one of these alternative syntaxes
                      of the commlib command.
                         commlib 1.3 % To open version 1.3
                         commlib 1.5 % To open version 1.5
4-2
                                                                         Communications Sources
Communications Sources
           Every communication system contains one or more sources. You can open the
           Comm Sources library by double-clicking on its icon in the main
           Communications Blockset library (commlib), or by typing commsource2 at the
           MATLAB prompt.
           Tip In this document, you can jump to a block’s reference page by clicking on
           its icon below.
           The table below lists and describes the blocks in the Comm Sources library. For
           information about a specific block, see the reference pages that follow; for a
                                                                                             4-3
4   Block Reference
                       Triggered Read From File           Read from a file, refreshing the output
                                                          at rising edges of an input signal
4-4
                                                                           Communications Sinks
Communications Sinks
           The Comm Sinks library provides sinks and display devices that facilitate
           analysis of communication system performance. You can open the Comm Sinks
           library by double-clicking on its icon in the main Communications Blockset
           library (commlib), or by typing commsink2 at the MATLAB prompt.
           Tip In this document, you can jump to a block’s reference page by clicking on
           its icon below.
           The table below lists and describes the blocks in the Comm Sinks library. For
           information about a specific block, see the reference pages that follow; for a
           discussion of this library’s capabilities, see “Communications Sinks” on page
           2-12.
            Error Rate Calculation        Compute the bit error rate or symbol error
                                          rate of input data
                                                                                            4-5
4   Block Reference
4-6
                                                                                 Source Coding
Source Coding
           This blockset supports companders, scalar quantization and predictive
           quantization. You can open the Source Coding library by double-clicking on its
           icon in the main Communications Blockset library (commlib), or by typing
           commsrccod2 at the MATLAB prompt.
           Tip In this document, you can jump to a block’s reference page by clicking on
           its icon below.
                                                                                            4-7
4   Block Reference
                      The table below lists and describes the blocks in the Source Coding library. For
                      information about a specific block, see the reference pages that follow; for a
                      discussion of this library’s capabilities, see “Source Coding” on page 2-16.
4-8
                                                                                 Channel Coding
Channel Coding
           The Channel Coding library contains two sublibraries:
           • Block, which contains blocks that implement the encoding and decoding of
             linear, cyclic, BCH, Hamming, and Reed-Solomon codes
           • Convolutional, which contains blocks that implement convolutional encoding
             and decoding
           The main Channel Coding library appears below. You can open it by
           double-clicking on its icon in the main Communications Blockset library
           (commlib), or by typing commfeccod2 at the MATLAB prompt. Each icon in the
           Channel Coding window represents a sublibrary. In Simulink, double-clicking
           on one of these icons opens the sublibrary. In this document, clicking on one of
           the icons below jumps to an overview of that sublibrary.
           Block Coding
           You can open the Block sublibrary by double-clicking on the Block icon in the
           main Channel Coding library, or by typing commblkcod2 at the MATLAB
           prompt.
           Tip In this document, you can jump to a block’s reference page by clicking on
           its icon below.
                                                                                              4-9
4   Block Reference
                      The table below lists and describes the blocks in the Block sublibrary of the
                      Channel Coding library. For information about a specific block, see the
                      reference pages that follow; for a discussion of this library’s capabilities, see
                      “Block Coding” on page 2-27.
4-10
                                                                   Channel Coding
Convolutional Coding
You can open the Convolutional sublibrary by double-clicking on the
Convolutional icon in the main Channel Coding library, or by typing
commcnvcod2 at the MATLAB prompt.
Tip In this document, you can jump to a block’s reference page by clicking on
its icon below.
                                                                                4-11
4   Block Reference
                      The table below lists and describes the blocks in the Convolutional sublibrary
                      of the Channel Coding library. For information about a specific block, see the
                      reference pages that follow; for a discussion of this library’s capabilities, see
                      “Convolutional Coding” on page 2-40.
4-12
                                                                                          Interleaving
Interleaving
               The Interleaving library contains two sublibraries:
               • Block
               • Convolutional
               Block Interleaving
               You can open the Block sublibrary by double-clicking on the Block icon in the
               main Interleaving library, or by typing commblkintrlv2 at the MATLAB
               prompt.
               Tip In this document, you can jump to a block’s reference page by clicking on
               its icon below.
                                                                                                  4-13
4   Block Reference
                      The table below lists and describes the blocks in the Block sublibrary of the
                      Interleaving library. For information about a specific block, see the reference
                      pages that follow; for a discussion of this library’s capabilities, see “Block
                      Interleavers” on page 2-46.
4-14
                                                                          Interleaving
Convolutional Interleaving
You can open the Convolutional sublibrary by double-clicking on the
Convolutional icon in the main Interleaving library, or by typing
commcnvintrlv2 at the MATLAB prompt.
Tip In this document, you can jump to a block’s reference page by clicking on
its icon below.
                                                                                 4-15
4   Block Reference
                      The table below lists and describes the blocks in the Convolutional sublibrary
                      of the Interleaving library. For information about a specific block, see the
                      reference pages that follow; for a discussion of this library’s capabilities, see
                      “Convolutional Interleavers” on page 2-47.
4-16
                                                           Interleaving
                                                                  4-17
4   Block Reference
       Modulation
                      The Modulation library contains four sublibraries, each of which addresses a
                      category of modulation:
                      The main Modulation library appears below. You can open it by double-clicking
                      on its icon in the main Communications Blockset library (commlib), or by
                      typing commmod2 at the MATLAB prompt. Each icon in the Modulation window
                      represents a sublibrary. In Simulink, double-clicking on one of these icons
                      opens the sublibrary. In this document, clicking on one of the icons below jumps
                      to an overview of that sublibrary.
                      The first column shows the sublibraries for baseband simulation; the second
                      column shows the sublibraries for passband simulation. The first row shows
                      the sublibraries for digital modulation and demodulation. The second row
                      shows the sublibraries for analog modulation and demodulation.
4-18
                                                                           Modulation
commdigbbnd2 at the MATLAB prompt. clicking on one of the icons below jumps
to an overview of that sublibrary.
The figures and tables below show and list the blocks in the method-specific
sublibraries. For information about a specific block, see the reference pages
that follow; for a discussion of digital baseband modulation capabilities, see
“Digital Modulation” on page 2-64.
                                                                                 4-19
4   Block Reference
AM Sublibrary
4-20
                                                                 Modulation
PM Sublibrary
                                                                       4-21
4   Block Reference
FM Sublibrary
4-22
                                                                Modulation
CPM Sublibrary
                                                                      4-23
4   Block Reference
                      Tip In this document, you can jump to a block’s reference page by clicking on
                      its icon below.
4-24
                                                                               Modulation
The table below lists and describes the blocks in the Analog Baseband
sublibrary of the Modulation library. For information about a specific block, see
the reference pages that follow; for a discussion of this library’s capabilities, see
“Analog Modulation” on page 2-53.
                                                                                        4-25
4   Block Reference
4-26
                                                                          Modulation
The figures and tables below show and list the blocks in the method-specific
sublibraries. For information about a specific block, see the reference pages
that follow.
AM Sublibrary
                                                                                4-27
4   Block Reference
PM Sublibrary
4-28
                                                                Modulation
FM Sublibrary
                                                                      4-29
4   Block Reference
CPM Sublibrary
4-30
                                                                        Modulation
Tip In this document, you can jump to a block’s reference page by clicking on
its icon below.
                                                                                4-31
4   Block Reference
                      The table below lists and describes the blocks in the Analog Passband
                      sublibrary of the Modulation library. For information about a specific block, see
                      the reference pages that follow; for a discussion of this library’s capabilities, see
                      “Analog Modulation” on page 2-53.
4-32
                                                                Modulation
                                                                      4-33
4   Block Reference
       Channels
                      The Channels library provides passband and baseband channels. You can open
                      the Channels library by double-clicking on its icon in the main
                      Communications Blockset library (commlib), or by typing commchan2 at the
                      MATLAB prompt.
                      Tip In this document, you can jump to a block’s reference page by clicking on
                      its icon below.
                      The table below lists and describes the blocks in the Channels library. For
                      information about a specific block, see the reference pages that follow; for a
                      discussion of this library’s capabilities, see “Channels” on page 2-84.
4-34
                                                                   Channels
                                                                       4-35
4   Block Reference
       Synchronization
                      The Synchronization library provides four phase-locked loop models. You can
                      open the Synchronization library by double-clicking on its icon in the main
                      Communications Blockset library (commlib), or by typing commsync2 at the
                      MATLAB prompt.
                      Tip In this document, you can jump to a block’s reference page by clicking on
                      its icon below.
                      The table below lists and describes the blocks in the Synchronization library.
                      For information about a specific block, see the reference pages that follow; for
                      a discussion of this library’s capabilities, see “Synchronization” on page 2-90.
4-36
                                                                 Basic Communications Functions
           • Integrators
           • Sequence Operations
           The main Basic Comm Functions library appears below. You can open it by
           double-clicking on its icon in the main Communications Blockset library
           (commlib), or by typing commbasic2 at the MATLAB prompt. Each icon in the
           Basic Comm Functions window represents a sublibrary. In Simulink,
           double-clicking on one of these icons opens the sublibrary. In this document,
           clicking on one of the icons below jumps to an overview of that sublibrary.
           Integrators
           You can open the Integrators sublibrary by double-clicking on the Integrators
           icon in the main Basic Comm Functions library, or by typing comminteg2 at the
           MATLAB prompt.
           Tip In this document, you can jump to a block’s reference page by clicking on
           its icon below.
                                                                                           4-37
4   Block Reference
                      The table below lists and describes the blocks in the Integrators library. For
                      information about a specific block, see the reference pages that follow.
                      Sequence Operations
                      You can open the Sequence Operations sublibrary by double-clicking on the
                      Sequence Operations icon in the main Basic Comm Functions library, or by
                      typing commsequence2 at the MATLAB prompt.
4-38
                                                       Basic Communications Functions
The table below lists and describes the blocks in the Sequence Operations
library. For information about a specific block, see the reference pages that
follow.
 Complex           Shift the phase of the complex input signal by the second
 Phase Shift       input value
                                                                                 4-39
4   Block Reference
4-40
                                                                                    Utility Functions
Utility Functions
             You can open the Utility Functions library by double-clicking on its icon in the
             main Communications Blockset library (commlib), or by typing commutil2 at
             the MATLAB prompt.
             The table below lists and describes the blocks in the Utility Functions library.
             For information about a specific block, see the reference pages that follow.
                                                                                                4-41
4
4-42
                                                                                             Alphabetical List of Blocks
                                                                                                                         4-43
4
4-44
                                                                                             Alphabetical List of Blocks
                                                                                                                         4-45
4
4-46
                                                                                                             A-Law Compressor
Description   The A-Law Compressor block implements an A-law compressor for the input
              signal. The formula for the A-law compressor is
                             
                                                 Ax
                                            ---------------------- sgn ( x )
                                                                                                  V
                                                                                      for 0 ≤ x ≤ ----
                                           1 + log A                                             A
                    y = 
                                 V ( 1 + log ( A x ⁄ V ) )                                         V
                                 --------------------------------------------------- sgn ( x ) for ---- < x ≤ V
                                                1 + log A                                           A
                             î
Dialog Box
              A value
                 The A-law parameter of the compressor.
                                                                                                                           4-47
A-Law Compressor
4-48
                                                                                                                     A-Law Expander
Description   The A-Law Expander block recovers data that the A-Law Compressor block
              compressed. The formula for the A-law expander, shown below, is the inverse
              of the compressor function.
                                
                                              y ( 1 + log A )                                               V
                                
                                               ------------------------------           for 0 ≤ y ≤ ----------------------
                                                            A                                       1 + log A
                    x = 
                                     y ( 1 + log A ) ⁄ V – 1           V                           V
                                                                        ---- sgn ( y ) for ---------------------- < y ≤ V
                                 e                                     A                  1 + log A
                                 î
              The input can have any shape or frame status. This block processes each vector
              element independently.
Dialog Box
              A value
                 The A-law parameter of the compressor.
              Peak signal magnitude
                 The peak value of the input signal. This is also the peak value of the output
                 signal.
              Match these parameters to the ones in the corresponding A-Law Compressor
              block.
                                                                                                                                 4-49
A-Law Expander
4-50
                                                      Algebraic Deinterleaver
Description   The Algebraic Deinterleaver block restores the original ordering of a sequence
              that was interleaved using the Algebraic Interleaver block. In typical usage,
              the parameters in the two blocks have the same values.
              The Number of elements parameter, N, indicates how many numbers are in
              the input vector.If the input is frame-based, then it must be a column vector.
              The Type parameter indicates the algebraic method that the block uses to
              generate the appropriate permutation table. Choices are Takeshita-Costello
              and Welch-Costas. Each of these methods has parameters and restrictions
              that are specific to it; these are described on the reference page for the
              Algebraic Interleaver block.
Dialog Box
              Type
                 The type of permutation table that the block uses for deinterleaving.
                 Choices are Takeshita-Costello and Welch-Costas.
                                                                                               4-51
Algebraic Deinterleaver
             Number of elements
               The number of elements, N, in the input vector.
             Multiplicative factor
               The factor used to compute the corresponding interleaver’s cycle vector.
               This field appears only if Type is set to Takeshita-Costello.
             Cyclic shift
                The amount by which the block shifts indices when creating the
                corresponding interleaver’s permutation table. This field appears only if
                Type is set to Takeshita-Costello.
             Primitive element
                An element of order N in the finite field GF(N+1). This field appears only
                if Type is set to Welch-Costas.
References   [1] Heegard, Chris and Stephen B. Wicker. Turbo Coding. Boston: Kluwer
             Academic Publishers, 1999.
             [2] Takeshita, O. Y. and D. J. Costello, Jr. “New Classes Of Algebraic
             Interleavers for Turbo-Codes.” Proc. 1998 IEEE International Symposium on
             Information Theory, Boston, Aug. 16-21, 1998. 419.
4-52
                                                               Algebraic Interleaver
Description   The Algebraic Interleaver block rearranges the elements of its input vector
              using a permutation that is algebraically derived. The Number of elements
              parameter, N, indicates how many numbers are in the input vector.If the input
              is frame-based, then it must be a column vector.
              The Type parameter indicates the algebraic method that the block uses to
              generate the appropriate permutation table. Choices are Takeshita-Costello
              and Welch-Costas. Each of these methods has parameters and restrictions
              that are specific to it:
                                                                                                    4-53
Algebraic Interleaver
Dialog Box
             Type
                The type of permutation table that the block uses for interleaving.
             Number of elements
               The number of elements, N, in the input vector.
             Multiplicative factor
               The factor used to compute the interleaver’s cycle vector. This field appears
               only if Type is set to Takeshita-Costello.
             Cyclic shift
                The amount by which the block shifts indices when creating the
                permutation table. This field appears only if Type is set to
                Takeshita-Costello.
             Primitive element
                An element of order N in the finite field GF(N+1). This field appears only
                if Type is set to Welch-Costas.
4-54
                                                       Algebraic Interleaver
References   [1] Heegard, Chris and Stephen B. Wicker. Turbo Coding. Boston: Kluwer
             Academic Publishers, 1999.
             [2] Takeshita, O. Y. and D. J. Costello, Jr. “New Classes Of Algebraic
             Interleavers for Turbo-Codes.” Proc. 1998 IEEE International Symposium on
             Information Theory, Boston, Aug. 16-21, 1998. 419.
                                                                                         4-55
APP Decoder
Description   The APP Decoder block performs a posteriori probability (APP) decoding of a
              convolutional code. You can use this block to build a turbo decoder.
              If you only need the input L(c) and output L(u), then you can attach a Simulink
              Ground block to the input L(u) and a Simulink Terminator block to the output
              L(c).
              • If you have a variable in the MATLAB workspace that contains the trellis
                structure, then enter its name as the Trellis structure parameter. This way
                is preferable because it causes Simulink to spend less time updating the
4-56
                                                             APP Decoder
To indicate how the encoder treats the trellis at the beginning and end of each
frame, set the Termination method parameter to either Truncated or
Terminated. The Truncated option indicates that the encoder resets to the
all-zeros state at the beginning of each frame, while the Terminated option
indicates that the encoder forces the trellis to end each frame in the all-zeros
state. If you use the Convolutional Encoder block with the Reset parameter set
to On each frame, then use the Truncated option in this block.
   log   å exp ai
         i
by other quantities. The Max option uses max{ai} as the approximation, while
the Max* option uses max{ai} plus a correction term.
The Max* option enables the Scaling bits parameter in the mask. This
parameter is the number of bits by which the block scales the data it processes
internally. You can use this parameter to avoid losing precision during the
computations. It is especially appropriate if your implementation uses
fixed-point components. For more information about the Max* option, see the
article by Viterbi in the “References” section below.
                                                                                   4-57
APP Decoder
Dialog Box
             Trellis structure
                MATLAB structure that contains the trellis description of the
                convolutional encoder.
             Termination method
                Either Truncated or Terminated. This parameter indicates how the
                convolutional encoder treats the trellis at the beginning and end of frames.
             Algorithm
                Either True APP, Max*, or Max.
             Number of scaling bits
               An integer between 0 and 8 that indicates by how many bits the decoder
               scales data in order to avoid losing precision. This field is active only when
               Algorithm is set to Max*.
References   [1] Benedetto, Sergio and Guido Montorsi. “Performance of Continuous and
             Blockwise Decoded Turbo Codes.” IEEE Communications Letters, vol. 1, May
             1997. 77-79.
             [2] Benedetto, S., G. Montorsi, D. Divsalar, and F. Pollara. “A Soft-Input
             Soft-Output Maximum A Posterior (MAP) Module to Decode Parallel and
4-58
                                                         APP Decoder
Serial Concatenated Codes.” JPL TMO Progress Report, vol. 42-127, November
1996. [This electronic journal is available at
http://tmo.jpl.nasa.gov/tmo/progress_report/index.html.]
                                                                             4-59
AWGN Channel
Library Channels
Description   The AWGN Channel block adds white Gaussian noise to a real or complex
              input signal. When the input signal is real, this block adds real Gaussian noise
              and produces a real output signal. When the input signal is complex, this block
              adds complex Gaussian noise and produces a complex output signal. This block
              inherits its sample time from the input signal.
              This block uses the DSP Blockset’s Random Source block to generate the noise.
              The Initial seed parameter in this block initializes the noise generator. Initial
              seed can be either a scalar or a vector whose length matches the number of
              channels in the input signal. For details on Initial seed, see the Random
              Source block reference page in the DSP Blockset User’s Guide.
              • If your input is a sample-based scalar, then the block adds scalar Gaussian
                noise to your signal.
              • If your input is a sample-based vector or a frame-based row vector, then the
                block adds independent Gaussian noise to each channel.
              • If your input is a frame-based column vector, then the block adds a frame of
                Gaussian noise to your single-channel signal.
              • If your input is a frame-based m-by-n matrix, then the block adds a length-m
                frame of Gaussian noise independently to each of the n channels.
              The input cannot be a sample-based m-by-n matrix if both m and n are greater
              than 1.
              • Signal to noise ratio (Es/No), where the block calculates the variance from
                these quantities that you specify in the block mask:
4-60
                                                        AWGN Channel
In both Variance from mask mode and Variance from port mode, these rules
describe how the block interprets the variance:
• If the variance is a scalar, then all signal channels are uncorrelated but
  share the same variance.
• If the variance is a vector whose length is the number of channels in the
  input signal, then each element represents the variance of the corresponding
  signal channel.
Note If you apply complex input signals to the AWGN Channel block, then it
adds complex zero-mean Gaussian noise with the calculated or specified
variance. The variance of each of the quadrature components of the complex
noise is half of the calculated or specified value.
                                                                                   4-61
AWGN Channel
Dialog Box
             Initial seed
                 The seed for the Gaussian noise generator.
             Mode
               The mode by which you specify the noise variance: Signal to noise
               ratio (Es/No), Signal to noise ratio (SNR), Variance from mask, or
               Variance from port.
             Es/No (dB)
                The ratio of signal energy per symbol to noise power spectral density, in
                decibels. This field appears only if Mode is set to Es/No.
             SNR (dB)
               The ratio of signal power to noise power, in decibels. This field appears only
               if Mode is set to SNR.
             Input signal power (watts)
                The root mean square power of the input symbols (if Mode is Es/No) or
                input samples (if Mode is SNR), in watts. This field appears only if Mode
                is set to either Es/No or SNR.
4-62
                                                                 AWGN Channel
           Variance
              The variance of the white Gaussian noise. This field appears only if Mode
              is set to Variance from mask.
                                                                                          4-63
Baseband PLL
Library Synchronization
Description   The Baseband PLL (phase-locked loop) block is a feedback control system that
              automatically adjusts the phase of a locally generated signal to match the
              phase of an input signal. Unlike the Phase-Locked Loop block, this block uses
              a baseband method and does not depend on a carrier frequency.
              This PLL has these three components:
              The input signal represents the received signal. The input must be a
              sample-based scalar signal. The three output ports produce:
              This model is nonlinear; for a linearized version, use the Linearized Baseband
              PLL block.
4-64
                                                                       Baseband PLL
Dialog Box
References   For more information about phase-locked loops, see the works listed in
             “Selected Bibliography for Synchronization” on page 2-92.
                                                                                              4-65
BCH Decoder
Description   The BCH Decoder block recovers a binary message vector from a binary BCH
              codeword vector. For proper decoding, the first two parameter values in this
              block should match the parameters in the corresponding BCH Encoder block.
              The input is the binary codeword vector and the first output is the
              corresponding binary message vector. If the BCH code has message length K
              and codeword length N, then the input has length N and the first output has
              length K. If the input is frame-based, then it must be a column vector.
              The number N must have the form 2M-1, where M is an integer greater than or
              equal to 3. For a given codeword length N, only specific message lengths K are
              valid for a BCH code. To see which values of K are valid, use the bchpoly
              function in the Communications Toolbox. No known analytic formula describes
              the relationship among the codeword length, message length, and
              error-correction capability.
              The second output is the number of errors detected during decoding of the
              codeword. A negative integer indicates that the block detected more errors
              than it could correct using the coding scheme.
              The sample times of all input and output signals are equal.
              The Error-correction capability T parameter either:
              The block runs faster in the first case above. You can use the bchpoly function
              in the Communications Toolbox to calculate the error-correction capability.
4-66
                                                                           BCH Decoder
Dialog Box
             Codeword length N
                The codeword length, which is also the vector length of the first input.
             Message length K
               The message length, which is also the vector length of the first output.
             Error-correction capability T
                Either the error-correction capability of the code, or zero. A zero forces the
                block to calculate the error-control capability when initializing.
                                                                                                 4-67
BCH Encoder
Description   The BCH Encoder block creates a BCH code with message length K and
              codeword length N. You specify both N and K directly in the block mask.
              The input must contain exactly K elements. If it is frame-based, then it must
              be a column vector. The output is a vector of length N.
              N must have the form 2M-1, where M is an integer greater than or equal to 3.
              For a given codeword length N, only specific message lengths K are valid for a
              BCH code. To see which values of K are valid, use the bchpoly function in the
              Communications Toolbox. For example, in the output below, the second column
              lists all possible message lengths that correspond to a codeword length of 15.
              The third column lists the corresponding error-correction capabilities.
                   params = bchpoly(15)
params =
                             15   11   1
                             15    7   2
                             15    5   3
Dialog Box
4-68
                                                                        BCH Encoder
             Codeword length N
                The codeword length, which is also the output vector length.
             Message length K
               The message length, which is also the input vector length.
                                                                                 4-69
Bernoulli Random Binary Generator
Description   The Bernoulli Random Binary Generator block generates random binary
              numbers using a Bernoulli distribution. The Bernoulli distribution with
              parameter p produces zero with probability p and one with probability 1-p. The
              Bernoulli distribution has mean value 1-p and variance p(1-p). The
              Probability of a zero parameter specifies p, and can be any real number
              between zero and one.
4-70
                               Bernoulli Random Binary Generator
Dialog Box
             Probability of a zero
                The probability with which a zero output occurs.
             Initial seed
                 The initial seed value for the random number generator. The seed can be
                 either a vector of the same length as the Probability of a zero parameter,
                 or a scalar.
             Sample time
                The period of each sample-based vector or each row of a frame-based
                matrix.
             Frame-based outputs
                Determines whether the output is frame-based or sample-based. This box
                is active only if Interpret vector parameters as 1-D is unchecked.
             Samples per frame
                The number of samples in each column of a frame-based output signal. This
                field is active only if Frame-based outputs is checked.
                                                                                              4-71
Bernoulli Random Binary Generator
4-72
                                                           Binary Cyclic Decoder
Description   The Binary Cyclic Decoder block recovers a message vector from a codeword
              vector of a binary systematic cyclic code. For proper decoding, the parameter
              values in this block should match those in the corresponding Binary Cyclic
              Encoder block.
              If the cyclic code has message length K and codeword length N, then N must
              have the form 2M-1 for some integer M greater than or equal to 3.
              The input must contain exactly N elements. If it is frame-based, then it must
              be a column vector. The output is a vector of length K.
              You can determine the systematic cyclic coding scheme in one of two ways:
              • To create an [N,K] code, enter N and K as the first and second mask
                parameters, respectively. The block computes an appropriate generator
                polynomial, namely, cyclpoly(N,K,'min').
              • To create a code with codeword length N and a particular degree-(N-K)
                binary generator polynomial, enter N as the first parameter and a binary
                vector as the second parameter. The vector represents the generator
                polynomial by listing its coefficients in order of ascending exponents. You can
                create cyclic generator polynomials using the cyclpoly function in the
                Communications Toolbox.
Dialog Box
                                                                                                  4-73
Binary Cyclic Decoder
             Codeword length N
                The codeword length N, which is also the input vector length.
             Message length K, or generator polynomial
               Either the message length, which is also the output vector length; or a
               binary vector that represents the generator polynomial for the code.
4-74
                                                            Binary Cyclic Encoder
Description   The Binary Cyclic Encoder block creates a systematic cyclic code with message
              length K and codeword length N. The number N must have the form 2M-1,
              where M is an integer greater than or equal to 3.
              The input must contain exactly K elements. If it is frame-based, then it must
              be a column vector. The output is a vector of length N.
              You can determine the systematic cyclic coding scheme in one of two ways:
              • To create an [N,K] code, enter N and K as the first and second mask
                parameters, respectively. The block computes an appropriate generator
                polynomial, namely, cyclpoly(N,K,'min').
              • To create a code with codeword length N and a particular degree-(N-K)
                binary generator polynomial, enter N as the first parameter and a binary
                vector as the second parameter. The vector represents the generator
                polynomial by listing its coefficients in order of ascending exponents. You can
                create cyclic generator polynomials using the cyclpoly function in the
                Communications Toolbox.
Dialog Box
              Codeword length N
                 The codeword length, which is also the output vector length.
                                                                                                  4-75
Binary Cyclic Encoder
4-76
                                                        Binary-Input RS Encoder
Description   The Binary-Input RS Encoder block creates a Reed-Solomon code with message
              length K and codeword length N. You specify both N and K directly in the block
              mask. N must have the form 2M-1, where M is an integer greater than or equal
              to 3. The code is more efficient if N-K is an even integer.
              The input and output are binary-valued signals that represent messages and
              codewords, respectively. The input must contain exactly M*K elements. If it is
              frame-based, then it must be a column vector. The output is a vector of length
              M*N.
              The M*K input bits represent K integers between 0 and 2M-1, where more
              significant bits are to the right. Similarly, the M*N output bits represent N
              integers between 0 and 2M-1. These integers in turn represent elements of the
              finite field GF(2M).
              An (N,K) Reed-Solomon code can correct up to floor((N-K)/2) symbol errors
              (not bit errors) in each codeword.
               Message input:            [0 1 1 1 1 1 0 0 1 0 0 0 0 0 1]           [6 7 4 0 4]
                                                                                   in integer format
                                                     Binary-Input RS Encoder
                                                     with N = 7, K = 5
               Code output: [1 1 0 0 1 0 0 1 1 1 1 1 0 0 1 0 0 0 0 0 1]            [3 2 6 7 4 0 4]
                                                                                   in integer format
                                                                                                       4-77
Binary-Input RS Encoder
Dialog Box
             Codeword length N
                The codeword length. The output has vector length M*N.
             Message length K
               The message length. The input has vector length M*K.
4-78
                                                          Binary Linear Decoder
Description   The Binary Linear Decoder block recovers a binary message vector from a
              binary codeword vector of a linear block code.
              The Generator matrix parameter is the generator matrix for the block code.
              For proper decoding, this should match the Generator matrix parameter in
              the corresponding Binary Linear Encoder block. If N is the codeword length of
              the code, then Generator matrix must have N columns. If K is the message
              length of the code, then the Generator matrix parameter must have K rows.
              The input must contain exactly N elements. If it is frame-based, then it must
              be a column vector. The output is a vector of length K.
              The decoder tries to correct errors, using the Decoding table parameter. If
              Decoding table is the scalar 0, then the block defaults to the table produced by
              the Communications Toolbox function syndtable. Otherwise, Decoding table
              must be a 2N-K-by-N binary matrix. The rth row of this matrix is the correction
              vector for a received binary codeword whose syndrome has decimal integer
              value r-1. The syndrome of a received codeword is its product with the
              transpose of the parity-check matrix.
Dialog Box
                                                                                                 4-79
Binary Linear Decoder
             Generator matrix
                Generator matrix for the code; same as in Binary Linear Encoder block.
             Decoding table
                Either a 2N-K-by-N matrix that lists correction vectors for each codeword’s
                syndrome; or the scalar 0, in which case the block defaults to the table
                corresponding to the Generator matrix parameter.
4-80
                                                         Binary Linear Encoder
Description   The Binary Linear Encoder block creates a binary linear block code using a
              generator matrix that you provide in the parameter mask. If K is the message
              length of the code, then the Generator matrix parameter must have K rows.
              If N is the codeword length of the code, then Generator matrix must have N
              columns.
              The input must contain exactly K elements. If it is frame-based, then it must
              be a column vector. The output is a vector of length N.
Dialog Box
              Generator matrix
                 A K-by-N matrix, where K is the message length and N is the codeword
                 length.
                                                                                              4-81
Binary-Output RS Decoder
Description   The Binary-Output RS Decoder block recovers a binary message vector from a
              binary Reed-Solomon codeword vector. For proper decoding, the parameter
              values in this block should match those in the corresponding Binary-Input RS
              Encoder block.
              If the Reed-Solomon code has message length K and codeword length N, then
              N must have the form 2M-1 for some integer M greater than or equal to 3. The
              code is more efficient if N-K is an even integer.
              The input and first output are binary-valued signals that represent codewords
              and messages, respectively. The input must contain exactly M*N elements. If
              it is frame-based, then it must be a column vector. The first output is a vector
              of length M*K.
              The M*N input bits represent N integers between 0 and 2M-1, where more
              significant bits are to the right. Similarly, M*K output bits represent K
              integers between 0 and 2M-1. These integers in turn represent elements of the
              finite field GF(2M).
              The second output is the number of errors detected during decoding of the
              codeword. A negative integer indicates that the block detected more errors
              than it could correct using the coding scheme. An (N,K) Reed-Solomon code can
              correct up to floor((N-K)/2) symbol errors (not bit errors) in each codeword.
4-82
                                              Binary-Output RS Decoder
Dialog Box
             Codeword length N
                The codeword length. The input has vector length M*N.
             Message length K
               The message length. The first output has vector length M*K.
                                                                             4-83
Binary Symmetric Channel
Library Channels
Description   The Binary Symmetric Channel block introduces binary errors to the signal
              transmitted through this channel.
              The input port is the transmitted binary signal. The input can be either a
              scalar, a sample-based vector, or a frame-based row vector. This block
              processes each vector element independently, and introduces an error in a
              given spot with probability Error probability.
              The first output port is the binary signal that has passed through the channel.
              The second output port is the vector of errors that were introduced.
Dialog Box
              Error probability
                 The probability that a binary error will occur. The value of this parameter
                 must be between zero and one.
              Input vector length
                 Length of the input vector signal. This is the same as the vector length of
                 the signal at the first output port.
4-84
                                             Binary Symmetric Channel
           Initial seed
               The initial seed value for the random number generator.
           Sample time
              The block’s sample time.
                                                                         4-85
Binary Vector Noise Generator
Description   The Binary Vector Noise Generator outputs a random binary vector whose
              length is the Binary vector length parameter. The Probabilities parameter
              helps determine how many 1s appear in each output vector. Once the number
              of 1s is determined, their placement is determined according to a uniform
              distribution.
              If p1, p2,...pm are the entries in the Probabilities parameter, then p1 is the
              probability that the output vector will have a single 1, p2 is the probability that
              the output vector will have exactly two 1s, and so on. Note that Probabilities
              must have sum less than or equal to one, and length less than or equal to the
              Binary vector length. Also, the probability of a zero vector is one minus the
              sum of Probabilities.
              This block is useful in testing error-control coding algorithms.
4-86
                                        Binary Vector Noise Generator
Dialog Box
                                                                                            4-87
Binary Vector Noise Generator
4-88
                                                            Bit to Integer Converter
Description   The Bit to Integer Converter block maps groups of bits in the input vector to
              integers in the output vector. If M is the Number of bits per integer
              parameter, then the block maps each group of M bits to an integer between 0
              and 2M-1. As a result, the output vector length is 1/M times the input vector
              length.
              If the input is sample-based input, then it must be a vector whose length equals
              the Number of bits per integer parameter. If the input is frame-based, then
              it must be a column vector whose length is an integer multiple of Number of
              bits per integer.
The block interprets the first bit in each group as the most significant bit.
Dialog Box
Examples      If the input is [0; 1; 1; 1; 1; 1; 0; 1] and the Number of bits per integer
              parameter is 4, then the output is [7; 13]. The block maps the first group of four
              bits (0, 1, 1, 1) to 7 and the second group of four bits (1, 1, 0, 1) to 13. Notice that
              the output length is one-fourth of the output length.
Pair Block    Integer to Bit Converter
                                                                                                         4-89
BPSK Demodulator Baseband
Description   The BPSK Demodulator Baseband block demodulates a signal that was
              modulated using the binary phase shift keying method. The input is a
              baseband representation of the modulated signal. The input can be either a
              scalar or a frame-based column vector.
              The input must be a discrete-time complex signal. The block maps the points
              exp(jθ) and -exp(jθ) to 0 and 1, respectively, where θ is the Phase offset
              parameter.
Dialog Box
4-90
                                       BPSK Demodulator Baseband
                                                                            4-91
BPSK Modulator Baseband
Description   The BPSK Modulator Baseband block modulates using the binary phase shift
              keying method. The output is a baseband representation of the modulated
              signal.
              The input must be a discrete-time binary-valued signal. If the input bit is 0 or
              1, respectively, then the modulated symbol is exp(jθ) or -exp(jθ) respectively,
              where θ is the Phase offset parameter.
Dialog Box
4-92
                                          BPSK Modulator Baseband
See Also     M-PSK Modulator Baseband, QPSK Modulator Baseband, DBPSK Modulator
             Baseband
                                                                                  4-93
Charge Pump PLL
Library Synchronization
Description   The Charge Pump PLL (phase-locked loop) block automatically adjusts the
              phase of a locally generated signal to match the phase of an input signal. It is
              suitable for use with digital signals.
              This PLL has these three components:
              The input signal represents the received signal. The input must be a
              sample-based scalar signal. The three output ports produce:
              A sequential logic phase detector operates on the zero crossings of the signal
              waveform. The equilibrium point of the phase difference between the input
              signal and the VCO signal equals π. The sequential logic detector can
              compensate for any frequency difference that might exist between a VCO and
              an incoming signal frequency. Hence, the sequential logic phase detector acts
              as a frequency detector.
4-94
                                                                 Charge Pump PLL
Dialog Box
                                                                                              4-95
Charge Pump PLL
References   For more information about digital phase-locked loops, see the works listed in
             “Selected Bibliography for Synchronization” on page 2-92.
4-96
                                                 Complex Phase Difference
Description   The Complex Phase Difference block accepts two complex input signals that
              have the same size and frame status. The output is the phase difference from
              the second to the first, measured in radians. The elements of the output are
              between -π and π.
              The input signals can have any size or frame status. This block processes each
              pair of elements independently.
Dialog Box
                                                                                               4-97
Complex Phase Shift
Description   The Complex Phase Shift block accepts a complex signal at the port labeled In.
              The output is the result of shifting this signal’s phase by an amount specified
              by the real signal at the input port labeled Ph. The Ph input is measured in
              radians, and must have the same size and frame status as the In input.
              The input signals can have any size or frame status. This block processes each
              pair of corresponding elements independently.
Dialog Box
4-98
                         Continuous-Time Eye and Scatter Diagrams
Description   The Continuous-Time Eye and Scatter Diagrams block plots eye diagrams,
              scatter diagrams, and X-Y diagrams from a continuous-time input signal. The
              Diagram type parameter determines which plots the block produces. The
              block draws the diagrams in a single window, as in the case of the eye diagram
              and scatter diagram below.
                                                                                                    4-99
Continuous-Time Eye and Scatter Diagrams
           Tip This block works better if the model’s simulation step size is suitable for
           your data. From the model window’s Simulation menu, choose Simulation
           parameters and then choose a value for the Max step size parameter. Try
           multiplying this block’s Trace period parameter by 1/8 or 1/16.
           To specify the plotting color as well as the line type and/or marker type, use the
           Line type parameters that appear after you select a value for the Diagram
           type parameter. In the Line type for eye diagram parameter, use a slash (/)
           to separate the specifications for the real and imaginary components of the
           input signal. Choices for the color, marker, and line types are in the table
           below.
4-100
                  Continuous-Time Eye and Scatter Diagrams
                                       p      Five-pointed star
                                       h      Six-pointed star
Dialog Box
             Trace period
                The duration of the horizontal axis of the eye diagram, in seconds.
             Trace offset
                The time at the leftmost edge of the horizontal axis of the eye diagram.
             Lower and upper bounds of diagram
                A two-element vector containing the minimum and maximum signal
                values in the diagrams.
             Number of saved traces
               The number of curves in the eye diagram, or points in the scatter plot, that
               are visible after you resize or restore the figure window.
             Diagram type
                The diagram(s) that the block produces.
                                                                                              4-101
Continuous-Time Eye and Scatter Diagrams
Limitations   Since this block uses an M-file, you cannot generate C code for it using the
              Real-Time Workshop.
4-102
                                               Convolutional Deinterleaver
Description   The Convolutional Deinterleaver block recovers a signal that was interleaved
              using the Convolutional Interleaver block. The parameters in the two blocks
              should have the same values.
              The input can be either a scalar or a frame-based column vector. It can be real
              or complex. The sample times of the input and output signals are the same.
Dialog Box
                                                                                                4-103
Convolutional Deinterleaver
References   [1] Clark, George C. Jr. and J. Bibb Cain. Error-Correction Coding for Digital
             Communications. New York: Plenum Press, 1981.
             [2] Forney, G., D., Jr. “Burst-Correcting Codes for the Classic Bursty Channel.”
             IEEE Transactions on Communications, vol. COM-19, October 1971. 772-781.
             [3] Ramsey, J. L. “Realization of Optimum Interleavers.” IEEE Transactions on
             Information Theory, IT-16 (3), May 1970. 338-345.
4-104
                                                           Convolutional Encoder
Description   The Convolutional Encoder block encodes a sequence of binary input vectors to
              produce a sequence of binary output vectors. This block can process multiple
              symbols at a time.
              • If you have a variable in the MATLAB workspace that contains the trellis
                structure, then enter its name as the Trellis structure parameter. This way
                is preferable because it causes Simulink to spend less time updating the
                diagram at the beginning of each simulation, compared to the usage in the
                next bulleted item.
              • If you want to specify the encoder using its constraint length, generator
                polynomials, and possibly feedback connection polynomials, then use a
                poly2trellis command within the Trellis structure field. For example, to
                use an encoder with a constraint length of 7, code generator polynomials of
                171 and 133 (in octal numbers), and a feedback connection of 171 (in octal),
                set the Trellis structure parameter to
                   poly2trellis(7,[171 133],171)
              The encoder registers begin in the all-zeros state. You can configure the
              encoder so that it resets its registers to the all-zeros state during the course of
              the simulation. To do this, use one of these values of the Reset parameter:
                                                                                                    4-105
Convolutional Encoder
Dialog Box
             Trellis structure
                MATLAB structure that contains the trellis description of the
                convolutional encoder.
             Reset
                Determines whether and under what circumstances the encoder resets to
                the all-zeros state before processing the input data. Choices are None, On
                each frame, and On nonzero Rst input. The last option causes the block
                to have a second input port, labeled Rst.
References   [1] Clark, George C. Jr. and J. Bibb Cain. Error-Correction Coding for Digital
             Communications. New York: Plenum Press, 1981.
             [2] Gitlin, Richard D., Jeremiah F. Hayes, and Stephen B. Weinstein. Data
             Communications Principles. New York: Plenum, 1992.
4-106
                                                     Convolutional Interleaver
Description   The Convolutional Interleaver block permutes the symbols in the input signal.
              Internally, it uses a set of shift registers. The delay value of the kth shift
              register is (k-1) times the Register length step parameter. The number of shift
              registers is the value of the Rows of shift registers parameter.
              The Initial conditions parameter indicates the values that fill each shift
              register at the beginning of the simulation (except for the first shift register,
              which has zero delay). If Initial conditions is a scalar, then its value fills all
              shift registers except the first; if Initial conditions is a column vector whose
              length is the Rows of shift registers parameter, then each entry fills the
              corresponding shift register. The value of the first element of the Initial
              conditions parameter is unimportant, since the first shift register has zero
              delay.
              The input can be either a scalar or a frame-based column vector. It can be real
              or complex. The sample times of the input and output signals are the same.
Dialog Box
                                                                                                   4-107
Convolutional Interleaver
References   [1] Clark, George C. Jr. and J. Bibb Cain. Error-Correction Coding for Digital
             Communications. New York: Plenum Press, 1981.
             [2] Forney, G., D., Jr. “Burst-Correcting Codes for the Classic Bursty Channel.”
             IEEE Transactions on Communications, vol. COM-19, October 1971. 772-781.
             [3] Ramsey, J. L. “Realization of Optimum Interleavers.” IEEE Transactions on
             Information Theory, IT-16 (3), May 1970. 338-345.
4-108
                                            CPFSK Demodulator Baseband
Description   The CPFSK Demodulator Baseband block demodulates a signal that was
              modulated using the continuous phase frequency shift keying method. The
              input is a baseband representation of the modulated signal. The M-ary
              number parameter, M, is the size of the input alphabet. M must have the form
              2K for some positive integer K.
              The Modulation index parameter times π radians is the phase shift in the
              modulated signal due to the latest symbol, when that symbol is the integer 1.
              The Phase offset parameter is the initial phase of the modulated waveform.
              • If the input signal is sample-based, then the delay consists of D+1 zero
                symbols.
              • If the input signal is frame-based, then the delay consists of D zero symbols.
                                                                                                  4-109
CPFSK Demodulator Baseband
Dialog Box
             M-ary number
                The size of the alphabet.
             Output type
                Determines whether the output consists of integers or groups of bits.
4-110
                                        CPFSK Demodulator Baseband
See Also CPM Demodulator Baseband, Viterbi Decoder, M-FSK Demodulator Baseband
References   [1] Anderson, John B., Tor Aulin, and Carl-Erik Sundberg. Digital Phase
             Modulation. New York: Plenum Press, 1986.
                                                                                             4-111
CPFSK Demodulator Passband
Description   The CPFSK Demodulator Passband block demodulates a signal that was
              modulated using the continuous phase frequency shift keying method. The
              input is a passband representation of the modulated signal. The M-ary
              number parameter, M, is the size of the input alphabet. M must have the form
              2K for some positive integer K.
              This block converts the input to an equivalent baseband representation and
              then uses the baseband equivalent block, CPFSK Demodulator Baseband, for
              internal computations. The following parameters in this block are the same as
              those of the baseband equivalent block:
              • M-ary number
              • Output type
              • Signal set ordering
              • Modulation index
              • Traceback length
              The input must be a sample-based scalar signal.
4-112
                                          CPFSK Demodulator Passband
             Also, this block incurs an extra output period of delay compared to its baseband
             equivalent block.
Dialog Box
             M-ary number
                The size of the alphabet.
             Output type
                Determines whether the output consists of integers or groups of bits.
                                                                                                4-113
CPFSK Demodulator Passband
References   [1] Anderson, John B., Tor Aulin, and Carl-Erik Sundberg. Digital Phase
             Modulation. New York: Plenum Press, 1986.
4-114
                                                CPFSK Modulator Baseband
Description   The CPFSK Modulator Baseband block modulates using the continuous phase
              frequency shift keying method. The output is a baseband representation of the
              modulated signal. The M-ary number parameter, M, is the size of the input
              alphabet. M must have the form 2K for some positive integer K.
              The Modulation index parameter times π radians is the phase shift due to the
              latest symbol when that symbol is the integer 1. The Phase offset parameter
              is the initial phase of the output waveform, measured in radians.
              For the exact definitions of the rectangular pulse shape that this block uses, see
              the work by Anderson, Aulin, and Sundberg listed in “References” on page
              4-117.
                                                                                                   4-115
CPFSK Modulator Baseband
Dialog Box
             M-ary number
                The size of the alphabet.
             Input type
                Indicates whether the input consists of integers or groups of bits.
             Symbol set ordering
                Determines how the block maps each group of input bits to a corresponding
                integer. This field is active only when Input type is set to Bit.
             Modulation index
               The number of half-revolutions of phase shift due to the latest symbol when
               that symbol is the integer 1.
4-116
                                            CPFSK Modulator Baseband
References   [1] Anderson, John B., Tor Aulin, and Carl-Erik Sundberg. Digital Phase
             Modulation. New York: Plenum Press, 1986.
                                                                                           4-117
CPFSK Modulator Passband
Description   The CPFSK Modulator Passand block modulates using the continuous phase
              frequency shift keying method. The output is a passband representation of the
              modulated signal. The M-ary number parameter, M, is the size of the input
              alphabet. M must have the form 2K for some positive integer K.
              This block uses the baseband equivalent block, CPFSK Modulator Baseband,
              for internal computations and converts the resulting baseband signal to a
              passband representation. The following parameters in this block are the same
              as those of the baseband equivalent block:
              • M-ary number
              • Input type
              • Symbol set ordering
              • Modulation index
              The input must be sample-based. If the Input type parameter is Bit, then the
              input must be a vector of length log2(M). If the Input type parameter is
              Integer, then the input must be a scalar.
4-118
                                              CPFSK Modulator Passband
Dialog Box
             M-ary number
                The size of the alphabet.
             Input type
                Indicates whether the input consists of integers or groups of bits.
             Symbol set ordering
                Determines how the block maps each group of input bits to a corresponding
                integer. This field is active only when Input type is set to Bit.
                                                                                            4-119
CPFSK Modulator Passband
             Modulation index
               The number of half-revolutions of phase shift due to the latest symbol when
               that symbol is the integer 1.
             Symbol period (s)
                The symbol period, which must equal the sample time of the input.
             Baseband samples per symbol
                The number of baseband samples that correspond to each integer or binary
                word in the input, before the block converts them to a passband output.
             Carrier frequency (Hz)
                The frequency of the carrier.
             Carrier initial phase (rad)
                The initial phase of the carrier in radians.
             Output sample time
                The sample time of the output signal.
References   [1] Anderson, John B., Tor Aulin, and Carl-Erik Sundberg. Digital Phase
             Modulation. New York: Plenum Press, 1986.
4-120
                                              CPM Demodulator Baseband
Description   The CPM Demodulator Baseband block demodulates a signal that was
              modulated using continuous phase modulation. The input is a baseband
              representation of the modulated signal. The M-ary number parameter, M, is
              the size of the input alphabet. M must have the form 2K for some positive
              integer K.
              The input can be either a scalar or a frame-based column vector.
              The Modulation index, Frequency pulse shape, Rolloff, BT product, Pulse
              length, Symbol prehistory, and Phase offset parameters are as described on
              the reference page for the CPM Modulator Baseband block.
              • If the input signal is sample-based, then the delay consists of D+1 zero
                symbols.
              • If the input signal is frame-based, then the delay consists of D zero symbols.
                                                                                                  4-121
CPM Demodulator Baseband
         more information about Gray and binary coding, see “Binary-Valued and
         Integer-Valued Signals” on page 2-68.
4-122
                                            CPM Demodulator Baseband
Dialog Box
             M-ary number
                The size of the alphabet.
             Output type
                Determines whether the output consists of integers or groups of bits.
                                                                                        4-123
CPM Demodulator Baseband
             BT product
                The product of bandwidth and time. This field appears only when
                Frequency pulse shape is set to Gaussian.
4-124
                                             CPM Demodulator Passband
Description   The CPM Demodulator Passband block demodulates a signal that was
              modulated using continuous phase modulation. The input is a passband
              representation of the modulated signal. The M-ary number parameter, M, is
              the size of the input alphabet. M must have the form 2K for some positive
              integer K.
              This block converts the input to an equivalent baseband representation and
              then uses the baseband equivalent block, CPM Demodulator Baseband, for
              internal computations. The following parameters in this block are the same as
              those of the baseband equivalent block:
              • M-ary number
              • Output type
              • Symbol set ordering
              • Modulation index
              • Frequency pulse shape
              • Rolloff
              • BT product
              • Pulse length
              • Symbol prehistory
              • Traceback length
              The input must be a sample-based scalar signal.
                                                                                               4-125
CPM Demodulator Passband
          Also, this block incurs an extra output period of delay compared to its baseband
          equivalent block.
4-126
                                            CPM Demodulator Passband
Dialog Box
             M-ary number
                The size of the alphabet.
             Output type
                Determines whether the output consists of integers or groups of bits.
                                                                                        4-127
CPM Demodulator Passband
          BT product
             The product of bandwidth and time. This field appears only when
             Frequency pulse shape is set to Gaussian.
4-128
                                           CPM Demodulator Passband
             Traceback length
                The number of trellis branches that the Viterbi Decoder block uses to
                construct each traceback path.
References   [1] Anderson, John B., Tor Aulin, and Carl-Erik Sundberg. Digital Phase
             Modulation. New York: Plenum Press, 1986.
                                                                                        4-129
CPM Modulator Baseband
Description   The CPM Modulator Baseband block modulates using continuous phase
              modulation. The output is a baseband representation of the modulated signal.
              The M-ary number parameter, M, is the size of the input alphabet. M must
              have the form 2K for some positive integer K.
              Continuous phase modulation uses pulse shaping to smooth the phase
              transitions of the modulated signal. Using the Frequency pulse shape
              parameter, you can choose these types of pulse shapes:
              • Rectangular
              • Raised Cosine
              • Spectral Raised Cosine
                This option requires an additional parameter, Rolloff. The Rolloff
                parameter, which affects the spectrum of the pulse, is a scalar between zero
                and one.
              • Gaussian
                This option requires an additional parameter, BT product. The BT product
                parameter, which represents bandwidth multipled by time, is a nonnegative
                scalar. It is used to reduce the bandwidth at the expense of increased
                intersymbol interference.
              • Tamed FM (tamed frequency modulation)
              For the exact definitions of these pulse shapes, see the work by Anderson,
              Aulin, and Sundberg listed in “References” on page 4-133. Each pulse shape
              has a correponding pulse duration. The Pulse length parameter measures this
              quantity in symbol intervals.
              The Modulation index parameter times π radians is the phase shift due to the
              latest symbol when that symbol is the integer 1. The Phase offset parameter
              is the initial phase of the output waveform, measured in radians.
              The Symbol prehistory parameter is a scalar or vector that specifies the data
              symbols used before the start of the simulation, in reverse chronological order.
              If it is a vector, then its length must be one less than the Pulse length
              parameter.
4-130
                                    CPM Modulator Baseband
                                                                                 4-131
CPM Modulator Baseband
Dialog Box
             M-ary number
                The size of the alphabet.
             Input type
                Indicates whether the input consists of integers or groups of bits.
4-132
                                                  CPM Modulator Baseband
             BT product
                The product of bandwidth and time. This field appears only when
                Frequency pulse shape is set to Gaussian.
See Also     CPFSK Modulator Baseband, GMSK Modulator Baseband, MSK Modulator
             Baseband
References   [1] Anderson, John B., Tor Aulin, and Carl-Erik Sundberg. Digital Phase
             Modulation. New York: Plenum Press, 1986.
                                                                                               4-133
CPM Modulator Passband
Description   The CPM Modulator Passband block modulates using continuous phase
              modulation. The output is a passband representation of the modulated signal.
              The M-ary number parameter, M, is the size of the input alphabet. M must
              have the form 2K for some positive integer K.
              This block uses the baseband equivalent block, CPM Modulator Baseband, for
              internal computations and converts the resulting baseband signal to a
              passband representation. The following parameters in this block are the same
              as those of the baseband equivalent block:
              • M-ary number
              • Input type
              • Symbol set ordering
              • Modulation index
              • Frequency pulse shape
              • Rolloff
              • BT product
              • Pulse length
              • Symbol prehistory
              The input must be sample-based. If the Input type parameter is Bit, then the
              input must be a vector of length log2(M). If the Input type parameter is
              Integer, then the input must be a scalar.
4-134
                                    CPM Modulator Passband
integer or binary word in the input, before the block converts them to a
passband output.
The timing-related parameters must satisfy these relationships:
                                                                           4-135
CPM Modulator Passband
Dialog Box
             M-ary number
                The size of the alphabet.
             Input type
                Indicates whether the input consists of integers or groups of bits.
             Symbol set ordering
                Determines how the block maps each group of input bits to a corresponding
                integer. This field is active only when Input type is set to Bit.
4-136
                                                  CPM Modulator Passband
             Modulation index
               The number of half-revolutions of phase shift due to the latest symbol when
               that symbol is the integer 1.
             Frequency pulse shape
                The type of pulse shaping that the block uses to smooth the phase
                transitions of the modulated signal.
             Rolloff
                The rolloff factor of the raised cosine filter. This field appears only when
                Frequency pulse shape is set to Spectral Raised Cosine.
             BT product
                The product of bandwidth and time. This field appears only when
                Frequency pulse shape is set to Gaussian.
                                                                                               4-137
CPM Modulator Passband
References   [2] Anderson, John B., Tor Aulin, and Carl-Erik Sundberg. Digital Phase
             Modulation. New York: Plenum Press, 1986.
4-138
                                                                           Data Mapper
Description   The Data Mapper block accepts integer inputs and produces integer outputs.
              You can select one of four mapping modes: Binary to Gray, Gray to Binary,
              User Defined, or Straight Through.
              • In the Binary to Gray mode, the output from this block is the integer
                equivalent of the Gray code bit representation for the input integer.
              • In the Gray to Binary mode, the output from this block is the integer
                position of the binary equivalent of the input integer in a Gray code ordering.
              As an example, the table below shows both the Binary to Gray and Gray to
              Binary mappings for integers in the range 0 to 7. In the Binary to Gray Mode
              Output column, notice that binary representations in successive rows differ by
              exactly one bit. In the Gray to Binary Mode columns, notice that sorting the
              rows by Output value creates a Gray code ordering of Input binary
              representations.
0 0 (000) 0 (000) 0
1 1 (001) 1 (001) 1
2 3 (011) 2 (010) 3
3 2 (010) 3 (011) 2
4 6 (110) 4 (100) 7
                                                                                                  4-139
Data Mapper
5 7 (111) 5 (101) 6
              6                   5 (101)            6 (110)             4
              7                   4 (100)            7 (111)             5
             When you select the User Defined mode, you can use any arbitrary mapping
             by providing a vector to specify the output ordering. For example, the vector
             [1,5,0,4,2,3] defines the following mapping:
             • 0→1
             • 1→5
             • 2→0
             • 3→4
             • 4→2
             • 5→3
When you select the Straight Through mode, the output equals the input.
Dialog Box
             Mapping mode
               The type of data mapping that the block performs.
4-140
                                                             Data Mapper
                                                                                   4-141
DBPSK Demodulator Baseband
Description   The DBPSK Demodulator Baseband block demodulates a signal that was
              modulated using the differential binary phase shift keying method. The input
              is a baseband representation of the modulated signal.
              The input must be a discrete-time complex signal. The block compares the
              current symbol to the previous symbol. It maps phase differences of θ and π+θ,
              respectively, to outputs of 0 and 1, respectively, where θ is the Phase offset
              parameter. The first element of the block’s output is the initial condition of zero
              because there is no previous symbol with which to compare the first symbol.
              The input can be either a scalar or a frame-based column vector.
Dialog Box
4-142
                                      DBPSK Demodulator Baseband
                                                                                    4-143
DBPSK Modulator Baseband
Description   The DBPSK Modulator Baseband block modulates using the differential
              binary phase shift keying method. The output is a baseband representation of
              the modulated signal.
              The input must be a discrete-time binary-valued signal. The input can be
              either a scalar or a frame-based column vector. These rules govern this
              modulation method when the Phase offset parameter is θ:
              • If the first input bit is 0 or 1, respectively, then the first modulated symbol
                is exp(jθ) or -exp(jθ), respectively.
              • If a successive input bit is 0 or 1, respectively, then the modulated symbol is
                the previous modulated symbol multiplied by exp(jθ) or -exp(jθ), respectively.
              This block can output an upsampled version of the modulated signal. The
              Samples per symbol parameter is the upsampling factor. It must be a positive
              integer. For more information, see “Upsampled Signals and Rate Changes” on
              page 2-72.
Dialog Box
4-144
                                            DBPSK Modulator Baseband
                                                                                           4-145
Deinterlacer
Purpose       4Deinterlacer
              Distribute elements of input vector alternately between two output vectors
Description   The Deinterlacer block accepts an input vector that has an even number of
              elements. The block alternately places the elements in each of two output
              vectors. As a result, each output vector size is half the input vector size. The
              output vectors have the same complexity and sample time of the input.
              The input can be either a sample-based vector of length two, or a frame-based
              column vector whose length is any even integer.
              This block can be useful for separating in-phase and quadrature information
              from a single vector into separate vectors.
Dialog Box
Examples      If the input vector is frame-based with value [1; 5; 2; 6; 3; 7; 4; 8], then the two
              output vectors are [1; 2; 3; 4] and [5; 6; 7; 8]. Notice that this is the inverse of
              the example on the reference page for the Interlacer block.
              If the input vector is frame-based with value [1; 2; 3; 4; 5; 6], then the two
              output vectors are [1; 3; 5] and [2; 4; 6].
4-146
                                                                                    Derepeat
Purpose       4Derepeat
              Reduce sampling rate by averaging consecutive samples
Description   The Derepeat block resamples the discrete input at a rate 1/N times the input
              sample rate by averaging N consecutive samples. This is one possible inverse
              of the Repeat block (DSP Blockset). The positive integer N is the Derepeat
              factor parameter in the Derepeat mask.
              Sample-Based Operation
              If the input is sample-based, then the block assumes that the input is a vector
              or matrix whose elements represent samples from independent channels. The
              block averages samples from each channel independently over time. The
              output period is N times the input period, and the input and output sizes are
              identical.
              Frame-Based Operation
              If the input is frame-based, then the block derepeats each frame, treating
              distinct channels independently. Each element of the output is the average of
              N consecutive elements along a column of the input matrix. The Derepeat
              factor must be less than the frame size.
              The Framing parameter determines how the block adjusts the rate at the
              output to accommodate the reduced number of samples. The two options are:
                                                                                                   4-147
Derepeat
               of N, the output frame period is N times the input frame period, but the input
               and output frame sizes are equal.
Dialog Box
             Derepeat factor, N
                The number of consecutive input samples to average in order to produce
                each output sample.
             Initial condition
                 The value with which to initialize the block.
4-148
                                                                          Derepeat
           Framing
              For frame-based operation, the method by which to reduce the amount of
              data. One method decreases the frame rate while maintaining frame size,
              while the other decreases the frame size while maintaining frame rate.
                                                                                        4-149
Descrambler
Purpose       4Descrambler
              Descramble the input signal
Description   The Descrambler block descrambles the scalar input signal. The Descrambler
              block is the inverse of the Scrambler block. If you use the Scrambler block in
              the transmitter, then you should use the Descrambler block in the receiver.
              Below is a schematic of the descrambler. All adders perform addition modulo
              N, where N is the Calculation base parameter. The input values must be
              integers between 0 and N-1.
                Input data
                                        1           2                    M-1         M
+ + + +
Descrambled data
              At each time step, the input causes the contents of the registers to shift
              sequentially. Each switch in the descrambler is on or off as defined by the
              Scramble polynomial parameter. To make the Descrambler block reverse the
              operation of the Scrambler block, use the same Scramble polynomial
              parameters in both blocks. The Initial states can be different in the two blocks,
              considering the transmitting and receiving filter delay. See the reference page
              for the Scrambler block for more information about these parameters.
4-150
                                                                          Descrambler
Dialog Box
             Calculation base
                The calculation base N. The input and output of this block are integers in
                the range [0, N-1].
             Scramble polynomial
                A polynomial that defines the connections in the scrambler.
             Initial states
                 The states of the scrambler’s registers when the simulation starts.
                                                                                             4-151
Differential Decoder
Description   The Differential Decoder block decodes the binary input signal. The output of
              the Differential Decoder block is the decoded binary signal.
              The block’s input m and output d are related by
                     d(t0) = m(t0) + 1 mod 2
Dialog Box
4-152
                                                             Differential Encoder
Description   The Differential Encoder block encodes and outputs the binary input signal.
              The input m and output d are related by
                     d(t0) = m(t0) +1 mod 2
Dialog Box
                                                                                              4-153
Discrete Modulo Integrator
Description   The Discrete Modulo Integrator block integrates its input signal in discrete
              time and then reduces modulo the Absolute value bound parameter. If the
              Absolute value bound parameter is K, then the block output is strictly
              between -K and K.
              The input can be either a scalar, a sample-based vector, or a frame-based row
              vector. The block processes each vector element independently.
              This block’s functionality is useful for monotonically increasing or decreasing
              functions, but works with any integrable function. This block uses the Forward
              Euler integration method.
Dialog Box
4-154
                                             Discrete Modulo Integrator
           Sample time
              The integration sample time.
See Also   Modulo Integrator, Windowed Integrator, Integrate and Dump, Discrete-Time
           Integrator (Simulink); rem (MATLAB)
                                                                                       4-155
Discrete-Time Eye and Scatter Diagrams
Description   The Discrete-Time Eye and Scatter Diagrams block plots eye diagrams and
              scatter diagrams from a discrete-time complex input signal. The input can be
              either a scalar or a frame-based column vector.
              The Diagram type parameter determines which plots the block produces. The
              block draws the diagrams in a single window.
              The Trace period parameter is the number of seconds represented by the
              horizontal axis in the eye diagram. The Trace offset parameter is the time
              value at the left edge of the horizontal axis of the eye diagram. This parameter
              must be between zero and the Trace period parameter.
              Whenever the simulation time modulo the Trace period value equals the
              Decision point parameter, the block plots a new point in the scatter diagram
              and a vertical line in the eye diagram. The Decision point parameter must be
              greater than or equal to the Trace offset parameter, and less than or equal to
              the sum of Trace period and Trace offset. Furthermore, if the block plots a
              scatter diagram, then the Decision point parameter must be an integer
              multiple of the Sample time for plot update parameter.
              The two-element Lower and upper bound of incoming signal vector
              parameter determines the vertical axis in the eye diagram and both axes in the
              scatter plot.
              To specify the plotting color, as well as the line type or marker type, use the
              Line type parameters that appear after you select a value for the Diagram
              type parameter. In the Line type for eye diagram parameter, use a slash (/)
              to separate the specifications for the in-phase and quadrature components of
              the input signal. Choices for the color, marker, and line types are in the table
              on the reference page for the Continuous-Time Eye and Scatter Diagrams
              block.
              The Sample time for plot update parameter determines which of the input
              data the block uses for creating plots. If the parameter matches the sample
              time of the input signal, then the block uses all available data. If the parameter
              is an integer multiple of the sample time of the input signal, then the block uses
              a decimated version of the input data.
4-156
                        Discrete-Time Eye and Scatter Diagrams
Dialog Box
             Trace period
                The duration of the horizontal axis of the eye diagram, in seconds.
             Trace offset
                The time at the leftmost edge of the horizontal axis of the eye diagram.
             Decision point
                The time at which the first point in the scatter plot and the vertical line in
                the eye diagram are plotted.
             Lower and upper bounds of diagram
                A two-element vector containing the minimum and maximum signal
                values in the diagrams.
             Number of saved traces
               The number of curves in the eye diagram, or points in the scatter plot, that
               are visible after you resize or restore the figure window.
                                                                                                 4-157
Discrete-Time Eye and Scatter Diagrams
              Diagram type
                 The diagram(s) that the block produces.
              Line type for eye diagram
                 A string that specifies the color and the line type for the eye diagram. This
                 field appears only when the Diagram type parameter is set to an option
                 that includes an eye diagram.
              Line type for scatter diagram
                 A string that specifies the color and the marker type for the scatter
                 diagram. This field appears only when the Diagram type parameter is set
                 to an option that includes an scatter diagram.
              Sample time for plot update
                 The time interval between successive input values that the block includes
                 in the plot(s).
Limitations   Since this block uses an M-file, you cannot generate C code for it using the
              Real-Time Workshop.
4-158
                                                                               Discrete-Time VCO
Dialog Box
              Output amplitude
                 The amplitude of the output.
              Oscillation frequency (Hz)
                 The frequency of the oscillator output when the input signal is zero.
                                                                                                   4-159
Discrete-Time VCO
           Input sensitivity
              This value scales the input voltage and, consequently, the shift from the
              Oscillation frequency value. The units of Input sensitivity are Hertz per
              volt.
           Initial phase (rad)
               The initial phase of the oscillator in radians.
           Sample time
              The calculation sample time.
4-160
                                                                       DPCM Decoder
Description   The DPCM Decoder block recovers a message from a quantized signal using
              differential pulse code demodulation. The input represents a DPCM-encoded
              quantization index. The input must be a scalar signal. Its two outputs are the
              recovered signal and the quantized predictive error.
              The description of the Sampled Quantizer Encode block gives more detailed
              information about quantization indices and quantization-encoded signals. The
              description of the DPCM Encoder block and the section “Implementing
              Differential Pulse Code Modulation” on page 2-21 give more information about
              implementing DPCM.
Dialog Box
              Predictor numerator
                 The vector of coefficients of the numerator of the predictor transfer
                 function, in order of ascending powers of z-1. The first entry must be zero.
              Predictor denominator
                 The vector of coefficients of the denominator of the predictor transfer
                 function, in order of ascending powers of z-1. Usually this parameter is 1.
                                                                                                4-161
DPCM Decoder
             Quantization codebook
               The vector of output values that the quantizer assigns to each partition.
             Sample time
                The block’s sample time.
             Match these parameters to the ones in the corresponding DPCM Encoder block.
References   [1] Kondoz, A. M. Digital Speech. Chichester, England: John Wiley & Sons,
             1994.
4-162
                                                                        DPCM Encoder
Description   The DPCM Encoder block quantizes the input signal using differential pulse
              code modulation. The input must be a scalar signal. Its two outputs are the
              quantization index and the quantization-encoded signal.
              This block uses the Sampled Quantizer Encode block. The description of that
              block gives more detailed information about quantization indices and
              quantization-encoded signals.
              Quantization partition is a vector whose entries give the endpoints of the
              partition intervals. Quantization codebook, a vector whose length exceeds
              the length of Quantization partition by one, prescribes a value for each
              partition in the quantization. The first element of Quantization codebook is
              the value for the interval between negative infinity and the first element of
              Quantization partition.
              You can think of the predictor as a transfer function for an IIR filter, hence a
              rational function of z-1. Specify the predictor’s numerator and denominator by
              listing their coefficients in the vectors Predictor numerator and Predictor
              denominator, respectively. List the coefficients in order of increasing powers
              of z-1.
              Note The first entry of Predictor numerator must be zero. A nonzero entry
              there would fail to make sense conceptually, and would create an algebraic
              loop in the implementation.
              You can use the function dpcmopt in the Communications Toolbox to train the
              Predictor numerator, Predictor denominator, Quantization partition, and
              Quantization codebook parameters. The output of dpcmopt omits the
              denominator of the predictor, assuming that it will be 1. In most DPCM
              applications, the denominator of the predictor transfer function is 1.
              If Predictor numerator has the form [0, x] and Predictor denominator is 1,
              then the modulation is called delta modulation.
                                                                                                 4-163
DPCM Encoder
Dialog Box
             Predictor numerator
                The vector of coefficients of the numerator of the predictor transfer
                function, in order of ascending powers of z-1. The first entry must be zero.
             Predictor denominator
                The vector of coefficients of the denominator of the predictor transfer
                function, in order of ascending powers of z-1. Usually this parameter is 1.
             Quantization partition
               The vector of endpoints of the partition intervals. The elements must be in
               strictly ascending order.
             Quantization codebook
               The vector of output values that the quantizer assigns to each partition.
             Sample time
                The block’s sample time.
References   [1] Kondoz, A. M. Digital Speech. Chichester, England: John Wiley & Sons,
             1994.
4-164
                                            DQPSK Demodulator Baseband
Description   The DQPSK Demodulator Baseband block demodulates a signal that was
              modulated using the differential quaternary phase shift keying method. The
              input is a baseband representation of the modulated signal.
              The input must be a discrete-time complex signal. The output depends on the
              phase difference between the current symbol and the previous symbol. The
              first integer (or binary pair, if the Output type parameter is set to Bit) in the
              block’s output is the initial condition of zero because there is no previous
              symbol.
              The input can be either a scalar or a frame-based column vector.
                                                                                                  4-165
DQPSK Demodulator Baseband
Dialog Box
             Output type
                Determines whether the output consists of integers or pairs of bits.
             Constellation ordering
                Determines how the block maps each integer to a pair of output bits. This
                field is active only when Output type is set to Bit.
             Phase offset (rad)
                This phase difference between the current and previous modulated
                symbols results in an output of zero.
             Samples per symbol
                The number of input samples that represent each modulated symbol.
4-166
                                              DQPSK Modulator Baseband
Description   The DQPSK Modulator Baseband block modulates using the differential
              quaternary phase shift keying method. The output is a baseband
              representation of the modulated signal.
              The input must be a discrete-time signal.
                                                                                                 4-167
DQPSK Modulator Baseband
Binary Gray
01 00 01 00
10 11 11 10
         The figure below shows the signal constellation for the DQPSK modulation
         method when the Phase offset parameter is π/4. The arrows indicate the four
         possible transitions from each symbol to the next symbol. The Binary and
         Gray options determine which transition is associated with each pair of input
         values.
                                                  Constellation point
                                                  Transition to next point
         More generally, if the Phase offset parameter has the form π/k for some
         integer k, then the signal constellation has 2k points.
4-168
                                            DQPSK Modulator Baseband
Dialog Box
             Input type
                Indicates whether the input consists of integers or pairs of bits.
             Constellation ordering
                Determines how the block maps each pair of input bits to a corresponding
                integer. This field is active only when Input type is set to Bit.
             Phase offset (rad)
                The phase difference between the previous and current modulated symbols
                when the input is zero.
                                                                                            4-169
DQPSK Modulator Baseband
4-170
                                             DSB AM Demodulator Baseband
Description   The DSB AM Demodulator Baseband block demodulates a signal that was
              modulated using double-sideband amplitude modulation. The input is a
              baseband representation of the modulated signal. The input is complex, while
              the output is real. The input must be a sample-based scalar signal.
              In the course of demodulating, this block uses a filter whose transfer function
              is described by the Lowpass filter numerator and Lowpass filter
              denominator parameters.
Dialog Box
                                                                                                4-171
DSB AM Demodulator Baseband
4-172
                                              DSB AM Demodulator Passband
Description    The DSB AM Demodulator Passband block demodulates a signal that was
               modulated using double-sideband amplitude modulation. The block uses the
               envelope detection method. The input is a passband representation of the
               modulated signal. Both the input and output signals are real sample-based
               scalar signals.
               In the course of demodulating, this block uses a filter whose transfer function
               is described by the Lowpass filter numerator and Lowpass filter
               denominator parameters.
Dialog Block
               Offset factor
                  The same as the Input signal offset parameter in the corresponding AM
                  with Carrier block.
               Carrier frequency (Hz)
                  The frequency of the carrier in the corresponding AM with Carrier block.
                                                                                                 4-173
DSB AM Demodulator Passband
4-174
                                                DSB AM Modulator Baseband
Dialog Box
                                                                                                4-175
DSB AM Modulator Passband
where:
Dialog Box
4-176
                                            DSB AM Modulator Passband
                                                                                         4-177
DSBSC AM Demodulator Baseband
Description   The DSBSC AM Demodulator Baseband block demodulates a signal that was
              modulated using double-sideband suppressed-carrier amplitude modulation.
              The input is a baseband representation of the modulated signal. The input is
              complex, while the output is real. The input must be a sample-based scalar
              signal.
              In the course of demodulating, this block uses a filter whose transfer function
              is described by the Lowpass filter numerator and Lowpass filter
              denominator parameters.
Dialog Box
4-178
                                DSBSC AM Demodulator Baseband
                                                                                      4-179
DSBSC AM Demodulator Passband
Description   The DSBSC AM Demodulator Passband block demodulates a signal that was
              modulated using double-sideband suppressed-carrier amplitude modulation.
              The input is a passband representation of the modulated signal. Both the input
              and output signals are real sample-based scalar signals.
              In the course of demodulating, this block uses a filter whose transfer function
              is described by the Lowpass filter numerator and Lowpass filter
              denominator parameters.
Dialog Box
4-180
                                  DSBSC AM Demodulator Passband
                                                                                                  4-181
DSBSC AM Modulator Baseband
Dialog Box
4-182
                                             DSBSC AM Modulator Passband
Dialog Box
                                                                                              4-183
DSBSC AM Modulator Passband
4-184
                                                    Enabled Quantizer Encode
Description   The Enabled Quantizer Encode block performs quantization when a trigger
              signal occurs. This block is similar to the Sampled Quantizer Encode block,
              except that a trigger signal at the second input port controls the quantization
              processing. This block renews its output when the scalar trigger signal is
              nonzero. For more about quantization, see the reference page for the Sampled
              Quantizer Encode block.
              This block has two input ports and three output ports. The first input signal is
              the data to be quantized, while the second is the trigger signal that controls the
              timing of quantization. The three output signals represent the quantization
              index, quantization value, and mean square distortion, respectively.
              The first input can be either a scalar, a sample-based vector, or a frame-based
              row vector. This block processes each vector element independently. Each
              output signal is a vector of the same length as the first input signal. The trigger
              input must be a scalar.
Dialog Box
                                                                                                    4-185
Enabled Quantizer Encode
             Quantization partition
               The vector of endpoints of the partition intervals. The elements must be in
               strictly ascending order.
             Quantization codebook
               The vector of output values assigned to each partition.
             Input signal vector length
                The length of the input signal.
4-186
                                                            Error Rate Calculation
Description   The Error Rate Calculation block compares input data from a transmitter with
              input data from a receiver. It calculates the error rate as a running statistic, by
              dividing the total number of unequal pairs of data elements by the total
              number of input data elements from one source.
              You can use this block to compute either symbol or bit error rate, because it
              does not consider the magnitude of the difference between input data elements.
              If the inputs are bits, then the block computes the bit error rate. If the inputs
              are symbols, then it computes the symbol error rate.
              This block inherits the sample time of its inputs.
              Input Data
              This block has between two and four input ports, depending on how you set the
              mask parameters. The inports marked Tx and Rx accept transmitted and
              received signals, respectively. The Tx and Rx signals must share the same
              sampling rate.
              The Tx and Rx inputs can be either scalars or frame-based column vectors. If Tx
              is a scalar and Rx is a vector, or vice-versa, then the block compares the scalar
              with each element of the vector. (Overall, the block behaves as if you had
              preprocessed the scalar signal with the DSP Blockset’s Repeat block using the
              Maintain input frame rate option.)
              If you check the Reset port box in the mask, then an additional inport appears,
              labeled Rst. The Rst input must be a sample-based scalar signal and must have
              the same sampling rate as the Tx and Rx signals. When the Rst input is
              nonzero, the block clears its error statistics and then computes them anew.
              If you set the Computation mode mask parameter to Select samples from
              port, then an additional inport appears, labeled Sel. The Sel input indicates
              which elements of a frame are relevant for the computation; this is explained
              further, in the last subbullet below. The Sel input can be either a sample-based
              column vector or a one-dimensional vector.
                                                                                                    4-187
Error Rate Calculation
            The guidelines below indicate how you should configure the inputs and the
            mask parameters depending on how you want this block to interpret your Tx
            and Rx data.
            • If both data signals are scalar, then this block compares the Tx scalar signal
              with the Rx scalar signal. You should leave the Computation mode
              parameter at its default value, Entire frame.
            • If both data signals are vectors, then this block compares some or all of the
              Tx and Rx data:
              - If you set the Computation mode parameter to Entire frame, then the
                block compares all of the Tx frame with all of the Rx frame.
              - If you set the Computation mode parameter to Select samples from
                mask, then the Selected samples from frame field appears in the mask.
                This parameter field accepts a vector that lists the indices of those
                elements of the Rx frame that you want the block to consider. For example,
                to consider only the first and last elements of a length-six receiver frame,
                set the Selected samples from frame parameter to [1 6]. If the Selected
                samples from frame vector includes zeros, then the block ignores them.
              - If you set the Computation mode parameter to Select samples from
                port, then an additional input port, labeled Sel, appears on the block icon.
                The data at this input port must have the same format as that of the
                Selected samples from frame mask parameter described above.
            • If one data signal is a scalar and the other is a vector, then this block
              compares the scalar with each entry of the vector. The three subbullets above
              are still valid for this mode, except that if Rx is a scalar, then the phrase “Rx
              frame” above refers to the vector expansion of Rx.
            Note Simulink requires that input signals have constant length throughout
            a simulation. If you choose the Select samples from port option and want the
            number of elements in the subframe to vary during the simulation, then you
            should pad the Sel signal with zeros. (See the Zero Pad block in the DSP
            Blockset.) The Error Rate Calculation block ignores zeros in the Sel signal.
4-188
                                            Error Rate Calculation
Output Data
This block produces a vector of length three, whose entries correspond to:
The block sends this output data to the workspace or to an output port,
depending on how you set the Output data parameter in the mask:
• If you set the Output data parameter to Workspace and fill in the Variable
  name parameter, then that variable contains the current value when the
  simulation ends. Pausing the simulation does not cause the block to write
  interim data to the variable.
  If you plan to use this block along with the Real-Time Workshop, then you
  should not use the Workspace option; instead, use the Port option below and
  connect the output port to a Simulink To Workspace block.
• If you set the Output data parameter to Port, then an output port appears.
  This output port contains the running error statistics.
Delays
The Receive delay and Computation delay parameters implement two
different types of delays for this block. One is useful when part of your model
causes a lag in the received data, and the other is useful when you want to
ignore the transient behavior of both input signals:
                                                                                  4-189
Error Rate Calculation
            Note The Version 1.4 Error Rate Calculation block considers a vector input
            to be a sample, whereas the current block considers a vector input to be a
            frame of multiple samples. For vector inputs of length n, a Receive delay of k
            in the Version 1.4 block is equivalent to a Receive delay of k*n in the current
            block.
            If you use the Select samples from mask or Select samples from port option,
            then each delay parameter refers to the number of samples that the block
            receives, whether the block ultimately ignores some of them or not.
Examples    The figure below shows how the block compares pairs of elements and counts
            the number of error events. This example assumes that the sample time of each
            input signal is 1 second and that the block’s parameters are as follows:
            • Receive delay = 2
            • Computation delay = 0
            • Computation mode = Entire frame
            The input signals are both frame-based column vectors of length three.
            However, the schematic arranges each column vector horizontally and aligns
            pairs of vectors so as to reflect a receive delay of two samples. At each time step,
            the block compares elements of the Rx signal with those of the Tx signal that
            appear directly above them in the schematic. For instance, at time 1, the block
            compares 2, 4, and 1 from the Rx signal with 2, 3, and 1 from the Tx signal.
            The values of the first two elements of Rx appear as asterisks because they do
            not influence the output. Similarly, the 6 and 5 in the Tx signal do not influence
            the output up to time 3, though they would influence the output at time 4.
            In the error rates on the right side of the figure, each numerator at time t
            reflects the number of errors when considering the elements of Rx up through
            time t.
4-190
                                                         Error Rate Calculation
                  t=0             t=1
       Tx                                                        Error rates as fractions
              1 2 3 1 2 3 1 7 7 1 6 5
                                                                0/1 1/4 2/7 4/10
     * * 1 2 4 1 2 3 3 3 2 1
Rx                                                              t=0    t=1
        t=0             t=1
                                   time                                time
If the block’s Reset port box had been checked and a reset had occurred at
time = 3 seconds, then the last error rate would have been 2/3 instead of 4/10.
This value 2/3 would reflect the comparison of 3, 2, and 1 from the Rx signal
with 7, 7, and 1 from the Tx signal. The figure below illustrates this scenario.
                  t=0             t=1
        Tx 1 2 3 1 2 3 1 7 7 1 6 5                                Error rates as fractions
Rx * * 1 2 4 1 2 3 3 3 2 1                                      0/1 1/4 2/7 2/3
              0               0            0   1                 t=0    t=1
          t=0            t=1
                                    time                               time
                                                                                             4-191
Error Rate Calculation
Dialog Box
             Receive delay
                Number of samples by which the received data lags behind the transmitted
                data. (If Tx or Rx is a vector, then each entry represents a sample.)
             Computation delay
               Number of samples that the block should ignore at the beginning of the
               comparison.
             Computation mode
               Either Entire frame, Select samples from mask, or Select samples from
               port, depending on whether the block should consider all or only part of the
               input frames.
             Selected samples from frame
                A vector that lists the indices of the elements of the Rx frame vector that
                the block should consider when making comparisons. This field appears
                only if Computation mode is set to Select samples from mask.
4-192
                                            Error Rate Calculation
Output data
   Either Workspace or Port, depending on where you want to send the
   output data.
Variable name
   Name of workspace variable for the output data vector. This field appears
   only if Output data is set to Workspace.
Reset port
   If you check this box, then an additional input port appears, labeled Rst.
                                                                                4-193
FM Demodulator Baseband
Dialog Box
4-194
                                                FM Demodulator Baseband
                                                                                                  4-195
FM Demodulator Passband
Dialog Box
4-196
                                                 FM Demodulator Passband
                                                                                                  4-197
FM Modulator Baseband
                                 t
                                       ò
                    exp jθ + 2πjKc u ( τ ) dτ
Dialog Box
4-198
                                                   FM Modulator Baseband
                                                                                            4-199
FM Modulator Passband
                                      t
                                        ò
                    cos 2πf c t + 2πK c u ( τ ) dτ + θ
where:
4-200
                                                     FM Modulator Passband
Dialog Box
                                                                                            4-201
Gaussian Noise Generator
Description   The Gaussian Noise Generator block generates discrete-time white Gaussian
              noise. You must specify the Initial seed vector in the simulation.
              The Mean Value and the Variance can be either scalars or vectors. If either of
              these is a scalar, then the block applies the same value to each element of a
              sample-based output or each column of a frame-based output. Individual
              elements or columns, respectively, are uncorrelated with each other.
              When the Variance is a vector, its length must be the same as that of the
              Initial seed vector. In this case, the covariance matrix is a diagonal matrix
              whose diagonal elements come from the Variance vector. Since the
              off-diagonal elements are zero, the output Gaussian random variables are
              uncorrelated.
              When the Variance is a square matrix, it represents the covariance matrix. Its
              off-diagonal elements are the correlations between pairs of output Gaussian
              random variables. In this case, the Variance matrix must be positive definite,
              and it must be N-by-N, where N is the length of the Initial seed.
              The probability density function of n-dimensional Gaussian noise is
                                                    1
                                                  – ---
                                          n         2                    T    –1
                     f ( x ) = ( ( 2π ) det K )           exp ( – ( x – µ ) K ( x – µ ) ⁄ 2 )
              where x is a length-n vector, K is the n-by-n covariance matrix, µ is the mean
              value vector, and the superscript T indicates matrix transpose.
4-202
                                                Gaussian Noise Generator
Dialog Box
             Mean value
               The mean value of the random variable output.
             Variance
                The covariance among the output random variables.
             Initial seed
                 The initial seed value for the random number generator.
             Sample time
                The period of each sample-based vector or each row of a frame-based
                matrix.
             Frame-based outputs
                Determines whether the output is frame-based or sample-based. This box
                is active only if Interpret vector parameters as 1-D is unchecked.
                                                                                              4-203
Gaussian Noise Generator
See Also   Random Source (DSP Blockset), AWGN Channel; rand (built-in MATLAB
           function)
4-204
                                                 General Block Deinterleaver
Description   The General Block Deinterleaver block rearranges the elements of its input
              vector without repeating or omitting any elements. The input can be real or
              complex. If the input contains N elements, then the Elements parameter is a
              vector of length N that indicates the indices, in order, of the output elements
              that came from the input vector. That is, for each integer k between 1 and N,
                    Output(Elements(k)) = Input(k)
              The Elements parameter must contain unique integers between 1 and N.
              If the input is frame-based, then both it and the Elements parameter must be
              column vectors.
              To use this block as an inverse of the General Block Interleaver block, use the
              same Elements parameter in both blocks. In that case, the two blocks are
              inverses in the sense that applying the General Block Interleaver block
              followed by the General Block Deinterleaver block leaves data unchanged.
Dialog Box
              Elements
                 A vector of length N that lists the indices of the output elements that came
                 from the input vector.
Examples      This example reverses the operation in the example on the General Block
              Interleaver block reference page. If Elements is [4,1,3,2] and the input to the
              General Block Deinterleaver block is [1;40;59;32], then the output of the
              General Block Deinterleaver block is [40;32;59;1].
                                                                                                4-205
General Block Deinterleaver
4-206
                                                     General Block Interleaver
Description   The General Block Interleaver block rearranges the elements of its input vector
              without repeating or omitting any elements. The input can be real or complex.
              If the input contains N elements, then the Elements parameter is a vector of
              length N that indicates the indices, in order, of the input elements that form
              the length-N output vector; that is,
                    Output(k) = Input(Elements(k))
              for each integer k between 1 and N. The contents of Elements must be integers
              between 1 and N, and must have no repetitions.
              If the input is frame-based, then both it and the Elements parameter must be
              column vectors.
Dialog Box
              Elements
                 A vector of length N that lists the indices of the input elements that form
                 the output vector.
Examples      If Elements is [4,1,3,2] and the input vector is [40;32;59;1], then the
              output vector is [1;40;59;32]. Notice that all of these vectors have the same
              length and that the vector Elements is a permutation of the vector [1:4].
                                                                                                4-207
General Multiplexed Deinterleaver
Description   The General Multiplexed Deinterleaver block restores the original ordering of
              a sequence that was interleaved using the General Multiplexed Interleaver
              block.
              In typical usage, the parameters in the two blocks have the same values. As a
              result, the Interleaver delay parameter, V, specifies the delays for each shift
              register in the corresponding interleaver, so that the delays of the
              deinterleaver’s shift registers are actually max(V)-V.
              The input can be either a scalar or a frame-based column vector. It can be real
              or complex. The input and output signals share the same sample time.
Dialog Box
4-208
                                General Multiplexed Deinterleaver
References   [1] Heegard, Chris and Stephen B. Wicker. Turbo Coding. Boston: Kluwer
             Academic Publishers, 1999.
                                                                                      4-209
General Multiplexed Interleaver
Description   The General Multiplexed Interleaver block permutes the symbols in the input
              signal. Internally, it uses a set of shift registers, each with its own delay value.
              The input can be either a scalar or a frame-based column vector. It can be real
              or complex. The input and output signals share the same sample time.
              The Interleaver delay parameter is a column vector whose entries indicate
              how many symbols can fit into each shift register. The length of the vector is
              the number of shift registers. (In sample-based mode, it can also be a row
              vector.)
              The Initial conditions parameter indicates the values that fill each shift
              register at the beginning of the simulation. If Initial conditions is a scalar,
              then its value fills all shift registers; if Initial conditions is a column vector,
              then each entry fills the corresponding shift register. (In sample-based mode,
              Initial conditions can also be a row vector.) If a given shift register has zero
              delay, then the value of the corresponding entry in the Initial conditions
              vector is unimportant.
Dialog Box
4-210
                                      General Multiplexed Interleaver
             Initial conditions
                 The values that fill each shift register when the simulation begins.
References   [1] Heegard, Chris and Stephen B. Wicker. Turbo Coding. Boston: Kluwer
             Academic Publishers, 1999.
                                                                                        4-211
General QAM Demodulator Baseband
Description   The General QAM Demodulator Baseband block demodulates a signal that was
              modulated using quadrature amplitude modulation. The input is a baseband
              representation of the modulated signal.
              The input must be a discrete-time complex signal. The Signal constellation
              parameter defines the constellation by listing its points in a vector of complex
              numbers. The block maps the mth point in the Signal constellation vector to
              the integer m-1.
              The input can be either a scalar or a frame-based column vector.
Dialog Box
              Signal constellation
                 A real or complex vector that lists the constellation points.
4-212
                          General QAM Demodulator Baseband
                                                                                    4-213
General QAM Demodulator Passband
Description   The General QAM Demodulator Passband block demodulates a signal that was
              modulated using the pulse amplitude phase shift keying method. The input is
              a passband representation of the modulated signal.
              The input must be a sample-based scalar. Furthermore, it must be a
              discrete-time complex signal.
              The Signal constellation parameter defines the constellation by listing its
              points in a vector of complex numbers.
              Also, this block incurs an extra output period of delay compared to its baseband
              equivalent block.
4-214
                            General QAM Demodulator Passband
Dialog Box
             Signal constellation
                A real or complex vector that lists the constellation points.
             Symbol period (s)
                The symbol period, which equals the sample time of the output.
             Baseband samples per symbol
                The number of baseband samples that represent each modulated symbol,
                after the block converts the passband input to a baseband intermediary
                signal.
             Carrier frequency (Hz)
                The frequency of the carrier.
             Carrier initial phase (rad)
                The initial phase of the carrier in radians.
             Input sample time
                The sample time of the input signal.
                                                                                         4-215
General QAM Demodulator Passband
4-216
                                                General QAM Modulator Baseband
Description   The General QAM Modulator Baseband block modulates using quadrature
              amplitude modulation. The output is a baseband representation of the
              modulated signal.
              The Signal constellation parameter defines the constellation by listing its
              points in a length-M vector of complex numbers. The input signal values must
              be integers between 0 and M-1. The block maps an input integer m to the
              (m-1)st value in the Signal constellation vector.
              The input can be either a scalar or a frame-based column vector.
Dialog Box
              Signal constellation
                 A real or complex vector that lists the constellation points.
                                                                                             4-217
General QAM Modulator Baseband
4-218
                                                General QAM Modulator Passband
Description   The General QAM Modulator Passband block modulates using the pulse
              amplitude modulation phase shift keying method. The output is a passband
              representation of the modulated signal.
              The Signal constellation parameter defines the constellation by listing its
              points in a length-M vector of complex numbers. The input signal values must
              be integers between 0 and M-1. The block maps an input integer m to the
              (m-1)st value in the Signal constellation vector, and then converts these
              mapped values to a passband output signal.
              The input must be a sample-based scalar signal.
                                                                                             4-219
General QAM Modulator Passband
Dialog Box
             Signal constellation
                A real or complex vector that lists the constellation points.
             Symbol period (s)
                The symbol period, which must equal the sample time of the input.
             Baseband samples per symbol
                The number of baseband samples that correspond to each integer or binary
                word in the input, before the block converts them to a passband output.
             Carrier frequency (Hz)
                The frequency of the carrier.
             Carrier initial phase (rad)
                The initial phase of the carrier in radians.
             Output sample time
                The sample time of the output signal.
4-220
                             General QAM Modulator Passband
                                                        4-221
GMSK Demodulator Baseband
Description   The GMSK Demodulator Baseband block demodulates a signal that was
              modulated using the Gaussian minimum shift keying method. The input is a
              baseband representation of the modulated signal.
              The BT product, Pulse length, Symbol prehistory, and Phase offset
              parameters are as described on the reference page for the GMSK Modulator
              Baseband block.
              • If the input signal is sample-based, then the delay consists of D+1 zero
                symbols.
              • If the input signal is frame-based, then the delay consists of D zero symbols.
4-222
                                        GMSK Demodulator Baseband
Dialog Box
             Output type
                Determines whether the output consists of bipolar or binary values.
             BT product
                The product of bandwidth and time.
             Pulse length (symbol intervals)
                The length of the frequency pulse shape.
             Symbol prehistory
                The data symbols used by the modulator before the start of the simulation.
             Phase offset (rad)
                The initial phase of the modulated waveform.
                                                                                         4-223
GMSK Demodulator Baseband
References   [1] Anderson, John B., Tor Aulin, and Carl-Erik Sundberg. Digital Phase
             Modulation. New York: Plenum Press, 1986.
4-224
                                           GMSK Demodulator Passband
Description   The GMSK Demodulator Passband block demodulates a signal that was
              modulated using the Gaussian minimum shift keying method. The input is a
              passband representation of the modulated signal.
              This block converts the input to an equivalent baseband representation and
              then uses the baseband equivalent block, GMSK Demodulator Baseband, for
              internal computations. The following parameters in this block are the same as
              those of the baseband equivalent block:
              •   Output type
              •   BT product
              •   Pulse length
              •   Symbol prehistory
              •   Traceback length
              The input must be a sample-based scalar signal.
                                                                                               4-225
GMSK Demodulator Passband
             Also, this block incurs an extra output period of delay compared to its baseband
             equivalent block.
Dialog Box
             Output type
                Determines whether the output consists of bipolar or binary values.
             BT product
                The product of bandwidth and time.
4-226
                                         GMSK Demodulator Passband
References   [1] Anderson, John B., Tor Aulin, and Carl-Erik Sundberg. Digital Phase
             Modulation. New York: Plenum Press, 1986.
                                                                                         4-227
GMSK Modulator Baseband
Description   The GMSK Modulator Baseband block modulates using the Gaussian
              minimum shift keying method. The output is a baseband representation of the
              modulated signal.
              The BT product parameter represents bandwidth multipled by time. This
              parameter is a nonnegative scalar. It is used to reduce the bandwidth at the
              expense of increased intersymbol interference. The Pulse length parameter
              measures the length of the Gaussian pulse shape, in symbol intervals. For the
              exact definitions of the pulse shape, see the work by Anderson, Aulin, and
              Sundberg listed in “References” on page 4-230.
              The Symbol prehistory parameter is a scalar or vector that specifies the data
              symbols used before the start of the simulation, in reverse chronological order.
              If it is a vector, then its length must be one less than the Pulse length
              parameter.
              In this block, a symbol of 1 causes a phase shift of π/2 radians. The Phase offset
              parameter is the initial phase of the output waveform, measured in radians.
              Input Attributes
              The input can be either a scalar or a frame-based column vector. If the Input
              type parameter is set to Integer, then the block accepts values of 1 and -1. If
              the Input type parameter is set to Bit, then the block accepts values of 0 and 1.
4-228
                                             GMSK Modulator Baseband
Dialog Box
             Input type
                Indicates whether the input consists of bipolar or binary values.
             BT product
                The product of bandwidth and time.
             Pulse length (symbol intervals)
                The length of the frequency pulse shape.
             Symbol prehistory
                The data symbols used before the start of the simulation, in reverse
                chronological order.
             Phase offset (rad)
                The initial phase of the output waveform.
                                                                                       4-229
GMSK Modulator Baseband
References   [1] Anderson, John B., Tor Aulin, and Carl-Erik Sundberg. Digital Phase
             Modulation. New York: Plenum Press, 1986.
4-230
                                              GMSK Modulator Passband
Description   The GMSK Modulator Passband block modulates using the Gaussian
              minimum shift keying method. The output is a passband representation of the
              modulated signal.
              This block uses the baseband equivalent block, GMSK Modulator Baseband,
              for internal computations and converts the resulting baseband signal to a
              passband representation. The following parameters in this block are the same
              as those of the baseband equivalent block:
              • Input type
              • BT product
              • Pulse length
              • Symbol prehistory
              The input must be sample-based. If the Input type parameter is Bit, then the
              input must be a vector of length log2(M). If the Input type parameter is
              Integer, then the input must be a scalar.
                                                                                             4-231
GMSK Modulator Passband
Dialog Box
             Input type
                Indicates whether the input consists of bipolar or binary values.
             BT product
                The product of bandwidth and time.
             Pulse length (symbol intervals)
                The length of the frequency pulse shape.
4-232
                                                GMSK Modulator Passband
             Symbol prehistory
                The data symbols used before the start of the simulation, in reverse
                chronological order.
             Symbol period (s)
                The symbol period, which must equal the sample time of the input.
             Baseband samples per symbol
                The number of baseband samples that correspond to each integer or binary
                word in the input, before the block converts them to a passband output.
             Carrier frequency (Hz)
                The frequency of the carrier.
             Carrier initial phase (rad)
                The initial phase of the carrier in radians.
             Output sample time
                The sample time of the output signal.
References   [1] Anderson, John B., Tor Aulin, and Carl-Erik Sundberg. Digital Phase
             Modulation. New York: Plenum Press, 1986.
                                                                                           4-233
Hamming Decoder
Description   The Hamming Decoder block recovers a binary message vector from a binary
              Hamming codeword vector. For proper decoding, the parameter values in this
              block should match those in the corresponding Hamming Encoder block.
              If the Hamming code has message length K and codeword length N, then N
              must have the form 2M-1 for some integer M greater than or equal to 3. Also, K
              must equal N-M.
              The input must contain exactly N elements. If it is frame-based, then it must
              be a column vector. The output is a vector of length K.
              The coding scheme uses elements of the finite field GF(2M). You can either
              specify the primitive polynomial that the algorithm should use, or you can rely
              on the default setting:
              • To use the default primitive polynomial, simply enter N and K as the first
                and second mask parameters, respectively. The algorithm uses gfprimdf(M)
                as the primitive polynomial for GF(2M).
              • To specify the primitive polynomial, enter N as the first parameter and a
                binary vector as the second parameter. The vector represents the primitive
                polynomial by listing its coefficients in order of ascending exponents. You can
                create primitive polynomials using the gfprimfd function in the
                Communications Toolbox.
4-234
                                                             Hamming Decoder
Dialog Box
             Codeword length N
                The codeword length N, which is also the input vector length.
             Message length K, or M-degree primitive polynomial
               Either the message length, which is also the output vector length; or a
               binary vector that represents a primitive polynomial for GF(2M).
                                                                                         4-235
Hamming Encoder
Description   The Hamming Encoder block creates a Hamming code with message length K
              and codeword length N. The number N must have the form 2M-1, where M is
              an integer greater than or equal to 3. Then K equals N-M.
              The input must contain exactly K elements. If it is frame-based, then it must
              be a column vector. The output is a vector of length N.
              The coding scheme uses elements of the finite field GF(2M). You can either
              specify the primitive polynomial that the algorithm should use, or you can rely
              on the default setting:
              • To use the default primitive polynomial, simply enter N and K as the first
                and second mask parameters, respectively. The algorithm uses gfprimdf(M)
                as the primitive polynomial for GF(2M).
              • To specify the primitive polynomial, enter N as the first parameter and a
                binary vector as the second parameter. The vector represents the primitive
                polynomial by listing its coefficients in order of ascending exponents. You can
                create primitive polynomials using the gfprimfd function in the
                Communications Toolbox.
Dialog Box
              Codeword length N
                 The codeword length, which is also the output vector length.
4-236
                                                              Hamming Encoder
                                                                                        4-237
Helical Deinterleaver
Description   The Helical Deinterleaver block permutes the symbols in the input signal by
              placing them in an array row by row and then selecting groups in a helical
              fashion to send to the output port.
              The block uses the array internally for its computations. If C is the Number of
              columns in helical array parameter, then the array has C columns and
              unlimited rows. If N is the Group size parameter, then the block accepts an
              input of length C*N at each time step and inserts them into the next N rows of
              the array. The block also places the Initial condition parameter into certain
              positions in the top few rows of the array (not only to accommodate the helical
              pattern but also to preserve the vector indices of symbols that pass through the
              Helical Interleaver and Helical Deinterleaver blocks in turn).
              The output consists of consecutive groups of N symbols. Counting from the
              beginning of the simulation, the block selects the kth output group in the array
              from column k mod C. The selection is helical because of the reduction modulo
              C and because the first symbol in the kth group is in row 1+(k-1)*s, where s is
              the Helical array step size parameter.
              The number of elements of the input vector must be C times N. If the input is
              frame-based, then it must be a column vector.
                        s(C – 1)
                     CN --------------------
                                           -
                                N
              samples. Before this delay elapses, the deinterleaver output is either the
              Initial condition parameter in the Helical Deinterleaver block or the Initial
              condition parameter in the Helical Interleaver block.
              If your model incurs an additional delay between the interleaver output and
              the deinterleaver input, then the restored sequence lags the original sequence
              by the sum of the additional delay and the amount in the formula above. For
              proper synchronization, the delay between the interleaver and deinterleaver
4-238
                                                             Helical Deinterleaver
             must be m*C*N for some nonnegative integer m. You can use the Integer Delay
             block in the DSP Blockset to adjust delays manually, if necessary.
Dialog Box
                                                                                             4-239
Helical Deinterleaver
References   [1] Berlekamp, E. R. and P. Tong. “Improved Interleavers for Algebraic Block
             Codes.” U. S. Patent 4559625, Dec. 17, 1985.
4-240
                                                                 Helical Interleaver
Description   The Helical Interleaver block permutes the symbols in the input signal by
              placing them in an array in a helical fashion and then sending rows of the array
              to the output port.
              The block uses the array internally for its computations. If C is the Number of
              columns in helical array parameter, then the array has C columns and
              unlimited rows. If N is the Group size parameter, then the block accepts an
              input of length C*N at each time step and partitions the input into consecutive
              groups of N symbols. Counting from the beginning of the simulation, the block
              places the kth group in the array along column k mod C. The placement is
              helical because of the reduction modulo C and because the first symbol in the
              kth group is in row 1+(k-1)*s, where s is the Helical array step size parameter.
              Positions in the array that do not contain input symbols have default contents
              specified by the Initial condition parameter.
              The block sends C*N symbols from the array to the output port by reading the
              next N rows sequentially. At a given time step, the output symbols might be
              the Initial condition parameter value, symbols from that time step’s input
              vector, or symbols left in the array from a previous time step.
              The number of elements of the input vector must be C times N. If the input is
              frame-based, then it must be a column vector.
                                                                                                 4-241
Helical Interleaver
Dialog Box
Examples     Suppose that C = 3, N = 2, the Helical array step size parameter is 1, and the
             Initial condition parameter is -1. After receiving inputs of [1:6]', [7:12]',
             and [13:19]', the block’s internal array looks like the schematic below. The
             coloring of the inputs and the array indicate how the input symbols are placed
             within the array. The outputs at the first three time steps are
             [1; -1; -1; 2; 3; -1], [7; 4; 5; 8; 9; 6], and
             [13; 10; 11; 14; 15; 12]. (The outputs are not color-coded in the
             schematic.)
4-242
                                                                        Helical Interleaver
                                         1 -1 -1
                     Inputs                                   Outputs from successive
                                                              rows of array
                                         2     3 -1
                                         7     4    5
                13       7    1                               13        7        1
                14       8    2                               10        4       -1
                                         8     9    6
                15       9    3                               11        5       -1
                16      10    4                               14        8        2
                                       13 10 11
                17      11    5                               15        9        3
                18      12    6                               12        6       -1
                                       14 15 12
16 17
... 18
References   [1] Berlekamp, E. R. and P. Tong. “Improved Interleavers for Algebraic Block
             Codes.” U. S. Patent 4559625, Dec. 17, 1985.
                                                                                            4-243
Insert Zero
Description   The Insert Zero block constructs an output vector by inserting zeros among the
              elements of the input vector. The input can be real or complex. The block
              determines where to place the zeros by using the Insert zero vector
              parameter. The Insert zero vector parameter is a binary vector whose
              elements are arranged so that:
              • Each 1 indicates that the block should place the next element of the input in
                the output vector
              • Each 0 indicates that the block should place a 0 in the output vector
              If the input signal is sample-based, then the input vector length must equal the
              number of 1s in the Insert zero vector parameter.
              To implement punctured coding using the Puncture and Insert Zero blocks, you
              should use the same vector for the Insert zero vector parameter in this block
              and for the Puncture vector parameter in the Puncture block.
              Frame-Based Processing
              If the input signal is frame-based, then both it and the Insert zero vector
              parameter must be column vectors. The number of 1s in the Insert zero vector
              parameter must divide the input vector length. If the input vector length is
              greater than the number of 1s in the Insert zero vector parameter, then the
              block repeats the insertion pattern until it has placed all input elements in the
              output vector.
4-244
                                                                                           Insert Zero
Dialog Box
Examples     If the Insert zero vector parameter is the six-element vector [1,0,1,1,1,0],
             then the block inserts zeros after the first and last elements of each consecutive
             grouping of four input elements. It considers groups of four elements because
             the Insert zero vector parameter has four 1s.
             The diagram below depicts the block’s operation using this Insert zero vector
             parameter. Notice that the insertion pattern applies twice.
                        Group of 4   Group of 4
                     [1 3 4 5 7 9 10 11]
             Compare this example with that on the reference page for the Puncture block.
See Also     Puncture
                                                                                                   4-245
Integer-Input RS Encoder
                                                      6 3
                                                      2 2
                        2 6                           2 6
                        3 7                           3 7
                        5 4                           5 4
                        2 0 message                   2 0 code
                        0 4                           0 4
                       t=1 t=0                       t=1 t=0
4-246
                                                  Integer-Input RS Encoder
Dialog Box
             Codeword length N
                The codeword length, which is also the output vector length.
             Message length K
               The message length, which is also the input vector length.
                                                                               4-247
Integer-Output RS Decoder
Dialog Box
4-248
                                               Integer-Output RS Decoder
             Codeword length N
                The codeword length, which is also the input vector length.
             Message length K
               The message length, which is also the output vector length.
                                                                              4-249
Integer to Bit Converter
Description   The Integer to Bit Converter block maps each integer in the input vector to a
              group of bits in the output vector. If M is the Number of bits per integer
              parameter, then the input integers must be between 0 and 2M-1. The block
              maps each integer to a group of M bits, using the first bit as the most significant
              bit. As a result, the output vector length is M times the input vector length.
              The input can be either a scalar or a frame-based column vector.
Dialog Box
Examples      If the input is [7; 13] and the Number of bits per integer parameter is 4, then
              the output is [0; 1; 1; 1; 1; 1; 0; 1]. The first group of four bits (0, 1, 1, 1)
              represents 7 and the second group of four bits (1, 1, 0, 1) represents 13. Notice
              that the output length is four times the input length.
4-250
                                                             Integrate and Dump
Description   The Integrate and Dump block integrates the input signal in discrete time,
              resets to zero according to a fixed schedule, and reduces modulo the Absolute
              value bound parameter. If the Absolute value bound parameter is K, then
              the block output is strictly between -K and K.
              The reset times are the positive integral multiples of the Integration period
              parameter. At each reset time, the block performs its final integration step,
              sends the result to the output port, and then clears its internal state for the
              next time step.
              The input can be either a scalar, a sample-based vector, or a frame-based row
              vector. The block processes each vector element independently.
              This block uses the Forward Euler integration method.
Dialog Box
                                                                                                4-251
Integrate and Dump
           You can use a Simulink Constant block for the input signal. The Simulink
           Scope block shows the output below.
           Notice that the output is 0 at time 0 and that the output never exceeds 5. Also
           notice that the output at time 7.5 seconds (Integration period plus Sample
           time) is the result of resetting the integrator after the previous time step and
           then considering the input signal between times 7 and 7.5.
4-252
                                                                                  Interlacer
Purpose       4Interlacer
              Alternately select elements from two input vectors to generate output vector
Description   The Interlacer block accepts two inputs that have the same vector size,
              complexity, and sample time. It produces one output vector by alternating
              elements from the first input and from the second input. As a result, the output
              vector size is twice that of either input. The output vector has the same
              complexity and sample time of the inputs.
              The inputs can be either scalars or frame-based column vectors.
              This block can be useful for combining in-phase and quadrature information
              from separate vectors into a single vector.
Dialog Box
Examples      If the two input vectors are frame-based with values [1; 2; 3; 4] and
              [5; 6; 7; 8], then the output vector is [1; 5; 2; 6; 3; 7; 4; 8].
                                                                                                 4-253
Linearized Baseband PLL
Library Synchronization
Description   The Linearized Baseband PLL block is a feedback control system that
              automatically adjusts the phase of a locally generated signal to match the
              phase of an input signal. Unlike the Phase-Locked Loop block, this block uses
              a baseband model method. Unlike the Baseband PLL block, which uses a
              nonlinear model, this block simplifies the computations by using x to
              approximate sin(x). The baseband PLL model depends on the amplitude of the
              incoming signal but does not depend on a carrier frequency.
              This PLL has these three components:
              The input signal represents the received signal. The input must be a
              sample-based scalar signal. The three output ports produce:
4-254
                                                   Linearized Baseband PLL
Dialog Box
References   For more information about phase-locked loops, see the works listed in
             “Selected Bibliography for Synchronization” on page 2-92.
                                                                                              4-255
Matrix Deinterleaver
Dialog Box
              Number of rows
                The number of rows in the matrix that the block uses for its computations.
              Number of columns
                The number of columns in the matrix that the block uses for its
                computations.
Examples      If the Number of rows and Number of columns parameters are 2 and 3,
              respectively, then the deinterleaver uses a 2-by-3 matrix for its internal
              computations. Given an input signal of [1; 2; 3; 4; 5; 6], the block
              produces an output of [1; 3; 5; 2; 4; 6].
4-256
                                                   Matrix Helical Scan Deinterleaver
Description   The Matrix Helical Scan Deinterleaver block performs block deinterleaving by
              filling a matrix with the input symbols in a helical fashion and then sending
              the matrix contents to the output port row by row. The Number of rows and
              Number of columns parameters are the dimensions of the matrix that the
              block uses internally for its computations.
              Helical fashion means that the block places input symbols along diagonals of
              the matrix. The number of elements in each diagonal matches the Number of
              columns parameter, after the block wraps past the edges of the matrix when
              necessary. The block traverses diagonals so that the row index and column
              index both increase. Each diagonal after the first one begins one row below the
              first element of the previous diagonal.
              The Array step size parameter is the slope of each diagonal, that is, the
              amount by which the row index increases as the column index increases by one.
              This parameter must be an integer between zero and the Number of rows
              parameter. If the Array step size parameter is zero, then the block does not
              deinterleave and the output is the same as the input.
              The number of elements of the input vector must be the product of Number of
              rows and Number of columns. If the input is frame-based, then it must be a
              column vector.
                                                                                                4-257
Matrix Helical Scan Deinterleaver
Dialog Box
             Number of rows
               The number of rows in the matrix that the block uses for its computations.
             Number of columns
               The number of columns in the matrix that the block uses for its
               computations.
             Array step size
                The slope of the diagonals that the block writes.
4-258
                                                 Matrix Helical Scan Interleaver
Description   The Matrix Helical Scan Interleaver block performs block interleaving by
              filling a matrix with the input symbols row by row and then sending the matrix
              contents to the output port in a helical fashion. The Number of rows and
              Number of columns parameters are the dimensions of the matrix that the
              block uses internally for its computations.
              Helical fashion means that the block selects output symbols by selecting
              elements along diagonals of the matrix. The number of elements in each
              diagonal matches the Number of columns parameter, after the block wraps
              past the edges of the matrix when necessary. The block traverses diagonals so
              that the row index and column index both increase. Each diagonal after the
              first one begins one row below the first element of the previous diagonal.
              The Array step size parameter is the slope of each diagonal, that is, the
              amount by which the row index increases as the column index increases by one.
              This parameter must be an integer between zero and the Number of rows
              parameter. If the Array step size parameter is zero, then the block does not
              interleave and the output is the same as the input.
              The number of elements of the input vector must be the product of Number of
              rows and Number of columns. If the input is frame-based, then it must be a
              column vector.
                                                                                               4-259
Matrix Helical Scan Interleaver
Dialog Box
             Number of rows
               The number of rows in the matrix that the block uses for its computations.
             Number of columns
               The number of columns in the matrix that the block uses for its
               computations.
             Array step size
                The slope of the diagonals that the block reads.
Examples     If the Number of rows and Number of columns parameters are 6 and 4,
             respectively, then the interleaver uses a 6-by-4 matrix for its internal
             computations. If the Array step size parameter is 1, then the diagonals are as
             shown in the figure below. Positions with the same color form part of the same
             diagonal, and diagonals with darker colors precede those with lighter colors in
             the output signal.
             Given an input signal of [1:24]', the block produces an output of
               [1; 6; 11; 16; 5; 10; 15; 20; 9; 14; 19; 24; 13; 18; 23;...
               4; 17; 22; 3; 8; 21; 2; 7; 12]
4-260
                                            Matrix Helical Scan Interleaver
1 2 3 4
                                  5     6    7     8
                                                         [1,    6,   11,   16,...
                                  9 10 11 12
                                                          5,   10,   15,   20,...
                [1:24]'                                   9,   14,   19,   24,...
                                13 14 15 16
                                                         13,   18,   23,    4,...
                                                         17,   22,    3,    8,...
                                17 18 19 20
                                                         21,    2,    7,   12]'
21 22 23 24
                                                                                    4-261
Matrix Interleaver
Description   The Matrix Interleaver block performs block interleaving by filling a matrix
              with the input symbols row by row and then sending the matrix contents to the
              output port column by column.
              The Number of rows and Number of columns parameters are the dimensions
              of the matrix that the block uses internally for its computations.
              The number of elements of the input vector must be the product of Number of
              rows and Number of columns. If the input is frame-based, then it must be a
              column vector.
Dialog Box
              Number of rows
                The number of rows in the matrix that the block uses for its computations.
              Number of columns
                The number of columns in the matrix that the block uses for its
                computations.
Examples      If the Number of rows and Number of columns parameters are 2 and 3,
              respectively, then the interleaver uses a 2-by-3 matrix for its internal
              computations. Given an input signal of [1; 2; 3; 4; 5; 6], the block
              produces an output of [1; 4; 2; 5; 3; 6].
4-262
                                         Matrix Interleaver
                                                        4-263
M-DPSK Demodulator Baseband
Description   The M-DPSK Demodulator Baseband block demodulates a signal that was
              modulated using the M-ary differential phase shift keying method. The input
              is a baseband representation of the modulated signal. The input and output for
              this block are discrete-time signals. The input can be either a scalar or a
              frame-based column vector.
              The M-ary number parameter, M, is the number of possible output symbols
              that can immediately follow a given output symbol. The block compares the
              current symbol to the previous symbol. The block’s first output is the initial
              condition of zero (or a group of zeros, if the Output type parameter is set to Bit)
              because there is no previous symbol.
4-264
                                     M-DPSK Demodulator Baseband
Dialog Box
             M-ary number
                The number of possible modulated symbols that can immediately follow a
                given symbol.
             Output type
                Determines whether the output consists of integers or groups of bits.
             Constellation ordering
                Determines how the block maps each integer to a group of output bits. This
                field is active only when Output type is set to Bit.
             Phase offset (rad)
                The phase difference between the previous and current modulated symbols
                when the input is zero.
             Samples per symbol
                The number of input samples that represent each modulated symbol.
                                                                                             4-265
M-DPSK Demodulator Baseband
References   [1] Pawula, R. F. “On M-ary DPSK Transmission Over Terrestrial and Satellite
             Channels.” IEEE Transactions on Communications, vol. COM-32, July 1984.
             752-761.
4-266
                                             M-DPSK Demodulator Passband
Description   The M-DPSK Demodulator Passband block demodulates a signal that was
              modulated using the M-ary differential phase shift keying method. The input
              is a passband representation of the modulated signal. The input and output for
              this block are discrete-time signals. The input must be a sample-based scalar
              signal.
              The M-ary number parameter, M, is the number of possible output symbols
              that can immediately follow a given output symbol. The block compares the
              current symbol to the previous symbol. The block’s first output is the initial
              condition of zero because there is no previous symbol.
              This block converts the input to an equivalent baseband representation and
              then uses the baseband equivalent block, M-DPSK Demodulator Baseband, for
              internal computations. The following parameters in this block are the same as
              those of the baseband equivalent block:
              • M-ary number
              • Output type
              • Constellation ordering
                                                                                               4-267
M-DPSK Demodulator Passband
             Also, this block incurs an extra output period of delay compared to its baseband
             equivalent block.
Dialog Box
             M-ary number
                The number of possible modulated symbols that can immediately follow a
                given symbol.
             Output type
                Determines whether the output consists of integers or groups of bits.
4-268
                                      M-DPSK Demodulator Passband
             Constellation ordering
                Determines how the block maps each integer to a group of output bits. This
                field is active only when Output type is set to Bit.
             Symbol period (s)
                The symbol period, which equals the sample time of the output.
             Baseband samples per symbol
                The number of baseband samples that represent each modulated symbol,
                after the block converts the passband input to a baseband intermediary
                signal.
             Carrier frequency (Hz)
                The frequency of the carrier.
             Carrier initial phase (rad)
                The initial phase of the carrier in radians.
             Input sample time
                The sample time of the input signal.
References   [1] Pawula, R. F. “On M-ary DPSK Transmission Over Terrestrial and Satellite
             Channels.” IEEE Transactions on Communications, vol. COM-32, July 1984.
             752-761.
                                                                                             4-269
M-DPSK Modulator Baseband
Description   The M-DPSK Modulator Baseband block modulates using the M-ary
              differential phase shift keying method. The output is a baseband
              representation of the modulated signal. The M-ary number parameter, M, is
              the number of possible output symbols that can immediately follow a given
              output symbol.
              The input must be a discrete-time signal.
4-270
                                 M-DPSK Modulator Baseband
below indicates the assignment of phase difference to three-bit inputs, for both
the Binary and Gray options. θ is the Phase offset parameter.
[0 0 0] jθ jθ
 [0 0 1]             jθ + jπ/2                     jθ + jπ/2
 [0 1 0]             jθ + jπ2/2                    jθ + jπ3/2
[0 1 1] jθ + jπ3/2 jθ + jπ2/2
[1 0 0] jθ + jπ4/2 jθ + jπ6/2
[1 0 1] jθ + jπ5/2 jθ + jπ7/2
[1 1 0] jθ + jπ6/2 jθ + jπ5/2
[1 1 1] jθ + jπ7/2 jθ + jπ4/2
For more details about the Binary and Gray options, see the reference page for
the M-PSK Modulator Baseband block. The signal constellation for that block
corresponds to the arrangement of phase differences for this block.
                                                                                   4-271
M-DPSK Modulator Baseband
Dialog Box
             M-ary number
                The number of possible output symbols that can immediately follow a given
                output symbol.
             Input type
                Indicates whether the input consists of integers or groups of bits. If this
                parameter is set to Bit, then the M-ary number parameter must be 2K for
                some positive integer K.
             Constellation ordering
                Determines how the block maps each group of input bits to a corresponding
                integer. This field is active only when Input type is set to Bit.
             Phase offset (rad)
                The phase difference between the previous and current modulated symbols
                when the input is zero.
4-272
                                         M-DPSK Modulator Baseband
References   [1] Pawula, R. F. “On M-ary DPSK Transmission Over Terrestrial and Satellite
             Channels.” IEEE Transactions on Communications, vol. COM-32, July 1984.
             752-761.
                                                                                            4-273
M-DPSK Modulator Passband
Description   The M-DPSK Modulator Passband block modulates using the M-ary
              differential phase shift keying method. The output is a passband
              representation of the modulated signal. The M-ary number parameter, M, is
              the number of possible output symbols that can immediately follow a given
              output symbol.
              This block uses the baseband equivalent block, M-DPSK Modulator Baseband,
              for internal computations and converts the resulting baseband signal to a
              passband representation. The following parameters in this block are the same
              as those of the baseband equivalent block:
              • M-ary number
              • Input type
              • Constellation ordering
              The input must be sample-based. If the Input type parameter is Bit, then the
              input must be a vector of length log2(M). If the Input type parameter is
              Integer, then the input must be a scalar.
4-274
                                          M-DPSK Modulator Passband
Dialog Box
             M-ary number
                The number of possible output symbols that can immediately follow a given
                output symbol.
             Input type
                Indicates whether the input consists of integers or groups of bits. If this
                parameter is set to Bit, then the M-ary number parameter must be 2K for
                some positive integer K.
                                                                                              4-275
M-DPSK Modulator Passband
             Constellation ordering
                Determines how the block maps each group of input bits to a corresponding
                integer. This field is active only when Input type is set to Bit.
             Symbol period (s)
                The symbol period, which must equal the sample time of the input.
             Baseband samples per symbol
                The number of baseband samples that correspond to each integer or binary
                word in the input, before the block converts them to a passband output.
             Carrier frequency (Hz)
                The frequency of the carrier.
             Carrier initial phase (rad)
                The initial phase of the carrier in radians.
             Output sample time
                The sample time of the output signal.
References   [1] Pawula, R. F. “On M-ary DPSK Transmission Over Terrestrial and Satellite
             Channels.” IEEE Transactions on Communications, vol. COM-32, July 1984.
             752-761.
4-276
                                            M-FSK Demodulator Baseband
Description   The M-FSK Demodulator Baseband block demodulates a signal that was
              modulated using the M-ary frequency shift keying method. The input is a
              baseband representation of the modulated signal. The input and output for this
              block are discrete-time signals. The input can be either a scalar or a
              frame-based column vector.
              The M-ary number parameter, M, is the number of frequencies in the
              modulated signal. The Frequency separation parameter is the distance, in
              Hz, between successive frequencies of the modulated signal.
                                                                                                4-277
M-FSK Demodulator Baseband
Dialog Box
             M-ary number
                The number of frequencies in the modulated signal.
             Output type
                Determines whether the output consists of integers or groups of bits. If this
                parameter is set to Bit, then the M-ary number parameter must be 2K for
                some positive integer K.
             Symbol set ordering
                Determines how the block maps each integer to a group of output bits. This
                field is active only when Output type is set to Bit.
             Frequency separation (Hz)
                The distance between successive frequencies in the modulated signal.
             Samples per symbol
                The number of input samples that represent each modulated symbol.
4-278
                                    M-FSK Demodulator Baseband
                                                           4-279
M-FSK Demodulator Passband
Description   The M-FSK Demodulator Passband block demodulates a signal that was
              modulated using the M-ary frequency shift keying method. The input is a
              passband representation of the modulated signal. The M-ary number
              parameter, M, is the number of frequencies in the modulated signal.
              This block converts the input to an equivalent baseband representation and
              then uses the baseband equivalent block, M-FSK Demodulator Baseband, for
              internal computations. The following parameters in this block are the same as
              those of the baseband equivalent block:
              • M-ary number
              • Output type
              • Signal set ordering
              • Frequency separation
              The input must be a sample-based scalar signal.
4-280
                                         M-FSK Demodulator Passband
             Also, this block incurs an extra output period of delay compared to its baseband
             equivalent block.
Dialog Box
             M-ary number
                The number of frequencies in the modulated signal.
             Output type
                Determines whether the output consists of integers or groups of bits. If this
                parameter is set to Bit, then the M-ary number parameter must be 2K for
                some positive integer K.
             Symbol set ordering
                Determines how the block maps each integer to a group of output bits. This
                field is active only when Output type is set to Bit.
                                                                                                4-281
M-FSK Demodulator Passband
4-282
                                                M-FSK Modulator Baseband
Description   The M-FSK Modulator Baseband block modulates using the M-ary frequency
              shift keying method. The output is a baseband representation of the modulated
              signal.
              The M-ary number parameter, M, is the number of frequencies in the
              modulated signal. The Frequency separation parameter is the distance, in
              Hz, between successive frequencies of the modulated signal. If the Phase
              continuity parameter is set to Continuous, then the modulated signal
              maintains its phase even when it changes its frequency. If the Phase
              continuity parameter is set to Discontinuous, then the modulated signal
              comprises portions of M sinusoids of different frequencies; thus, a change in the
              input value might cause a change in the phase of the modulated signal.
              • If Input type is set to Integer, then the block accepts integers. The input can
                be either a scalar or a frame-based column vector.
              • If Input type is set to Bit, then the block accepts groups of K bits, called
                binary words. The input can be either a vector of length K or a frame-based
                column vector whose length is an integer multiple of K. The Symbol set
                ordering parameter indicates how the block assigns binary words to
                corresponding integers.
                  - If Symbol set ordering is set to Binary, then the block uses a natural
                    binary-coded ordering.
                  - If Symbol set ordering is set to Gray, then the block uses a Gray-coded
                    ordering. For details about the Gray coding, see the reference page for the
                    M-PSK Modulator Baseband block.
              Whether the input is an integer or a binary representation of an integer, the
              block maps the integer 0 to the highest frequency and maps the integer M-1 to
              the lowest frequency. In baseband simulation, the lowest frequency is the
              negative frequency with the largest absolute value.
                                                                                                  4-283
M-FSK Modulator Baseband
Dialog Box
             M-ary number
                The number of frequencies in the modulated signal.
             Input type
                Indicates whether the input consists of integers or groups of bits. If this
                parameter is set to Bit, then the M-ary number parameter must be 2K for
                some positive integer K.
4-284
                                            M-FSK Modulator Baseband
                                                                                            4-285
M-FSK Modulator Passband
Description   The M-FSK Modulator Passband block modulates using the M-ary frequency
              shift keying method. The output is a passband representation of the modulated
              signal. The M-ary number parameter, M, is the number of frequencies in the
              modulated signal.
              This block uses the baseband equivalent block, M-FSK Modulator Baseband,
              for internal computations and converts the resulting baseband signal to a
              passband representation. The following parameters in this block are the same
              as those of the baseband equivalent block:
              • M-ary number
              • Input type
              • Symbol set ordering
              • Frequency separation
              • Phase continuity
              The input must be sample-based. If the Input type parameter is Bit, then the
              input must be a vector of length log2(M). If the Input type parameter is
              Integer, then the input must be a scalar.
4-286
                                             M-FSK Modulator Passband
Dialog Box
             M-ary number
                The number of frequencies in the modulated signal.
                                                                                        4-287
M-FSK Modulator Passband
             Input type
                Indicates whether the input consists of integers or groups of bits. If this
                parameter is set to Bit, then the M-ary number parameter must be 2K for
                some positive integer K.
             Symbol set ordering
                Determines how the block maps each group of input bits to a corresponding
                integer. This field is active only when Input type is set to Bit.
             Frequency separation (Hz)
                The distance between successive frequencies in the modulated signal.
             Phase continuity
                Determines whether the modulated signal changes phases in a continuous
                or discontinuous way.
             Symbol period (s)
                The symbol period, which must equal the sample time of the input.
             Baseband samples per symbol
                The number of baseband samples that correspond to each integer or binary
                word in the input, before the block converts them to a passband output.
             Carrier frequency (Hz)
                The frequency of the carrier.
             Carrier initial phase (rad)
                The initial phase of the carrier in radians.
             Output sample time
                The sample time of the output signal.
4-288
                                                                Modulo Integrator
Description   The Modulo Integrator block integrates its input signal in continuous time and
              then reduces modulo the Absolute value bound parameter. If the Absolute
              value bound parameter is K, then the block output is strictly between -K and
              K.
              The input must be sample-based. The block processes each vector element
              independently.
              This block’s functionality is useful for monotonically increasing or decreasing
              functions, but works with any integrable function. This block uses the Forward
              Euler integration method.
Dialog Box
                                                                                                4-289
M-PAM Demodulator Baseband
Description   The M-PAM Demodulator Baseband block demodulates a signal that was
              modulated using the M-ary pulse amplitude modulation. The input is a
              baseband representation of the modulated signal.
              The signal constellation has M points, where M is the M-ary number
              parameter. M must be an even integer. The block scales the signal constellation
              based on how you set the Normalization method parameter. For details on the
              constellation and its scaling, see the reference page for the M-PAM Modulator
              Baseband block.
              The input can be either a scalar or a frame-based column vector.
4-290
                                       M-PAM Demodulator Baseband
Dialog Box
             M-ary number
                The number of points in the signal constellation. It must be an even
                integer.
             Output type
                Determines whether the output consists of integers or groups of bits. If this
                parameter is set to Bit, then the M-ary number parameter must be 2K for
                some positive integer K.
             Constellation ordering
                Determines how the block maps each integer to a group of output bits. This
                field is active only when Output type is set to Bit.
             Normalization method
                Determines how the block scales the signal constellation. Choices are Min.
                distance between symbols, Average Power, and Peak Power.
                                                                                                4-291
M-PAM Demodulator Baseband
             Minimum distance
                The distance between two nearest constellation points. This field appears
                only when Normalization method is set to Min. distance between
                symbols.
4-292
                                            M-PAM Demodulator Passband
Description   The M-PAM Demodulator Passband block demodulates a signal that was
              modulated using M-ary pulse amplitude modulation. The input is a passband
              representation of the modulated signal. The input must be a sample-based
              scalar signal.
              This block converts the input to an equivalent baseband representation and
              then uses the baseband equivalent block, M-PAM Demodulator Baseband, for
              internal computations. The following parameters in this block are the same as
              those of the baseband equivalent block:
              • M-ary number
              • Output type
              • Constellation ordering
              • Normalization method
              • Minimum distance
              • Average power
              • Peak power
                                                                                               4-293
M-PAM Demodulator Passband
             Also, this block incurs an extra output period of delay compared to its baseband
             equivalent block.
Dialog Box
             M-ary number
                The number of points in the signal constellation. It must be an even
                integer.
4-294
                           M-PAM Demodulator Passband
Output type
   Determines whether the output consists of integers or groups of bits. If this
   parameter is set to Bit, then the M-ary number parameter must be 2K for
   some positive integer K.
Constellation ordering
   Determines how the block maps each integer to a group of output bits. This
   field is active only when Output type is set to Bit.
Normalization method
   Determines how the block scales the signal constellation. Choices are Min.
   distance between symbols, Average Power, and Peak Power.
Minimum distance
   The distance between two nearest constellation points. This field appears
   only when Normalization method is set to Min. distance between
   symbols.
                                                                                   4-295
M-PAM Demodulator Passband
4-296
                                            M-PAM Modulator Baseband
Description   The M-PAM Modulator Baseband block modulates using M-ary pulse
              amplitude modulation. The output is a baseband representation of the
              modulated signal. The M-ary number parameter, M, is the number of points
              in the signal constellation. It must be an even integer.
              Note This is actually a real number. The block’s output signal is a complex
              data-type signal whose imaginary part is zero.
              The block scales the default signal constellation based on how you set the
              Normalization method parameter. The table below lists the possible scaling
              conditions.
                                                                                             4-297
M-PAM Modulator Baseband
         • If Input type is set to Integer, then the block accepts integers. The input can
           be either a scalar or a frame-based column vector.
         • If Input type is set to Bit, then the block accepts groups of K bits, called
           binary words. The input can be either a vector of length K or a frame-based
           column vector whose length is an integer multiple of K. The Constellation
           ordering parameter indicates how the block assigns binary words to points
           of the signal constellation.
           - If Constellation ordering is set to Binary, then the block uses a natural
             binary-coded constellation.
           - If Constellation ordering is set to Gray, then the block uses a Gray-coded
             constellation.
         For details about the Gray coding, see the reference page for the M-PSK
         Modulator Baseband block.
4-298
                                           M-PAM Modulator Baseband
Dialog Box
             M-ary number
                The number of points in the signal constellation. It must be an even
                integer.
             Input type
                Indicates whether the input consists of integers or groups of bits. If this
                parameter is set to Bit, then the M-ary number parameter must be 2K for
                some positive integer K.
             Constellation ordering
                Determines how the block maps each group of input bits to a corresponding
                integer. This field is active only when Input type is set to Bit.
                                                                                              4-299
M-PAM Modulator Baseband
             Normalization method
                Determines how the block scales the signal constellation. Choices are Min.
                distance between symbols, Average Power, and Peak Power.
             Minimum distance
                The distance between two nearest constellation points. This field appears
                only when Normalization method is set to Min. distance between
                symbols.
4-300
                                            M-PAM Modulator Passband
Description   The M-PAM Modulator Passband block modulates using M-ary pulse
              amplitude modulation. The output is a passband representation of the
              modulated signal. The M-ary number parameter, M, is the number of points
              in the signal constellation. It must be an even integer.
              This block uses the baseband equivalent block, M-PAM Modulator Baseband,
              for internal computations and converts the resulting baseband signal to a
              passband representation. The following parameters in this block are the same
              as those of the baseband equivalent block:
              • M-ary number
              • Input type
              • Constellation ordering
              • Normalization method
              • Minimum distance
              • Average power
              • Peak power
              The input must be sample-based. If the Input type parameter is Bit, then the
              input must be a vector of length log2(M). If the Input type parameter is
              Integer, then the input must be a scalar.
                                                                                             4-301
M-PAM Modulator Passband
Dialog Box
4-302
                               M-PAM Modulator Passband
M-ary number
   The number of points in the signal constellation. It must be an even
   integer.
Input type
   Indicates whether the input consists of integers or groups of bits. If this
   parameter is set to Bit, then the M-ary number parameter must be 2K for
   some positive integer K.
Constellation ordering
   Determines how the block maps each group of input bits to a corresponding
   integer. This field is active only when Input type is set to Bit.
Normalization method
   Determines how the block scales the signal constellation. Choices are Min.
   distance between symbols, Average Power, and Peak Power.
Minimum distance
   The distance between two nearest constellation points. This field appears
   only when Normalization method is set to Min. distance between
   symbols.
                                                                                 4-303
M-PAM Modulator Passband
4-304
                                            M-PSK Demodulator Baseband
Description   The M-PSK Demodulator Baseband block demodulates a signal that was
              modulated using the M-ary phase shift keying method. The input is a baseband
              representation of the modulated signal. The input and output for this block are
              discrete-time signals. The input can be either a scalar or a frame-based column
              vector. The M-ary number parameter, M, is the number of points in the signal
              constellation.
                                                                                                4-305
M-PSK Demodulator Baseband
Dialog Box
             M-ary number
                The number of points in the signal constellation.
             Output type
                Determines whether the output consists of integers or groups of bits. If this
                parameter is set to Bit, then the M-ary number parameter must be 2K for
                some positive integer K.
             Constellation ordering
                Determines how the block maps each integer to a group of output bits. This
                field is active only when Output type is set to Bit.
             Phase offset (rad)
                The phase of the zeroth point of the signal constellation.
             Samples per symbol
                The number of input samples that represent each modulated symbol.
4-306
                                   M-PSK Demodulator Baseband
                                                                            4-307
M-PSK Demodulator Passband
Description   The M-PSK Demodulator Passband block demodulates a signal that was
              modulated using the M-ary phase shift keying method. The input is a passband
              representation of the modulated signal. The M-ary number parameter, M, is
              the number of points in the signal constellation.
              This block converts the input to an equivalent baseband representation and
              then uses the baseband equivalent block, M-PSK Demodulator Baseband, for
              internal computations. The following parameters in this block are the same as
              those of the baseband equivalent block:
              • M-ary number
              • Output type
              • Constellation ordering
              The input must be a sample-based scalar signal.
4-308
                                         M-PSK Demodulator Passband
             Also, this block incurs an extra output period of delay compared to its baseband
             equivalent block.
Dialog Box
             M-ary number
                The number of points in the signal constellation.
             Output type
                Determines whether the output consists of integers or groups of bits. If this
                parameter is set to Bit, then the M-ary number parameter must be 2K for
                some positive integer K.
             Constellation ordering
                Determines how the block maps each integer to a group of output bits. This
                field is active only when Output type is set to Bit.
                                                                                                4-309
M-PSK Demodulator Passband
4-310
                                               M-PSK Modulator Baseband
Description   The M-PSK Modulator Baseband block modulates using the M-ary phase shift
              keying method. The output is a baseband representation of the modulated
              signal. The M-ary number parameter, M, is the number of points in the signal
              constellation.
              Baseband M-ary phase shift keying modulation with a phase offset of θ maps
              an integer m between 0 and M-1 to the complex value
                    exp(jθ + j2πm/M)
              The input and output for this block are discrete-time signals. To use integers
              between 0 and M-1 as input values, set the Input type parameter to Integer.
              In this case, the input can be either a scalar or a frame-based column vector.
              Alternative configurations of the block determine how the block interprets its
              input and arranges its output, as explained in the sections below.
              Binary Inputs
              If the Input type parameter is set to Bit and the M-ary number parameter has
              the form 2K for some positive integer K, then the block accepts binary
              representations of integers between 0 and M-1. It modulates each group of K
              bits, called a binary word. The input can be either a vector of length K or a
              frame-based column vector whose length is an integer multiple of K.
              In binary input mode, the Constellation ordering parameter indicates how
              the block maps a group of K input bits to a corresponding integer. Choices are
              Binary and Gray. For more information, see “Binary-Valued and
              Integer-Valued Signals” on page 2-68.
              If Constellation ordering is set to Gray, then the block uses a Gray-coded
              signal constellation; as a result, binary representations that differ in more than
              one bit cannot map to consecutive integers modulo M. The explicit mapping is
              described in “Algorithm” below.
                                                                                                   4-311
M-PSK Modulator Baseband
          Frame-Based Inputs
          If the input is a frame-based column vector, then the block processes several
          integers or several binary words, in each time step. (If the Input type
          parameter is set to Bit, then a binary word consists of log2(M) bits.)
          For example, the schematics below illustrate how the block processes two 8-ary
          integers or binary words in one time step. The signals involved are all
          frame-based column vectors. In both cases, the Phase offset parameter is 0.
           1
           1
                                        Input type parameter is Bit and
           0                  -j
                                        Constellation ordering
           0                   j        parameter is Binary.
           1
           0
4-312
                                             M-PSK Modulator Baseband
Dialog Box
             M-ary number
                The number of points in the signal constellation.
             Input type
                Indicates whether the input consists of integers or groups of bits. If this
                parameter is set to Bit, then the M-ary number parameter must be 2K for
                some positive integer K.
             Constellation ordering
                Determines how the block maps each group of input bits to a corresponding
                integer. This field is active only when Input type is set to Bit.
             Phase offset (rad)
                The phase of the zeroth point of the signal constellation.
                                                                                              4-313
M-PSK Modulator Baseband
Algorithm   If the Constellation ordering parameter is set to Gray, then the block
            internally assigns the binary inputs to points of a predefined Gray-coded signal
            constellation. The block’s predefined M-ary Gray-coded signal constellation
            assigns the binary representation
               de2bi(bitxor(m,floor(m/2)), log2(M),'left-msb')
            to the mth phase. The zeroth phase in the constellation is the Phase offset
            parameter, and successive phases are counted in a counterclockwise direction.
            In other words, if the block input is the natural binary representation, u, of the
            integer U, then the block output has phase
               jθ + j2πm/M
            where θ is the Phase offset parameter and m is an integer between 0 and M-1
            that satisfies
               m XOR m ⁄ 2       = U
            For example, if M = 8, then the binary representations that correspond to the
            zeroth through seventh phases are below.
               M = 8; m = [0:M-1]';
               de2bi(bitxor(m,floor(m/2)), log2(M),'left-msb')
ans =
                     0       0      0
                     0       0      1
                     0       1      1
                     0       1      0
4-314
                                               M-PSK Modulator Baseband
                     1       1      0
                     1       1      1
                     1       0      1
                     1       0      0
             Below is the 8-ary Gray-coded constellation that the block uses if the Phase
             offset parameter is π/8.
011 001
010 000
110 100
111 101
See Also     BPSK Modulator Baseband, QPSK Modulator Baseband, M-DPSK Modulator
             Baseband
                                                                                            4-315
M-PSK Modulator Passband
Description   The M-PSK Modulator Passband block modulates using the M-ary phase shift
              keying method. The output is a passband representation of the modulated
              signal. The M-ary number parameter, M, is the number of points in the signal
              constellation.
              This block uses the baseband equivalent block, M-PSK Modulator Baseband,
              for internal computations and converts the resulting baseband signal to a
              passband representation. The following parameters in this block are the same
              as those of the baseband equivalent block:
              • M-ary number
              • Input type
              • Constellation ordering
              The input must be sample-based. If the Input type parameter is Bit, then the
              input must be a vector of length log2(M). If the Input type parameter is
              Integer, then the input must be a scalar.
4-316
                                             M-PSK Modulator Passband
Dialog Box
             M-ary number
                The number of points in the signal constellation.
             Input type
                Indicates whether the input consists of integers or groups of bits. If this
                parameter is set to Bit, then the M-ary number parameter must be 2K for
                some positive integer K.
                                                                                              4-317
M-PSK Modulator Passband
             Constellation ordering
                Determines how the block maps each group of input bits to a corresponding
                integer. This field is active only when Input type is set to Bit.
             Symbol period (s)
                The symbol period, which must equal the sample time of the input.
             Baseband samples per symbol
                The number of baseband samples that correspond to each integer or binary
                word in the input, before the block converts them to a passband output.
             Carrier frequency (Hz)
                The frequency of the carrier.
             Carrier initial phase (rad)
                The initial phase of the carrier in radians.
             Output sample time
                The sample time of the output signal.
4-318
                                              MSK Demodulator Baseband
Description   The MSK Demodulator Baseband block demodulates a signal that was
              modulated using the minimum shift keying method. The input is a baseband
              representation of the modulated signal. The Phase offset parameter is the
              initial phase of the modulated waveform.
              • If the input signal is sample-based, then the delay consists of D+1 zero
                symbols.
              • If the input signal is frame-based, then the delay consists of D zero symbols.
                                                                                                  4-319
MSK Demodulator Baseband
Dialog Box
             Output type
                Determines whether the output consists of bipolar or binary values.
             Phase offset (rad)
                The initial phase of the modulated waveform.
             Samples per symbol
                The number of input samples that represent each modulated symbol.
             Traceback length
                The number of trellis branches that the Viterbi Decoder block uses to
                construct each traceback path.
References   [1] Anderson, John B., Tor Aulin, and Carl-Erik Sundberg. Digital Phase
             Modulation. New York: Plenum Press, 1986.
4-320
                                              MSK Demodulator Passband
Description   The MSK Demodulator Passband block demodulates a signal that was
              modulated using the minimum shift keying method. The input is a passband
              representation of the modulated signal.
              This block converts the input to an equivalent baseband representation and
              then uses the baseband equivalent block, MSK Demodulator Baseband, for
              internal computations. The following parameters in this block are the same as
              those of the baseband equivalent block:
              • Output type
              • Traceback length
              The input must be a sample-based scalar signal.
              Also, this block incurs an extra output period of delay compared to its baseband
              equivalent block.
                                                                                                 4-321
MSK Demodulator Passband
Dialog Box
             Output type
                Determines whether the output consists of bipolar or binary values.
             Symbol period (s)
                The symbol period, which equals the sample time of the output.
             Baseband samples per symbol
                The number of baseband samples that represent each modulated symbol,
                after the block converts the passband input to a baseband intermediary
                signal.
             Carrier frequency (Hz)
                The frequency of the carrier.
             Carrier initial phase (rad)
                The initial phase of the carrier in radians.
4-322
                                           MSK Demodulator Passband
References   [1] Anderson, John B., Tor Aulin, and Carl-Erik Sundberg. Digital Phase
             Modulation. New York: Plenum Press, 1986.
                                                                                        4-323
MSK Modulator Baseband
Description   The MSK Modulator Baseband block modulates using the minimum shift
              keying method. The output is a baseband representation of the modulated
              signal.
              The Modulation index parameter times π radians is the phase shift due to the
              latest symbol when that symbol is the integer 1. The Phase offset parameter
              is the initial phase of the output waveform, measured in radians.
              Input Attributes
              The input can be either a scalar or a frame-based column vector. If the Input
              type parameter is set to Integer, then the block accepts values of 1 and -1. If
              the Input type parameter is set to Bit, then the block accepts values of 0 and 1.
Dialog Box
4-324
                                                MSK Modulator Baseband
             Input type
                Indicates whether the input consists of bipolar or binary values.
             Phase offset (rad)
                The initial phase of the output waveform.
             Samples per symbol
                The number of output samples that the block produces for each integer or
                bit in the input.
References   [1] Anderson, John B., Tor Aulin, and Carl-Erik Sundberg. Digital Phase
             Modulation. New York: Plenum Press, 1986.
                                                                                           4-325
MSK Modulator Passband
Description   The MSK Modulator Passband block modulates using the minimum shift
              keying method. The output is a passband representation of the modulated
              signal.
              The input must be sample-based. If the Input type parameter is Bit, then the
              input must be a vector of length log2(M), containing values of 0 and 1. If the
              Input type parameter is Integer, then the input must be a scalar containing
              values of 1 and -1.
4-326
                                                 MSK Modulator Passband
Dialog Box
             Input type
                Indicates whether the input consists of bipolar or binary values.
             Symbol period (s)
                The symbol period, which must equal the sample time of the input.
             Baseband samples per symbol
                The number of baseband samples that correspond to each integer or binary
                word in the input, before the block converts them to a passband output.
             Carrier frequency (Hz)
                The frequency of the carrier.
             Carrier initial phase (rad)
                The initial phase of the carrier in radians.
             Output sample time
                The sample time of the output signal.
                                                                                           4-327
MSK Modulator Passband
References   [1] Anderson, John B., Tor Aulin, and Carl-Erik Sundberg. Digital Phase
             Modulation. New York: Plenum Press, 1986.
4-328
                                                                                  Mu-Law Compressor
Description   The Mu-Law Compressor block implements a µ-law compressor for the input
              signal. The formula for the µ-law compressor is
                        V log ( 1 + µ x ⁄ V )
                    y = --------------------------------------------- sgn ( x )
                                  log ( 1 + µ )
              where µ is the µ-law parameter of the compressor, V is the peak magnitude of
              x, log is the natural logarithm, and sgn is the signum function (sign in
              MATLAB).
              The input can have any shape or frame status. This block processes each vector
              element independently.
Dialog Box
              mu value
                 The µ-law parameter of the compressor.
              Peak signal magnitude
                 The peak value of the input signal. This is also the peak value of the output.
Pair Block    Mu-Law Expander
                                                                                                  4-329
Mu-Law Expander
Description   The Mu-Law Expander block recovers data that the Mu-Law Compressor block
              compressed. The formula for the µ-law expander, shown below, is the inverse
              of the compressor function.
                        V y log ( 1 + µ ) ⁄ V
                    x = ---- ( e              – 1 ) sgn ( y )
                        µ
              The input can have any shape or frame status. This block processes each vector
              element independently.
Dialog Box
              mu value
                 The µ-law parameter of the compressor.
              Peak signal magnitude
                 The peak value of the input signal. This is also the peak value of the output.
4-330
                                                   Multipath Rayleigh Fading Channel
Library Channels
                                                                                                   4-331
Multipath Rayleigh Fading Channel
Dialog Box
4-332
                                  Multipath Rayleigh Fading Channel
Algorithm    This implementation is based on the direct form simulator described in [1].
             Some wireless applications, such as standard GSM (Global System for Mobile
             Communication) systems, prefer to specify Doppler shifts in terms of the speed
             of the mobile. If the mobile moves at speed v making an angle of θ with the
             direction of wave motion, then the Doppler shift is
               fd = (vf/c)cos θ
             where f is the transmission carrier frequency and c is the speed of light. The
             Doppler frequency is the maximum Doppler shift arising from motion of the
             mobile.
References   [1] Fechtel, Stefan A. “A Novel Approach to Modeling and Efficient Simulation
             of Frequency-Selective Fading Radio Channels.” IEEE Journal on Selected
             Areas in Communications, vol. 11, April 1993. 422-431.
             [2] Jakes, William C., ed. Microwave Mobile Communications. New York: IEEE
             Press, 1974.
             [3] Lee, William C. Y. Mobile Communications Design Fundamentals, 2nd ed.
             New York: Wiley, 1993.
                                                                                              4-333
OQPSK Demodulator Baseband
Description   The OQPSK Demodulator Baseband block demodulates a signal that was
              modulated using the offset quadrature phase shift keying method. The input is
              a baseband representation of the modulated signal.
              The input must be a discrete-time complex signal. The input can be either a
              scalar or a frame-based column vector.
              If the Output type parameter is set to Integer, then the block outputs integers
              between 0 and 3. If the Output type parameter is set to Bit, then the block
              outputs binary representations of such integers, in a binary-valued vector
              whose length is an even number.
              The input symbol period is half the period of each output integer or bit pair.
              The constellation used to map bit pairs to symbols is on the reference page for
              the OQPSK Modulator Baseband block.
              Frame-Based Inputs
              If the input is a frame-based column vector, then the block processes several
              integers or several pairs of bits, in each time step. In this case, the output
              sample time equals the input sample time, even though the symbol period is
              half the output period.
              • If the input is a frame-based column vector, then the output vector contains
                1/2S integers or pairs of bits for each sample in the input vector, while the
                output sample time equals the input sample time.
              • If the input is a sample-based scalar, then the output vector contains a single
                integer or pair of bits, while the output sample time is 2S times the input
                sample time.
4-334
                                      OQPSK Demodulator Baseband
Dialog Box
             Output type
                Determines whether the output consists of integers or pairs of bits.
             Phase offset (rad)
                The amount by which the phase of the zeroth point of the signal
                constellation is shifted from π/4.
             Samples per symbol
                The number of input samples that represent each modulated symbol.
                                                                                       4-335
OQPSK Demodulator Passband
Description   The OQPSK Demodulator Passband block demodulates a signal that was
              modulated using the offset quadrature phase shift keying method. The input is
              a passband representation of the modulated signal.
              If the Output type parameter is set to Integer, then the block outputs integers
              between 0 and 3. If the Output type parameter is set to Bit, then the block
              outputs binary representations of such integers, in binary-valued vectors of
              length two. The constellation used to map bit pairs to symbols is on the
              reference page for the OQPSK Modulator Passband block.
              The input must be a sample-based scalar signal.
              Also, this block incurs an extra output period of delay compared to its baseband
              equivalent block.
4-336
                                       OQPSK Demodulator Passband
Dialog Box
             Output type
                Indicates whether the output consists of integers or groups of bits.
             Symbol period (s)
                The symbol period, which equals the sample time of the output.
             Baseband samples per symbol
                The number of baseband samples that represent each modulated symbol,
                after the block converts the passband input to a baseband intermediary
                signal.
             Carrier frequency (Hz)
                The frequency of the carrier.
             Carrier initial phase (rad)
                The initial phase of the carrier in radians.
             Input sample time
                The sample time of the input signal.
                                                                                         4-337
OQPSK Demodulator Passband
4-338
                                               OQPSK Modulator Baseband
Description   The OQPSK Modulator Baseband block modulates using the offset quadrature
              phase shift keying method. The output is a baseband representation of the
              modulated signal.
              If the Input type parameter is set to Integer, then valid input values are 0, 1,
              2, and 3. In this case, the input can be either a scalar or a frame-based column
              vector.
              If the Input type parameter is set to Bit, then the input must be a
              binary-valued vector. In this case, the input can be either a vector of length two
              or a frame-based column vector whose length is an even integer.
              The symbol period is half the input period. The first output symbol is an initial
              condition of zero that is unrelated to the input values.
              The constellation used to map bit pairs to symbols is in the figure below. If the
              block’s Phase offset parameter is nonzero, then this constellation is rotated by
              that parameter value.
10 00
11 01
              Frame-Based Inputs
              If the input is a frame-based column vector, then the block processes several
              integers or several pairs of bits in each time step. In this case, the output
                                                                                                   4-339
OQPSK Modulator Baseband
             sample time equals the input sample time, even though the period of each
             output symbol is half the period of each integer or bit pair in the input.
             • If the input is a frame-based column vector, then the output vector length is
               2S times the number of integers or pairs of bits in the input vector, while the
               output sample time equals the input sample time. The one-symbol initial
               condition inherent in this block corresponds to the first S elements of the first
               output vector.
             • If the input is a sample-based scalar, then the output vector is a scalar, while
               the output sample time is 1/2S times the input sample time. The one-symbol
               initial condition inherent in this block corresponds to the first S samples.
Dialog Box
             Input type
                Indicates whether the input consists of integers or pairs of bits.
4-340
                                          OQPSK Modulator Baseband
                                                                                           4-341
OQPSK Modulator Passband
Description   The OQPSK Modulator Passband block modulates using the offset quadrature
              phase shift keying method. The output is a passband representation of the
              modulated signal.
              If the Input type parameter is set to Integer, then valid input values are 0, 1,
              2, and 3. In this case, the input must be a sample-based scalar. If the Input
              type parameter is set to Bit, then the input must be a binary-valued
              sample-based vector of length two.
              The constellation used to map bit pairs to symbols is in the figure below.
10 00
11 01
4-342
                                           OQPSK Modulator Passband
Dialog Box
             Input type
                Indicates whether the input consists of integers or pairs of bits. If this
                parameter is set to Bit, then the M-ary number parameter must be 2K for
                some positive integer K.
             Symbol period (s)
                The symbol period, which must equal the sample time of the input.
                                                                                             4-343
OQPSK Modulator Passband
4-344
                                                                Phase-Locked Loop
Library Synchronization
Description   The Phase-Locked Loop (PLL) block is a feedback control system that
              automatically adjusts the phase of a locally generated signal to match the
              phase of an input signal. This block is most appropriate when the input is a
              narrowband signal.
              This PLL has these three components:
              The input signal represents the received signal. The input must be a
              sample-based scalar signal. The three output ports produce:
                                                                                                 4-345
Phase-Locked Loop
Dialog Box
4-346
                                                            Phase-Locked Loop
See Also Baseband PLL, Linearized Baseband PLL, Charge Pump PLL
References   For more information about phase-locked loops, see the works listed in
             “Selected Bibliography for Synchronization” on page 2-92.
                                                                                      4-347
PM Demodulator Baseband
Dialog Box
4-348
                                                PM Demodulator Baseband
                                                                                                  4-349
PM Demodulator Passband
Dialog Box
4-350
                                                PM Demodulator Passband
                                                                                                  4-351
PM Modulator Baseband
Description   The PM Modulator Baseband block modulates using phase modulation. The
              output is a baseband representation of the modulated signal. The input signal
              is real, while the output signal is complex. The input must be a sample-based
              scalar signal.
              If the input is u(t) as a function of time t, then the output is
exp ( jθ + jKc u ( t ) )
Dialog Box
4-352
                                                        PM Modulator Passband
Description   The PM Modulator Passband block modulates using phase modulation. The
              output is a passband representation of the modulated signal. The output
              signal’s frequency varies with the input signal’s amplitude. Both the input and
              output signals are real sample-based scalar signals.
              If the input is u(t) as a function of time t, then the output is
cos ( 2πf c t + K c u ( t ) + θ )
Dialog Box
                                                                                                4-353
PM Modulator Passband
4-354
                                                       PN Sequence Generator
                                                                             PN sequence
                                       1   2              M-1         M
+ + +
              All M registers in the generator update their values at each time step. The
              state of each switch is defined by the generator polynomial, which is a
              polynomial in z-1 having binary coefficients. The constant term of the generator
              polynomial must be 1. You can specify the Generator polynomial parameter
              using either of these formats:
              • A vector of coefficients of the polynomial, starting with the constant term and
                proceeding in order of increasing powers of z-1. The first and last elements
                must be 1.
              • A vector containing the exponents of z (not z-1) for the nonzero terms of the
                polynomial. The first element must be zero.
                                                                                                  4-355
PN Sequence Generator
             coefficients in order, then the order of the generator polynomial is one less than
             the vector length.
Dialog Box
             Generator polynomial
                A polynomial that determines the shift register’s feedback connections.
             Initial states
                 A vector of initial states of the shift registers.
             Sample time
                The period of each element of the output signal.
             Frame-based outputs
                Determines whether the output is frame-based or sample-based.
4-356
                                                  PN Sequence Generator
                                                                                           4-357
Poisson Int Generator
Description   The Poisson Int Generator block generates random integers using a Poisson
              distribution. The probability of generating a nonnegative integer k is
              λkexp(-λ) / (k!), where λ is a positive number known as the Poisson parameter.
              You can use the Poisson Int Generator to generate noise in a binary
              transmission channel. In this case, the Poisson parameter Lambda should be
              less than 1, usually much less.
Dialog Box
4-358
                                                       Poisson Int Generator
           Lambda
             The Poisson parameter λ. If it is a scalar, then every element in the output
             vector shares the same Poisson parameter.
           Initial seed
               The initial seed value for the random number generator.
           Sample time
              The period of each sample-based vector or each row of a frame-based
              matrix.
           Frame-based outputs
              Determines whether the output is frame-based or sample-based. This box
              is active only if Interpret vector parameters as 1-D is unchecked.
           Samples per frame
              The number of samples in each column of a frame-based output signal. This
              field is active only if Frame-based outputs is checked.
           Interpret vector parameters as 1-D
              If this box is checked, then the output is a one-dimensional signal.
              Otherwise, the output is a two-dimensional signal. This box is active only
              if Frame-based outputs is unchecked.
                                                                                            4-359
Puncture
Purpose       4Puncture
              Output the elements which correspond to 1s in the binary Puncture vector
Description   The Puncture block creates an output vector by removing selected elements of
              the input vector and preserving others. The input can be a real or complex
              vector of length K. The block determines which elements to remove or preserve
              by using the binary Puncture vector parameter:
              • If Puncture vector(k) = 0, then the kth element of the input vector does not
                become part of the output vector.
              • If Puncture vector(k) = 1, then the kth element of the input vector is
                preserved in the output vector.
              Frame-Based Processing
              If the input is frame-based, then both it and the Puncture vector parameter
              must be column vectors. The length of the Puncture vector parameter must
              divide K. The block repeats the puncturing pattern, if necessary, to cover all
              input elements. That is, in the bulleted items above you can replace
              Puncture vector(k) by Puncture vector(n), where
                    n = mod(k,length(Puncture vector))
              and mod is the modulus function (mod in MATLAB).
Dialog Box
4-360
                                                                                 Puncture
           Puncture vector
              A binary vector whose pattern of 0s (1s) indicates which elements of the
              input the block should remove (preserve).
           • Removes the second and sixth elements from the group of six input elements.
           • Sends the first, third, fourth, and fifth elements to the output vector.
           The diagram below depicts the block’s operation on an input vector of [1:6],
           using this Puncture vector parameter.
[1 3 4 5]
                                                                                           4-361
QPSK Demodulator Baseband
Description   The QPSK Demodulator Baseband block demodulates a signal that was
              modulated using the quaternary phase shift keying method. The input is a
              baseband representation of the modulated signal.
              The input must be a discrete-time complex signal. The input can be either a
              scalar or a frame-based column vector.
              If the Output type parameter is set to Integer, then the block maps the point
                    exp(jθ + jπm/2)
              to m, where θ is the Phase offset parameter and m is 0, 1, 2, or 3.
              If the Output type parameter is set to Bit, then the output contains pairs of
              binary values. The reference page for the QPSK Modulator Baseband block
              shows the signal constellations for the cases when the Constellation ordering
              parameter is either Binary or Gray.
4-362
                                          QPSK Demodulator Baseband
Dialog Box
             Output type
                Determines whether the output consists of integers or pairs of bits.
             Constellation ordering
                Determines how the block maps each integer to a pair of output bits. This
                field is active only when Output type is set to Bit.
             Phase offset (rad)
                The phase of the zeroth point of the signal constellation.
             Samples per symbol
                The number of input samples that represent each modulated symbol.
                                                                                            4-363
QPSK Modulator Baseband
Description   The QPSK Modulator Baseband block modulates using the quaternary phase
              shift keying method. The output is a baseband representation of the modulated
              signal.
Binary Gray
01 00 01 00
10 11 11 10
4-364
                                               QPSK Modulator Baseband
Dialog Box
             Input type
                Indicates whether the input consists of integers or pairs of bits.
             Constellation ordering
                Determines how the block maps each pair of input bits to a corresponding
                integer. This field is active only when Input type is set to Bit.
             Phase offset (rad)
                The phase of the zeroth point of the signal constellation.
             Samples per symbol
                The number of output samples that the block produces for each integer or
                pair of bits in the input.
                                                                                            4-365
QPSK Modulator Baseband
See Also     M-PSK Modulator Baseband, BPSK Modulator Baseband, DQPSK Modulator
             Baseband
4-366
                                                                  Quantizer Decode
Description   The Quantizer Decode block recovers a message from a quantized signal,
              converting the quantization index into the corresponding codebook value. The
              Quantization codebook parameter, a vector of length N, prescribes the
              possible output values. If the input is an integer k between 0 and N-1, then the
              output is the (k+1)st element of Quantization codebook.
              The input can be either a scalar, a sample-based vector, or a frame-based row
              vector. This block processes each vector element independently. Each output
              signal is a vector of the same length as the input signal.
              Note The Sampled Quantizer Encode and Enabled Quantizer Encode blocks
              also use a Quantization codebook parameter. The first output of those blocks
              corresponds to the input of Quantizer Decode; the second output of those
              blocks corresponds to the output of Quantizer Decode.
Dialog Box
              Quantization codebook
                A real vector that prescribes the output value corresponding to each input
                integer.
                                                                                                 4-367
Random Deinterleaver
Description   The Random Deinterleaver block rearranges the elements of its input vector
              using a random permutation. The Initial seed parameter initializes the
              random number generator that the block uses to determine the permutation. If
              this block and the Random Interleaver block have the same value for Initial
              seed, then the two blocks are inverses of each other.
              The Number of elements parameter indicates how many numbers are in the
              input vector.If the input is frame-based, then it must be a column vector.
Dialog Box
              Number of elements
                The number of elements in the input vector.
              Initial seed
                  The initial seed value for the random number generator.
4-368
                                                 Random-Integer Generator
                                                                                                 4-369
Random-Integer Generator
Dialog Box
             M-ary number
                The positive integer, or vector of positive integers, that indicates the range
                of output values.
             Initial seed
                 The initial seed value for the random number generator. The vector length
                 of the seed determines the length of the output vector.
             Sample time
                The period of each sample-based vector or each row of a frame-based
                matrix.
             Frame-based outputs
                Determines whether the output is frame-based or sample-based. This box
                is active only if Interpret vector parameters as 1-D is unchecked.
             Samples per frame
                The number of samples in each column of a frame-based output signal. This
                field is active only if Frame-based outputs is checked.
4-370
                                             Random-Integer Generator
                                                                                           4-371
Random Interleaver
Description   The Random Interleaver block rearranges the elements of its input vector
              using a random permutation. The Number of elements parameter indicates
              how many numbers are in the input vector.If the input is frame-based, then it
              must be a column vector.
              The Initial seed parameter initializes the random number generator that the
              block uses to determine the permutation. The block is predictable for a given
              seed, but different seeds produce different permutations.
Dialog Box
              Number of elements
                The number of elements in the input vector.
              Initial seed
                  The initial seed value for the random number generator.
4-372
                                                                  Rayleigh Noise Generator
Description   The Rayleigh Noise Generator block generates Rayleigh distributed noise. The
              Rayleigh probability density function is given by
                                                x
                                                     2
                                            – --------2-
                                 x            2σ
                                                            x≥0
                     f ( x ) =  -----2- e
                                  σ
                                   0                       x<0
                                   î
                                 2
              where σ is known as the fading envelope of the Rayleigh distribution.
              The block requires you to specify the Initial seed for the random number
              generator. If it is a constant, then the resulting noise is repeatable. The sigma
              parameter can be either a vector of the same length as the Initial seed, or a
              scalar. When sigma is a scalar, every element of the output signal shares that
              same value.
                                                                                                  4-373
Rayleigh Noise Generator
Dialog Box
             Sigma
                Specify σ as defined in the Rayleigh probability density function.
             Initial seed
                 The initial seed value for the random number generator.
             Sample time
                The period of each sample-based vector or each row of a frame-based
                matrix.
             Frame-based outputs
                Determines whether the output is frame-based or sample-based. This box
                is active only if Interpret vector parameters as 1-D is unchecked.
             Samples per frame
                The number of samples in each column of a frame-based output signal. This
                field is active only if Frame-based outputs is checked.
             Interpret vector parameters as 1-D
                If this box is checked, then the output is a one-dimensional signal.
                Otherwise, the output is a two-dimensional signal. This box is active only
                if Frame-based outputs is unchecked.
4-374
                                               Rayleigh Noise Generator
References   [1] Proakis, John G. Digital Communications, Third edition. New York:
             McGraw Hill, 1995.
                                                                                     4-375
Rectangular QAM Demodulator Baseband
Description   The Rectangular QAM Demodulator Baseband block demodulates a signal that
              was modulated using quadrature amplitude modulation with a constellation on
              a rectangular lattice.
              The signal constellation has M points, where M is the M-ary number
              parameter. M must have the form 2K for some positive integer K. The block
              scales the signal constellation based on how you set the Normalization
              method parameter. For details, see the reference page for the Rectangular
              QAM Modulator Baseband block.
              The input can be either a scalar or a frame-based column vector.
4-376
                    Rectangular QAM Demodulator Baseband
Dialog Box
             M-ary number
                The number of points in the signal constellation. It must have the form 2K
                for some positive integer K.
             Output type
                Indicates whether the output consists of integers or groups of bits.
             Constellation ordering
                Determines how the block maps each integer to a group of output bits. This
                field is active only when Output type is set to Bit.
             Normalization method
                Determines how the block scales the signal constellation. Choices are Min.
                distance between symbols, Average Power, and Peak Power.
                                                                                             4-377
Rectangular QAM Demodulator Baseband
             Minimum distance
                The distance between two nearest constellation points. This field appears
                only when Normalization method is set to Min. distance between
                symbols.
4-378
                             Rectangular QAM Demodulator Passband
Description   The Rectangular QAM Demodulator Passband block demodulates a signal that
              was modulated using quadrature amplitude modulation with a constellation on
              a rectangular lattice. The signal constellation has M points, where M is the
              M-ary number parameter. M must have the form 2K for some positive integer
              K.
              This block converts the input to an equivalent baseband representation and
              then uses the baseband equivalent block, M-PAM Demodulator Baseband, for
              internal computations. The following parameters in this block are the same as
              those of the baseband equivalent block:
              • M-ary number
              • Output type
              • Constellation ordering
              • Normalization method
              • Minimum distance
              • Average power
              • Peak power
              The input must be a sample-based scalar signal.
                                                                                               4-379
Rectangular QAM Demodulator Passband
             Also, this block incurs an extra output period of delay compared to its baseband
             equivalent block.
Dialog Box
             M-ary number
                The number of points in the signal constellation. It must have the form 2K
                for some positive integer K.
4-380
       Rectangular QAM Demodulator Passband
Output type
   Indicates whether the output consists of integers or groups of bits.
Constellation ordering
   Determines how the block maps each integer to a group of output bits. This
   field is active only when Output type is set to Bit.
Normalization method
   Determines how the block scales the signal constellation. Choices are Min.
   distance between symbols, Average Power, and Peak Power.
Minimum distance
   The distance between two nearest constellation points. This field appears
   only when Normalization method is set to Min. distance between
   symbols.
                                                                                4-381
Rectangular QAM Demodulator Passband
4-382
                                       Rectangular QAM Modulator Baseband
Description   The Rectangular QAM Modulator Baseband block modulates using M-ary
              quadrature amplitude modulation with a constellation on a rectangular lattice.
              The output is a baseband representation of the modulated signal.
              • If Input type is set to Integer, then the block accepts integers. The input can
                be either a scalar or a frame-based column vector.
              • If Input type is set to Bit, then the block accepts groups of K bits, called
                binary words. The input can be either a vector of length K or a frame-based
                                                                                                  4-383
Rectangular QAM Modulator Baseband
          For details about the Gray coding, see the reference page for the M-PSK
          Modulator Baseband block and the paper listed in “References” below. Note
          that since the in-phase and quadrature components are assigned
          independently, the Gray and binary orderings coincide when M = 4.
4-384
                        Rectangular QAM Modulator Baseband
Dialog Box
             M-ary number
                The number of points in the signal constellation. It must have the form 2K
                for some positive integer K.
             Input type
                Indicates whether the input consists of integers or groups of bits.
             Constellation ordering
                Determines how the block maps each group of input bits to a corresponding
                integer. This field is active only when Input type is set to Bit.
                                                                                             4-385
Rectangular QAM Modulator Baseband
             Normalization method
                Determines how the block scales the signal constellation. Choices are Min.
                distance between symbols, Average Power, and Peak Power.
             Minimum distance
                The distance between two nearest constellation points. This field appears
                only when Normalization method is set to Min. distance between
                symbols.
4-386
                                        Rectangular QAM Modulator Passband
Description   The Rectangular QAM Modulator Passband block modulates using M-ary
              quadrature amplitude modulation with a constellation on a rectangular lattice.
              The output is a passband representation of the modulated signal. The signal
              constellation has M points, where M is the M-ary number parameter. M must
              have the form 2K for some positive integer K.
              This block uses the baseband equivalent block, Rectangular QAM Modulator
              Baseband, for internal computations and converts the resulting baseband
              signal to a passband representation. The following parameters in this block are
              the same as those of the baseband equivalent block:
              • M-ary number
              • Input type
              • Constellation ordering
              • Normalization method
              • Minimum distance
              • Average power
              • Peak power
              The input must be sample-based. If the Input type parameter is Bit, then the
              input must be a vector of length log2(M). If the Input type parameter is
              Integer, then the input must be a scalar.
                                                                                                4-387
Rectangular QAM Modulator Passband
Dialog Box
4-388
            Rectangular QAM Modulator Passband
M-ary number
   The number of points in the signal constellation. It must have the form 2K
   for some positive integer K.
Input type
   Indicates whether the input consists of integers or groups of bits.
Constellation ordering
   Determines how the block maps each group of input bits to a corresponding
   integer. This field is active only when Input type is set to Bit.
Normalization method
   Determines how the block scales the signal constellation. Choices are Min.
   distance between symbols, Average Power, and Peak Power.
Minimum distance
   The distance between two nearest constellation points. This field appears
   only when Normalization method is set to Min. distance between
   symbols.
                                                                                4-389
Rectangular QAM Modulator Passband
See Also General QAM Modulator Passband, Rectangular QAM Modulator Baseband
4-390
                                                          Rician Fading Channel
Library Channels
                                                                                                 4-391
Rician Fading Channel
Dialog Box
             K-factor
                The ratio of power in the direct path to diffuse power. The ratio is expressed
                linearly, not in decibels.
             Doppler frequency (Hz)
                A positive scalar that indicates the maximum Doppler shift.
             Sample time
                The period of each element of the input signal.
             Delay (s)
                A scalar that specifies the propagation delay.
             Gain (dB)
                A scalar that specifies the gain.
             Initial seed
                 The scalar seed for the Gaussian noise generator.
4-392
                                                       Rician Fading Channel
References   [1] Fechtel, Stefan A. “A Novel Approach to Modeling and Efficient Simulation
             of Frequency-Selective Fading Radio Channels.” IEEE Journal on Selected
             Areas in Communications, vol. 11, April 1993. 422-431.
             [2] Jakes, William C., ed. Microwave Mobile Communications. New York: IEEE
             Press, 1974.
             [3] Lee, William C. Y. Mobile Communications Design Fundamentals, 2nd ed.
             New York: Wiley, 1993.
                                                                                             4-393
Rician Noise Generator
Description   The Rician Noise Generator block generates Rician distributed noise. The
              Rician probability density function is given by
                                                                       2
                                                                     x +m
                                                                                     2
                                                                  – ------------------
                                                                                 2
                                                                                      -
                                 x            mx                         2σ
                                                                                          x≥0
                     f ( x ) =  -----2- I 0  -------
                                                    2
                                                     - e
                                      σ        σ
                                                     0                                   x<0
                                     î
where:
              Note that m and σ are not the mean value and standard deviation for the
              Rician noise.
              You must specify the Initial seed for the random number generator. When it
              is a constant, the resulting noise is repeatable. The vector length of the Initial
              seed parameter should equal the number of columns in a frame-based output
              or the number of elements in a sample-based output. The set of numerical
              parameters above the Initial seed parameter in the dialog box can consist of
              vectors having the same length as the Initial seed, or scalars.
4-394
                                                      Rician Noise Generator
Dialog Box
             Specification method
                Either K-factor or Quadrature components.
             Rician K-factor
                K = m2/(2σ2), where m is as in the Rician probability density function. This
                field appears only if Specification method is K-factor.
             In-phase component (mean), Quadrature component (mean)
                 The mean values mI and mQ, respectively, of the Gaussian components.
                 These fields appear only if Specification method is Quadrature
                 components.
                                                                                               4-395
Rician Noise Generator
             Sigma
                The variable σ in the Rician probability density function.
             Initial seed
                 The initial seed value for the random number generator.
             Sample time
                The period of each sample-based vector or each row of a frame-based
                matrix.
             Frame-based outputs
                Determines whether the output is frame-based or sample-based. This box
                is active only if Interpret vector parameters as 1-D is unchecked.
             Samples per frame
                The number of samples in each column of a frame-based output signal. This
                field is active only if Frame-based outputs is checked.
             Interpret vector parameters as 1-D
                If this box is checked, then the output is a one-dimensional signal.
                Otherwise, the output is a two-dimensional signal. This box is active only
                if Frame-based outputs is unchecked.
References   [1] Proakis, John G. Digital Communications, Third edition. New York:
             McGraw Hill, 1995.
4-396
                                                Sampled Quantizer Encode
Description   The Sampled Quantizer Encode block encodes an input signal using scalar
              quantization. The block outputs the quantization levels (or quantization index)
              of the input signal, the encoded signal, and the mean square distortion.
              The input can be either a scalar, a sample-based vector, or a frame-based row
              vector. This block processes each vector element independently. Each output
              signal is a vector of the same length as the input signal.
              The Quantization partition parameter is a length-n real vector whose entries
              are in strictly ascending order. The first output signal corresponding to an
              input signal of x is:
              • 0 if x ≤ Quantization partition(1)
              • m if Quantization partition(m) < x ≤ Quantization partition(m+1)
              • n if Quantization partition(n) < x
                                                                                                4-397
Sampled Quantizer Encode
Dialog Box
             Quantization partition
               The vector of endpoints of the partition intervals. The elements must be in
               strictly ascending order.
             Quantization codebook
               The vector of output values assigned to each partition.
             Input signal vector length
                The length of the input signal.
             Sample time
                The output sample time.
4-398
                                                                                    Scrambler
Purpose       4Scrambler
              Scramble the input signal
Description   The Scrambler block scrambles the scalar input signal. If the Calculation base
              parameter is N, then the input values must be integers between 0 and N-1.
              One purpose of scrambling is to reduce the length of strings of 0s or 1s in a
              transmitted signal, since a long string of 0s or 1s may cause transmission
              synchronization problems. Below is a schematic of the scrambler. All adders
              perform addition modulo N.
Scrambled data
+ + +
              At each time step, the input causes the contents of the registers to shift
              sequentially. Each switch in the scrambler is on or off as defined by the
              Scramble polynomial parameter. You can specify the polynomial by listing its
              coefficients in order of ascending powers of z-1, or by listing the powers of z that
              appear in the polynomial with a coefficient of 1. For example p = [1 0 0 0 0 0 1
              0 1] and p = [0 -6 -8] both represent the polynomial p(z-1) = 1 + z-6 + z-8.
              The Initial states parameter lists the states of the scrambler’s registers when
              the simulation starts. The elements of this vector must be integers between 0
              and N-1. The vector length of this parameter must equal the order of the
              scramble polynomial. (If the Scramble polynomial parameter is a vector that
              lists the coefficients in order, then the order of the scramble polynomial is one
              less than the vector length.)
                                                                                                     4-399
Scrambler
Dialog Box
             Calculation base
                The calculation base N. The input and output of this block are integers in
                the range [0, N-1].
             Scramble polynomial
                A polynomial that defines the connections in the scrambler.
             Initial states
                 The states of the scrambler’s registers when the simulation starts.
4-400
                                             SSB AM Demodulator Baseband
Description   The SSB AM Demodulator Baseband block demodulates a signal that was
              modulated using single-sideband amplitude modulation. The input is a
              baseband representation of the modulated signal. The input is complex, while
              the output is real. The input must be a sample-based scalar signal.
              In the course of demodulating, the block uses a filter whose transfer function
              is described by the Lowpass filter numerator and Lowpass filter
              denominator parameters.
Dialog Box
                                                                                                   4-401
SSB AM Demodulator Baseband
             Sample time
                The sample time of the output signal.
4-402
                                             SSB AM Demodulator Passband
Description   The SSB AM Demodulator Passband block demodulates a signal that was
              modulated using single-sideband amplitude modulation. The input is a
              passband representation of the modulated signal. Both the input and output
              signals are real sample-based scalar signals.
              In the course of demodulating, this block uses a filter whose transfer function
              is described by the Lowpass filter numerator and Lowpass filter
              denominator parameters.
Dialog Box
                                                                                                4-403
SSB AM Demodulator Passband
4-404
                                                SSB AM Modulator Baseband
                          − jû ( t ) )e
                    (u(t) +
                                           jθ
              where θ is the Initial phase parameter and û(t) is the Hilbert transform of the
              input u(t). The minus sign indicates the upper sideband and the plus sign
              indicates the lower sideband.
              • The Time delay for Hilbert transform filter parameter specifies the delay
                in the filter design. You should choose a value of the form
                  (N+1/2)*(Sample time parameter)
                  where N is a positive integer.
              • The Bandwidth of the input signal parameter is the estimated highest
                frequency component in the input message signal. This parameter is used to
                design a compensator for the Hilbert transform filter, which would force the
                message signal amplitude to remain within the assigned range.
                  If this parameter is either 0 or larger than 1/(2*Sample time), then the block
                  does not generate a compensator.
                                                                                                   4-405
SSB AM Modulator Baseband
             This block uses the hilbiir function in the Communications Toolbox to design
             the Hilbert transform filter.
Dialog Box
4-406
                                          SSB AM Modulator Baseband
References   [1] Peebles, Peyton Z, Jr. Communication System Principles. Reading, Mass.:
             Addison-Wesley, 1976.
                                                                                           4-407
SSB AM Modulator Passband
u ( t ) cos ( f c t + θ ) ± û ( t ) sin ( f c t + θ )
where:
              • The Time delay for Hilbert transform filter parameter specifies the delay
                in the filter design. You should choose a value of the form
                  (N+1/2)*(Sample time parameter)
                  where N is a positive integer.
              • The Bandwidth of the input signal parameter is the estimated highest
                frequency component in the input message signal.
                  This parameter is used to design a compensator for the Hilbert transform
                  filter, which would force the message signal amplitude to remain within the
4-408
                                           SSB AM Modulator Passband
Dialog Box
                                                                                            4-409
SSB AM Modulator Passband
References   [1] Peebles, Peyton Z, Jr. Communication System Principles. Reading, Mass.:
             Addison-Wesley, 1976.
4-410
                                                                    Triggered Read From File
Description   The Triggered Read From File block reads a new record from a file only at the
              rising edge of the input trigger signal. The output is a sample-based signal.
              Note The triggered behavior of this block is one difference between this block
              and Simulink’s From File block. However, the From File block is useful for
              reading platform-independent MAT-files.
              The file can be an ASCII text file, a file containing integer or floating point
              numbers, or a binary file (in the format of the C fwrite function). The file must
              be either in the current working directory on the MATLAB path.
              When a rising edge of the input trigger signal is detected, this block reads from
              the file a record whose length is specified in the parameter Output vector
              length. The first reading always occurs at the first rising edge. After that, if
              the Decimation parameter is a positive integer k, then the block reads at
              every kth rising edge. If Decimation is 1, then the block reads at every rising
              edge.
              When the block reaches the end-of-file marker, it either:
              • Rereads from the beginning of the file, if the Cyclic repeat box is checked, or
              • Outputs zeros, if the Cyclic repeat box is not checked
              If the Data type parameter is ASCII, then the output is an integer. The
              mapping between decimal integers and ASCII characters is shown below.
                 0                        NUL     32        SP       64        @       96        \
                 1                        SOH     33        !        65        A       97        a
                 2                        STX     34        “        66        B       98        b
                 3                        ETX     35        #        67        C       99        c
                 4                        EOT     36        $        68        D       100       d
                                                                                                         4-411
Triggered Read From File
            5         ENQ     37        %       69        E       101       e
            6         ACK     38        &       70        F       102       f
            7         BEL     39        ‘       71        G       103       g
            8         BS      40        (       72        H       104       h
            9         HT      41        )       73        I       105       i
            10        LF      42        *       74        J       106       j
            11        VT      43        +       75        K       107       k
            12        FF      44        ,       76        L       108       l
            13        CR      45        -       77        M       109       m
            14        SO      46        .       78        N       110       n
            15        SI      47        /       79        O       111       o
            16        DLE     48        0       80        P       112       p
            17        DC1     49        1       81        Q       113       q
            18        DC2     50        2       82        R       114       r
            19        DC3     51        3       83        S       115       s
            20        DC4     52        4       84        T       116       t
            21        NAK     53        5       85        U       117       u
            22        SYN     54        6       86        V       118       v
            23        ETB     55        7       87        W       119       w
            24        CAN     56        8       88        X       120       x
            25        EM      57        9       89        Y       121       y
            26        SUB     58        :       90        Z       122       z
            27        ESC     59        ;       91        [       123       {
            28        FS      60        <       92        \       124       |
            29        GS      61        =       93        ]       125       }
            30        RS      62        >       94        ^       126       ~
            31        US      63        ?       95        _       127       DEL
4-412
                                                    Triggered Read From File
Dialog Box
             File name
                 The filename, including its extension, as a string.
             Data type
                The data type. Choices are ASCII, binary, float, and integer.
             Decimation
                A decimation factor. If it is 1, then the block reads at every rising edge.
             Output vector length
                The vector length of the block’s output.
             Cyclic repeat
                Specifies whether to cycle continuously through the contents of File name
                or to output only zeros after reaching the end-of-file marker.
             Threshold in detecting trigger signal
                The threshold for the rising edge of the trigger signal.
                                                                                              4-413
Triggered Write to File
Description   The Triggered Write to File block creates a file containing selected data from
              the input signal. Unlike Simulink’s To File block, the Triggered Write to File
              block writes new data to the file only at the rising edge of the input trigger
              signal. However, the To File block is useful for creating platform-independent
              MAT-files.
              The file can be an ASCII text file, a file containing integer or floating-point
              numbers, or a binary file (in the format of the C fwrite function). You specify
              the file type using the Data type parameter. If Data type is ASCII then this
              block converts the data into ASCII characters before writing, using the
              mapping shown on the reference page for the Triggered Read From File block.
              For example, an input of 65 would cause the the block to write the character
              “A” to the file. Other file types receive the data directly.
Caution If the destination file already exists, then this block overwrites it.
              The first input signal contains the data to write. This input must be
              sample-based. The second input signal is a sample-based scalar trigger signal
              that controls the timing of writing. When a rising edge of the input trigger
              signal is detected, this block writes the elements of the data signal to the file.
              The file does not contain information about the dimension or orientation of the
              data input, however.
              The first write always occurs at the first rising edge. After that, the
              Decimation parameter determines how many triggers the block receives
              between successive file writes. Setting this parameter to 1 causes the block to
              write at every rising edge.
4-414
                                                         Triggered Write to File
Dialog Box
             File name
                 The filename, including its extension, as a string.
             Data type
                The data type. Choices are ASCII, binary, float, and integer.
             Decimation
                A decimation factor. If it is 1, then the block writes at every rising edge.
             Threshold in detecting trigger signal
                The threshold for the rising edge of the trigger signal.
                                                                                               4-415
Uniform Noise Generator
Description   The Uniform Noise Generator block generates uniformly distributed noise. The
              output data of this block is uniformly distributed between the specified lower
              and upper bounds. The upper bound must be greater than or equal to the lower
              bound.
              You must specify the Initial seed in the simulation. When it is a constant, the
              resulting noise is repeatable.
              If all the elements of the output vector are to be independent and identically
              distributed (i.i.d.), then you can use a scalar for the Noise lower bound and
              Noise upper bound parameters. Alternatively, you can specify the range for
              each element of the output vector individually, by using vectors for the Noise
              lower bound and Noise upper bound parameters. If the bounds are vectors,
              then their length must equal the length of the Initial seed parameter.
4-416
                                                 Uniform Noise Generator
Dialog Box
                                                                                            4-417
Uniform Noise Generator
See Also Random Source (DSP Blockset); rand (built-in MATLAB function)
4-418
                                                                       Viterbi Decoder
Description   The Viterbi Decoder block decodes input symbols to produce binary output
              symbols. This block can process several symbols at a time for faster
              performance.
                                                                                                  4-419
Viterbi Decoder
                                                              1: logical one
            Soft Decision        Integers between 0           0: most confident decision for
                                 and 2b-1, where b is         logical zero
                                 the Number of soft
                                 decision bits                2b-1: most confident decision
                                 parameter                    for logical one
           To illustrate the soft decision situation more explicitly, the table below lists
           interpretations of values for 3-bit soft decisions.
4-420
                                                         Viterbi Decoder
• In Continuous mode, the block saves its internal state metric at the end of
  each frame, for use with the next frame. Each traceback path is treated
  independently.
• In Truncated mode, the block treats each frame independently. The
  traceback path starts at the state with the best metric and always ends in
  the all-zeros state. This mode is appropriate when the corresponding
  Convolutional Encoder block has its Reset parameter set to On each frame.
• In Terminated mode, the block treats each frame independently, and the
  traceback path always starts and ends in the all-zeros state. This mode is
  appropriate when the uncoded message signal (that is, the input to the
  corresponding Convolutional Encoder block) has enough zeros at the end of
  each frame to fill all memory registers of the encoder. If the encoder has k
  input streams and constraint length vector constr (using the polynomial
  description), then “enough” means k*max(constr-1).
In the special case when the frame-based input signal contains only one
symbol, the Continuous mode is most appropriate.
• If the input signal is sample-based, then the decoding delay consists of D zero
  symbols
• If the input signal is frame-based and the Operation mode parameter is set
  to Continuous, then the decoding delay consists of D zero symbols
• If the Operation mode parameter is set to Truncated or Terminated, then
  there is no output delay and the Traceback depth parameter must be less
  than or equal to the number of symbols in each frame.
If the code rate is 1/2, then a typical Traceback depth value is about five times
the constraint length of the code.
Reset Port
The reset port is usable only when the Operation mode parameter is set to
Continuous. Checking the Reset input check box causes the block to have an
                                                                                    4-421
Viterbi Decoder
             additional input port, labeled Rst. When the Rst input is nonzero, the decoder
             returns to its initial state by configuring its internal memory as follows:
             Using a reset port on this block is analogous to setting the Reset parameter in
             the Convolutional Encoder block to On nonzero Rst input.
Dialog Box
             Trellis structure
                MATLAB structure that contains the trellis description of the
                convolutional encoder. Use the same value here and in the corresponding
                Convolutional Encoder block.
             Decision type
                Unquantized, Hard Decision, or Soft Decision.
4-422
                                                                    Viterbi Decoder
             Operation mode
                Method for transitioning between successive input frames. For
                frame-based input, the choices are Continuous, Terminated, and
                Truncated. Sample-based input must use the Continuous mode.
             Reset input
                When you check this box, the decoder has a second input port labeled Rst.
                Providing a nonzero input value to this port causes the internal memory to
                be set to its initial state prior to processing the input data.
References   [1] Clark, George C. Jr. and J. Bibb Cain. Error-Correction Coding for Digital
             Communications. New York: Plenum Press, 1981.
             [2] Gitlin, Richard D., Jeremiah F. Hayes, and Stephen B. Weinstein. Data
             Communications Principles. New York: Plenum, 1992.
             [3] Heller, Jerrold A. and Irwin Mark Jacobs. “Viterbi Decoding for Satellite
             and Space Communication.” IEEE Transactions on Communication
             Technology, vol. COM-19, October 1971. 835-848.
                                                                                              4-423
Voltage-Controlled Oscillator
Dialog Box
              Output amplitude
                 The amplitude of the output.
              Oscillation frequency (Hz)
                 The frequency of the oscillator output when the input signal is zero.
4-424
                                           Voltage-Controlled Oscillator
           Input sensitivity
              This value scales the input voltage and, consequently, the shift from the
              Oscillation frequency value. The units of Input sensitivity are Hertz per
              volt.
           Initial phase (rad)
               The initial phase of the oscillator in radians.
                                                                                          4-425
Windowed Integrator
Description   The Windowed Integrator block integrates the input signal in discrete time,
              over a sliding time window of fixed length. If the Integration window length
              parameter is T, then the output at time t is the result of integrating the input
              signal from t-T to t. The block assumes that the input signal is zero for all
              negative t.
              You can choose one of three integration methods: Forward Euler, Backward
              Euler, and Trapezoidal.
Dialog Box
4-426
                                                          Windowed Integrator
           Method
              The integration method. Choices are Forward Euler, Backward Euler,
              and Trapezoidal.
           Sample time
              The integration sample time. This must not exceed the Integration
              window length parameter.
Examples Integrate a scalar constant signal whose value is 1 using these parameters:
           You can use a Simulink Constant block for the input signal. The Simulink
           Scope block shows the output below.
                                                                                                 4-427
Windowed Integrator
4-428
                                                                                  Index
A
A-law companders 2-24                          Bit to Integer Converter block 4-89
A-Law Compressor block 4-47                    block coding
A-Law Expander block 4-49                         features of blockset 2-28
Algebraic Deinterleaver block 4-51                methods supported in blockset 2-28
Algebraic Interleaver block 4-53                  techniques for 2-28
amplitude modulation (AM)                         terminology and notation 2-29
   example model 2-59                          block coding library 2-27
analog modulation libraries 2-53                  reference for 4-9
   reference for 4-24                          block interleaving library 2-46
analog-to-digital conversion 2-16                 reference for 4-13
APP Decoder block 4-56                         BPSK Demodulator Baseband block 4-90
AWGN Channel block 4-60                        BPSK Modulator Baseband block 4-92
B                                              C
baseband                                       Channel Coding library 2-27
   simulation 2-54                                reference for 4-9
Baseband PLL block 4-64                        Channels library 2-84
Basic Comm Functions library 4-37                 reference for 4-34
BCH Decoder block 4-66                         Charge Pump PLL block 4-94
BCH Encoder block 4-68                         code generator matrices
Bernoulli Random Binary Generator block 4-70      representing 2-36
binary                                         codebooks
   codes 2-28                                     representing 2-17
   numbers, order of digits and 2-31           codewords
   vector format for messages and codewords       definition 2-29
         2-29                                     representing 2-29
      in Reed-Solomon codes 2-30               coding, source
Binary Cyclic Decoder block 4-73                  features of the blockset 2-16
Binary Cyclic Encoder block 4-75               column vector signals xviii
Binary Linear Decoder block 4-79               Comm Sinks library 2-12
Binary Linear Encoder block 4-81                  reference for 4-5
Binary Symmetric Channel block 4-84            Comm Sources library 2-6
Binary Vector Noise Generator block 4-86          reference for 4-3
Binary-Input RS Encoder block 4-77             companders 2-24
Binary-Output RS Decoder block 4-82               example 2-24
                                                                                          I-1
      Index
I-2
                                                                                        Index
                                             F
E                                            features
Enabled Quantizer Encode block 4-185             analog modulation 2-53
error                                            block coding 2-28
   predictive 2-21                               channel 2-84
Error Rate Calculation block 4-187               digital modulation 2-65
error-control coding                             interleaving 2-46
   base 2 only 2-28                              sink 2-12
error-correction capability                      source 2-6
   of Hamming codes 2-36                         source coding 2-16
   of Reed-Solomon codes 2-38                    synchronization 2-90
examples                                     filters
   analog modulation step sizes 2-57             use after demodulating
   analog modulation timing 2-55                    choosing cutoff frequency 2-59
   companders 2-24                                  resulting time lag 2-62
   continuous phase modulation 2-78          FM Demodulator Baseband block 4-194
   convolutional coding 2-42                 FM Demodulator Passband block 4-196
   convolutional interleaving 2-50           FM Modulator Baseband block 4-198
   delays from filtering 2-62                FM Modulator Passband block 4-200
   delays in digital demodulation 2-71       frame attribute xviii
   differential pulse code modulation 2-22   frame-based signals, definition of xviii
   eye and scatter diagrams 2-14             full matrix signal, definition of xviii
   fading channels 2-86
   filter cutoffs 2-59
   Hamming coding 2-32                       G
   passband digital modulation 2-81          Gaussian Noise Generator block 4-202
   quantization 2-18                         General Block Deinterleaver block 4-205
   quantized sine wave 2-19                  General Block Interleaver block 4-207
   Reed-Solomon coding 2-33                  General Multiplexed Deinterleaver block 4-208
   scatter diagrams 2-76                     General Multiplexed Interleaver block 4-210
   signal constellations 2-75
                                                                                                I-3
      Index
I-4
                                                                                        Index
                                                                                                I-5
      Index
      R                                               example 2-18
      random                                          features of the blockset 2-16
         signals 2-6                                  parameters, representing 2-17
      Random Deinterleaver block 4-368             scalar signals
      Random Interleaver block 4-372                  definition of xviii
      Random-Integer Generator block 4-369         scatter diagrams 2-13
      Rayleigh Noise Generator block 4-373         Scrambler block 4-399
      Rectangular QAM Demodulator Baseband block   Sequence Operations library 4-38
               4-376                               signal formatting
      Rectangular QAM Demodulator Passband block      features of the blockset 2-16
               4-379                               Signal Processing Toolbox
      Rectangular QAM Modulator Baseband block        for filter design 2-59
               4-383                               sinks library 2-12
      Rectangular QAM Modulator Passband block        reference for 4-5
               4-387                               sizes, of matrix signals xviii
      references                                   source coding
         error-correction coding 2-39                 features of the blockset 2-16
      representing                                 Source Coding library 2-16
         codebooks 2-17                               reference for 4-7
         codewords 2-29                            sources library 2-6
         generator matrices 2-36                      reference for 4-3
         messages 2-29                             SSB AM Demodulator Baseband block 4-401
         partitions 2-17                           SSB AM Demodulator Passband block 4-403
         predictors 2-22                           SSB AM Modulator Baseband block 4-405
         quantization parameters 2-17              SSB AM Modulator Passband block 4-408
         truth tables 2-36                         synchronization
      Rician Fading Channel block 4-391               features of the blockset 2-90
      Rician Noise Generator block 4-394           Synchronization library 2-90
      row vector signals xviii                        reference for 4-36
      S                                            T
      sample times, in sources 2-7                 timing, decision
      sample-based signals, definition of xviii       and eye diagrams 2-13
      Sampled Quantizer Encode block 4-397            and scatter diagrams 2-13
      scalar quantization                          truth tables
         coding 2-20                                  representing 2-36
I-6
                                            Index
U
Uniform Noise Generator block 4-416
Utility Functions library 4-41
V
vector quantization 2-16
vector signals, definition of xviii
Viterbi Decoder block 4-419
Voltage-Controlled Oscillator block 4-424
W
Windowed Integrator block 4-426
I-7