]> Creatis software - CreaPhase.git/blob - octave_packages/communications-1.1.1/doc-cache
Add a useful package (from Source forge) for octave
[CreaPhase.git] / octave_packages / communications-1.1.1 / doc-cache
1 # Created by Octave 3.6.1, Mon May 21 07:07:01 2012 UTC <root@brouzouf>
2 # name: cache
3 # type: cell
4 # rows: 3
5 # columns: 88
6 # name: <cell-element>
7 # type: sq_string
8 # elements: 1
9 # length: 8
10 ademodce
11
12
13 # name: <cell-element>
14 # type: sq_string
15 # elements: 1
16 # length: 2038
17  -- Function File: Y = ademodce (X,FS,'amdsb-tc',offset)
18  -- Function File: Y = ademodce (X,FS,'amdsb-tc/costas',offset)
19  -- Function File: Y = ademodce (X,FS,'amdsb-sc')
20  -- Function File: Y = ademodce (X,FS,'amdsb-sc/costas')
21  -- Function File: Y = ademodce (X,FS,'amssb')
22  -- Function File: Y = ademodce (X,FS,'qam')
23  -- Function File: Y = ademodce (X,FS,'qam/cmplx')
24  -- Function File: Y = ademodce (X,FS,'fm',DEV)
25  -- Function File: Y = ademodce (X,FS,'pm',DEV)
26  -- Function File: Y = ademodce (X,[FS,IPHS],...)
27  -- Function File: Y = ademodce (...,NUM,DEN)
28      Baseband demodulator for analog signals. The input signal is
29      specified by X, its sampling frequency by FS and the type of
30      modulation by the third argument, TYP. The default values of FS is
31      1 and TYP is 'amdsb-tc'.
32
33      If the argument FS is a two element vector, the the first element
34      represents the sampling rate and the second the initial phase.
35
36      The different types of demodulations that are available are
37
38     'am'
39     'amdsb-tc'
40           Double-sideband with carrier
41
42     'amdsb-tc/costas'
43           Double-sideband with carrier and Costas phase locked loop
44
45     'amdsb-sc'
46           Double-sideband with suppressed carrier
47
48     'amssb'
49           Single-sideband with frequency domain Hilbert filtering
50
51     'qam'
52           Quadrature amplitude demodulation. In-phase in odd-columns
53           and quadrature in even-columns
54
55     'qam/cmplx'
56           Quadrature amplitude demodulation with complex return value.
57
58     'fm'
59           Frequency demodulation
60
61     'pm'
62           Phase demodulation
63
64      Additional arguments are available for the demodulations
65      'amdsb-tc', 'fm', 'pm'. These arguments are
66
67     `offset'
68           The offset in the input signal for the transmitted carrier.
69
70     `dev'
71           The deviation of the phase and frequency modulation
72
73      It is possible to specify a low-pass filter, by the numerator NUM
74      and denominator DEN that will be applied to the returned vector.
75
76
77    See also: ademodce, dmodce
78
79
80
81
82 # name: <cell-element>
83 # type: sq_string
84 # elements: 1
85 # length: 40
86 Baseband demodulator for analog signals.
87
88
89
90 # name: <cell-element>
91 # type: sq_string
92 # elements: 1
93 # length: 7
94 amdemod
95
96
97 # name: <cell-element>
98 # type: sq_string
99 # elements: 1
100 # length: 191
101  -- Function File: [M] = amdemod (S, FC, FS)
102      Compute the amplitude demodulation of the signal S with a carrier
103      frequency of FC and a sample frequency of FS.
104
105      See also: ammod
106
107
108
109
110
111 # name: <cell-element>
112 # type: sq_string
113 # elements: 1
114 # length: 80
115 Compute the amplitude demodulation of the signal S with a carrier
116 frequency of F
117
118
119
120 # name: <cell-element>
121 # type: sq_string
122 # elements: 1
123 # length: 5
124 ammod
125
126
127 # name: <cell-element>
128 # type: sq_string
129 # elements: 1
130 # length: 190
131  -- Function File: ammod (X,FC,FS)
132      Create the AM modulation of the signal x with carrier frequency
133      fs. Where x is sample at frequency fs.
134
135      See also: amdemod, fmmod, fmdemod
136
137
138
139
140
141 # name: <cell-element>
142 # type: sq_string
143 # elements: 1
144 # length: 67
145 Create the AM modulation of the signal x with carrier frequency fs.
146
147
148
149 # name: <cell-element>
150 # type: sq_string
151 # elements: 1
152 # length: 6
153 amodce
154
155
156 # name: <cell-element>
157 # type: sq_string
158 # elements: 1
159 # length: 1785
160  -- Function File: Y = amodce (X,FS,'amdsb-tc',offset)
161  -- Function File: Y = amodce (X,FS,'amdsb-sc')
162  -- Function File: Y = amodce (X,FS,'amssb')
163  -- Function File: Y = amodce (X,FS,'amssb/time',NUM,DEN)
164  -- Function File: Y = amodce (X,FS,'qam')
165  -- Function File: Y = amodce (X,FS,'fm',DEV)
166  -- Function File: Y = amodce (X,FS,'pm',DEV)
167  -- Function File: Y = amodce (X,[FS,IPHS],...)
168      Baseband modulator for analog signals. The input signal is
169      specified by X, its sampling frequency by FS and the type of
170      modulation by the third argument, TYP. The default values of FS is
171      1 and TYP is 'amdsb-tc'.
172
173      If the argument FS is a two element vector, the the first element
174      represents the sampling rate and the second the initial phase.
175
176      The different types of modulations that are available are
177
178     'am'
179     'amdsb-tc'
180           Double-sideband with carrier
181
182     'amdsb-sc'
183           Double-sideband with suppressed carrier
184
185     'amssb'
186           Single-sideband with frequency domain Hilbert filtering
187
188     'amssb/time'
189           Single-sideband with time domain filtering. Hilbert filter is
190           used by default, but the filter can be specified
191
192     'qam'
193           Quadrature amplitude modulation
194
195     'fm'
196           Frequency modulation
197
198     'pm'
199           Phase modulation
200
201      Additional arguments are available for the modulations 'amdsb-tc',
202      'fm, 'pm' and 'amssb/time'. These arguments are
203
204     `offset'
205           The offset in the input signal for the transmitted carrier.
206
207     `dev'
208           The deviation of the phase and frequency modulation
209
210     `num'
211     `den'
212           The numerator and denominator of the filter transfer function
213           for the time domain filtering of the SSB modulation
214
215
216    See also: ademodce, dmodce
217
218
219
220
221 # name: <cell-element>
222 # type: sq_string
223 # elements: 1
224 # length: 38
225 Baseband modulator for analog signals.
226
227
228
229 # name: <cell-element>
230 # type: sq_string
231 # elements: 1
232 # length: 8
233 apkconst
234
235
236 # name: <cell-element>
237 # type: sq_string
238 # elements: 1
239 # length: 1624
240  -- Function File:  apkconst (NSIG)
241  -- Function File:  apkconst (NSIG,AMP)
242  -- Function File:  apkconst (NSIG,AMP,PHS)
243  -- Function File:  apkconst (...,"n")
244  -- Function File:  apkconst (...,STR)
245  -- Function File: Y =  apkconst (...)
246      Plots a ASK/PSK signal constellation. Argument NSIG is a real
247      vector whose length determines the number of ASK radii in the
248      constellation.  The values of vector NSIG determine the number of
249      points in each ASK radii.
250
251      By default the radii of each ASK modulated level is given by the
252      index of NSIG. The amplitudes can be defined explictly in the
253      variable AMP, which  is a vector of the same length as NSIG.
254
255      By default the first point in each ASK radii has zero phase, and
256      following points are coding in an anti-clockwise manner. If PHS is
257      defined then it is a vector of the same length as NSIG defining
258      the initial phase in each ASK radii.
259
260      In addition "apkconst" takes two string arguments 'n' and and STR.
261      If the string 'n' is included in the arguments, then a number is
262      printed next to each constellation point giving the symbol value
263      that would be mapped to this point by the "modmap" function. The
264      argument STR is a plot style string (example 'r+') and determines
265      the default gnuplot point style to use for plot points in the
266      constellation.
267
268      If "apskconst" is called with a return argument, then no plot is
269      created. However the return value is a vector giving the in-phase
270      and quadrature values of the symbols in the constellation.
271
272    See also: dmod, ddemod, modmap, demodmap
273
274
275
276
277 # name: <cell-element>
278 # type: sq_string
279 # elements: 1
280 # length: 37
281 Plots a ASK/PSK signal constellation.
282
283
284
285 # name: <cell-element>
286 # type: sq_string
287 # elements: 1
288 # length: 4
289 awgn
290
291
292 # name: <cell-element>
293 # type: sq_string
294 # elements: 1
295 # length: 1122
296  -- Function File: Y = awgn (X,SNR)
297  -- Function File: Y = awgn (X,SNR,PWR)
298  -- Function File: Y = awgn (X,SNR, PWR,SEED)
299  -- Function File: Y = awgn (..., 'TYPE')
300      Add white Gaussian noise to a voltage signal.
301
302      The input X is assumed to be a real or complex voltage  signal. The
303      returned value Y will be the same form and size as X but with
304      Gaussian noise added. Unless the power is specified in PWR, the
305      signal power is assumed to be 0dBW, and the noise of SNR dB will be
306      added with respect to this. If PWR is a numeric value then the
307      signal X is assumed to be PWR dBW, otherwise if PWR is 'measured',
308      then the power in the signal will be measured and the noise added
309      relative to this measured power.
310
311      If SEED is specified, then the random number generator seed is
312      initialized with this value
313
314      By default the SNR and PWR are assumed to be in dB and dBW
315      respectively. This default behaviour can be chosen with TYPE set
316      to 'dB'. In the case where TYPE is set to 'linear', PWR is assumed
317      to be in Watts and SNR is a ratio.
318
319    See also: randn, wgn
320
321
322
323
324 # name: <cell-element>
325 # type: sq_string
326 # elements: 1
327 # length: 45
328 Add white Gaussian noise to a voltage signal.
329
330
331
332 # name: <cell-element>
333 # type: sq_string
334 # elements: 1
335 # length: 7
336 bchpoly
337
338
339 # name: <cell-element>
340 # type: sq_string
341 # elements: 1
342 # length: 3093
343  -- Function File: P =  bchpoly ()
344  -- Function File: P =  bchpoly (N)
345  -- Function File: P =  bchpoly (N,K)
346  -- Function File: P =  bchpoly (PRIM,K)
347  -- Function File: P =  bchpoly (N,K,PRIM)
348  -- Function File: P =  bchpoly (...,PROBE)
349  -- Function File: [P,F] =  bchpoly (...)
350  -- Function File: [P,F,C] =  bchpoly (...)
351  -- Function File: [P,F,C,PAR] =  bchpoly (...)
352  -- Function File: [P,F,C,PAR,T] =  bchpoly (...)
353      Calculates the generator polynomials for a BCH coder. Called with
354      no input arguments "bchpoly" returns a list of all of the valid
355      BCH codes for the codeword length 7, 15, 31, 63, 127, 255 and 511.
356      A three column matrix is returned with each row representing a
357      seperate valid BCH code. The first column is the codeword length,
358      the second the message length and the third the error correction
359      capability of the code.
360
361      Called with a single input argument, "bchpoly" returns the valid
362      BCH codes for the specified codeword length N. The output format
363      is the same as above.
364
365      When called with two or more arguments, "bchpoly" calculates the
366      generator polynomial of a particular BCH code. The generator
367      polynomial is returned in P as a vector representation of a
368      polynomial in GF(2). The terms of the polynomial are listed
369      least-significant term first.
370
371      The desired BCH code can be specified by its codeword length N and
372      its message length K. Alternatively, the primitive polynomial over
373      which to calculate the polynomial can be specified as PRIM.  If a
374      vector representation of the primitive polynomial is given, then
375      PRIM can be specified as the first argument of two arguments, or
376      as the third argument. However, if an integer representation of the
377      primitive polynomial is used, then the primitive polynomial must be
378      specified as the third argument.
379
380      When called with two or more arguments, "bchpoly" can also return
381      the factors F of the generator polynomial P, the cyclotomic coset
382      for the Galois field over which the BCH code is calculated, the
383      parity check matrix PAR and the error correction capability T. It
384      should be noted that the parity check matrix is calculated with
385      "cyclgen" and limitations in this function means that the parity
386      check matrix is only available for codeword length upto 63. For
387      codeword length longer than this PAR returns an empty matrix.
388
389      With a string argument PROBE defined, the action of "bchpoly" is
390      to calculate the error correcting capability of the BCH code
391      defined by N, K and PRIM and return it in P. This is similar to a
392      call to "bchpoly" with zero or one argument, except that only a
393      single code is checked. Any string value for PROBE will force this
394      action.
395
396      In general the codeword length N can be expressed as `2^M-1',
397      where M is an integer. However, if [N,K] is a valid BCH code, then
398      a shortened BCH code of the form [N-X,K-X] can be created with the
399      same generator polynomial
400
401
402    See also: cyclpoly, encode, decode, cosets
403
404
405
406
407 # name: <cell-element>
408 # type: sq_string
409 # elements: 1
410 # length: 53
411 Calculates the generator polynomials for a BCH coder.
412
413
414
415 # name: <cell-element>
416 # type: sq_string
417 # elements: 1
418 # length: 5
419 bi2de
420
421
422 # name: <cell-element>
423 # type: sq_string
424 # elements: 1
425 # length: 695
426  -- Function File: D =  bi2de (B)
427  -- Function File: D =  bi2de (B,F)
428  -- Function File: D =  bi2de (B,P)
429  -- Function File: D =  bi2de (B,P,F)
430      Convert bit matrix to a vector of integers
431
432      Each row of the matrix B is treated as a single integer represented
433      in binary form. The elements of B, must therefore be '0' or '1'
434
435      If P is defined then it is treated as the base of the decomposition
436      and the elements of B must then lie between '0' and 'p-1'.
437
438      The variable F defines whether the first or last element of B is
439      considered to be the most-significant. Valid values of F are
440      'right-msb' or 'left-msb'. By default F is 'right-msb'.
441
442      See also: de2bi
443
444
445
446
447
448 # name: <cell-element>
449 # type: sq_string
450 # elements: 1
451 # length: 43
452 Convert bit matrix to a vector of integers
453
454
455
456
457 # name: <cell-element>
458 # type: sq_string
459 # elements: 1
460 # length: 6
461 biterr
462
463
464 # name: <cell-element>
465 # type: sq_string
466 # elements: 1
467 # length: 1878
468  -- Function File: [NUM, RATE] =  biterr (A,B)
469  -- Function File: [NUM, RATE] =  biterr (...,K)
470  -- Function File: [NUM, RATE] =  biterr (...,FLAG)
471  -- Function File: [NUM, RATE IND] =  biterr (...)
472      Compares two matrices and returns the number of bit errors and the
473      bit error rate. The binary representations of the variables A and
474      B are treated and A and B can be either:
475
476     Both matrices
477           In this case both matrices must be the same size and then by
478           default the the return values NUM and RATE are the overall
479           number of bit errors and the overall bit error rate.
480
481     One column vector
482           In this case the column vector is used for bit error
483           comparision column-wise with the matrix. The returned values
484           NUM and RATE are then row vectors containing the num of bit
485           errors and the bit error rate for each of the column-wise
486           comparisons. The number of rows in the matrix must be the
487           same as the length of the column vector
488
489     One row vector
490           In this case the row vector is used for bit error comparision
491           row-wise with the matrix. The returned values NUM and RATE
492           are then column vectors containing the num of bit errors and
493           the bit error rate for each of the row-wise comparisons. The
494           number of columns in the matrix must be the same as the
495           length of the row vector
496
497      This behaviour can be overridden with the variable FLAG. FLAG can
498      take the value 'column-wise', 'row-wise' or 'overall'. A
499      column-wise comparision is not possible with a row vector and
500      visa-versa.
501
502      By default the number of bits in each symbol is assumed to be give
503      by the number required to represent the maximum value of A and B.
504      The number of bits to represent a symbol can be overridden by the
505      variable K.
506
507
508
509
510 # name: <cell-element>
511 # type: sq_string
512 # elements: 1
513 # length: 80
514 Compares two matrices and returns the number of bit errors and the bit
515 error rat
516
517
518
519 # name: <cell-element>
520 # type: sq_string
521 # elements: 1
522 # length: 3
523 bsc
524
525
526 # name: <cell-element>
527 # type: sq_string
528 # elements: 1
529 # length: 134
530  -- Function File: Y = bsc (DATA, P)
531      Send DATA into a binary symetric channel with probability P of
532      error one each symbol.
533
534
535
536
537 # name: <cell-element>
538 # type: sq_string
539 # elements: 1
540 # length: 80
541 Send DATA into a binary symetric channel with probability P of error
542 one each sy
543
544
545
546 # name: <cell-element>
547 # type: sq_string
548 # elements: 1
549 # length: 5
550 comms
551
552
553 # name: <cell-element>
554 # type: sq_string
555 # elements: 1
556 # length: 1433
557  -- Function File:  comms ('help')
558  -- Function File:  comms ('info')
559  -- Function File:  comms ('info', MOD)
560  -- Function File:  comms ('test')
561  -- Function File:  comms ('test', MOD)
562      Manual and test code for the Octave Communications toolbox. There
563      are 5 possible ways to call this function.
564
565     `comms ('help')'
566           Display this help message. Called with no arguments, this
567           function also displays this help message
568
569     `comms ('info')'
570           Open the Commumications toolbox manual
571
572     `comms ('info', MOD)'
573           Open the Commumications toolbox manual at the section
574           specified by MOD
575
576     `comms ('test')'
577           Run all of the test code for the Communications toolbox.
578
579     `comms ('test', MOD)'
580           Run only the test code for the Communications toolbox in the
581           module MOD.
582
583      Valid values for the varibale MOD are
584
585     'all'
586           All of the toolbox
587
588     'random'
589           The random signal generation and analysis package
590
591     'source'
592           The source coding functions of the package
593
594     'block'
595           The block coding functions
596
597     'convol'
598           The convolution coding package
599
600     'modulation'
601           The modulation package
602
603     'special'
604           The special filter functions
605
606     'galois'
607           The Galois fields package
608
609      Please note that this function file should be used as an example
610      of the use of this toolbox.
611
612
613
614
615 # name: <cell-element>
616 # type: sq_string
617 # elements: 1
618 # length: 59
619 Manual and test code for the Octave Communications toolbox.
620
621
622
623 # name: <cell-element>
624 # type: sq_string
625 # elements: 1
626 # length: 7
627 compand
628
629
630 # name: <cell-element>
631 # type: sq_string
632 # elements: 1
633 # length: 1154
634  -- Function File: Y =  compand (X, MU, V, 'mu/compressor')
635  -- Function File: Y =  compand (X, MU, V, 'mu/expander')
636  -- Function File: Y =  compand (X, MU, V, 'A/compressor')
637  -- Function File: Y =  compand (X, MU, V, 'A/expander')
638      Compresses and expanding the dynamic range of a signal using a
639      mu-law or or A-law algorithm.
640
641      The mu-law compressor/expander for reducing the dynamic range, is
642      used if the fourth argument of "compand" starts with 'mu/'.
643      Whereas the A-law compressor/expander is used if "compand" starts
644      with 'A/'.  The mu-law algorithm uses the formulation
645
646
647                   V log (1 + \mu/V |x|)
648               y = -------------------- sgn(x)
649                       log (1 + \mu)
650
651      while the A-law algorithm used the formulation
652
653
654                   /    A / (1 + log A) x,               0 <= |x| <= V/A
655                   |
656               y = <    V ( 1 + log (A/V |x|) )
657                   |    ----------------------- sgn(x),  V/A < |x| <= V
658                   \        1 + log A
659
660      Neither converts from or to audio file ulaw format. Use mu2lin or
661      lin2mu instead.
662
663
664    See also: m2ulin, lin2mu
665
666
667
668
669 # name: <cell-element>
670 # type: sq_string
671 # elements: 1
672 # length: 80
673 Compresses and expanding the dynamic range of a signal using a mu-law or
674 or A-la
675
676
677
678 # name: <cell-element>
679 # type: sq_string
680 # elements: 1
681 # length: 7
682 convenc
683
684
685 # name: <cell-element>
686 # type: sq_string
687 # elements: 1
688 # length: 1121
689  -- Function File: X = convenc (M, G, K)
690      Compute output of an (n, K, L) convolutional encoder with vector
691      input M and matrix of generator polynomials G.
692
693      The input vector M can be of arbitrary length. G is a matrix with
694      n rows and K*(L+1) columns. The rows of G are the generator
695      polynomials for each of the n output bits (per K input bits).
696
697      The output is a vector whose length is
698      n*floor([length(M)+K*(L+1)-1]/K).  If unspecified, K defaults to 1.
699
700      Example 1: Compute the output from a (2, 1, 2) convolutional
701      encoder
702           m  = [ 1 1 0 1 1 1 0 0 1 0 0 0];
703           g1 = [1 1 1];
704           g2 = [1 0 1];
705           convenc (m, [g1; g2])
706                => [1 1 0 1 0 1 0 0 0 1 1 0 0 1 1 1 1 1 1 0 1 1 0 0 0 0 0 0]
707
708      Example 2: Compute the output from a (3, 2, 1) convolutional
709      encoder
710           m  = [0 1 1 0 0 0 1 1 ];
711           g1 = [1 0 1 1];
712           g2 = [1 1 0 1];
713           g3 = [1 0 1 0];
714           convenc (m, [g1; g2; g3], 2)
715                => [1 1 1 1 1 1 1 1 0 1 0 1]
716
717      *Caution:*: this function is not compatible with MATLAB's
718      convenc().
719
720
721
722
723 # name: <cell-element>
724 # type: sq_string
725 # elements: 1
726 # length: 80
727 Compute output of an (n, K, L) convolutional encoder with vector input
728 M and mat
729
730
731
732 # name: <cell-element>
733 # type: sq_string
734 # elements: 1
735 # length: 6
736 cosets
737
738
739 # name: <cell-element>
740 # type: sq_string
741 # elements: 1
742 # length: 209
743  -- Function File:  cosets (M, PRIM)
744      Finds the elements of GF(2^M) with primitive polynomial PRIM, that
745      share the same minimum polynomial. Returns a cell array of the
746      paratitioning of GF(2^M).
747
748
749
750
751 # name: <cell-element>
752 # type: sq_string
753 # elements: 1
754 # length: 80
755 Finds the elements of GF(2^M) with primitive polynomial PRIM, that
756 share the sam
757
758
759
760 # name: <cell-element>
761 # type: sq_string
762 # elements: 1
763 # length: 5
764 de2bi
765
766
767 # name: <cell-element>
768 # type: sq_string
769 # elements: 1
770 # length: 1082
771  -- Function File: B =  de2bi (D)
772  -- Function File: B =  de2bi (D,N)
773  -- Function File: B =  de2bi (D,N,P)
774  -- Function File: B =  de2bi (D,N,P,F)
775      Convert a non-negative integer to bit vector.
776
777      The variable D must be a vector of non-negative integers. "de2bi"
778      then returns a matrix where each row represents the binary
779      representation of elements of D. If N is defined then the returned
780      matrix will have N columns. This number of columns can be either
781      larger than the minimum needed and zeros will be added to the msb
782      of the binary representation or smaller than the minimum in which
783      case the least-significant part of the element is returned.
784
785      If P is defined then it is used as the base for the decomposition
786      of the returned values. That is the elements of the returned value
787      are between '0' and 'p-1'.
788
789      The variable F defines whether the first or last element of B is
790      considered to be the most-significant. Valid values of F are
791      'right-msb' or 'left-msb'. By default F is 'right-msb'.
792
793      See also: bi2de
794
795
796
797
798
799 # name: <cell-element>
800 # type: sq_string
801 # elements: 1
802 # length: 45
803 Convert a non-negative integer to bit vector.
804
805
806
807 # name: <cell-element>
808 # type: sq_string
809 # elements: 1
810 # length: 6
811 decode
812
813
814 # name: <cell-element>
815 # type: sq_string
816 # elements: 1
817 # length: 4528
818  -- Function File: MSG = decode (CODE,N,K)
819  -- Function File: MSG = decode (CODE,N,K,TYP)
820  -- Function File: MSG = decode (CODE,N,K,TYP,OPT1)
821  -- Function File: MSG = decode (CODE,N,K,TYP,OPT1,OPT2)
822  -- Function File: [MSG, ERR] = decode (...)
823  -- Function File: [MSG, ERR, CCODE] = decode (...)
824  -- Function File: [MSG, ERR, CCODE, CERR] = decode (...)
825      Top level block decoder. This function makes use of the lower level
826      functions such as "cyclpoly", "cyclgen", "hammgen", and "bchenco".
827      The coded message to decode is pass in CODE, the codeword length
828      is N and the message length is K. This function is used to decode
829      messages using either:
830
831     A [n,k] linear block code defined by a generator matrix
832
833     A [n,k] cyclic code defined by a generator polynomial
834
835     A [n,k] Hamming code defined by a primitive polynomial
836
837     A [n,k] BCH code code defined by a generator polynomial
838
839      The type of coding to use is defined by the variable TYP. This
840      variable is a string taking one of the values
841
842     `'linear' or 'linear/binary''
843           A linear block code is assumed with the message MSG being in a
844           binary format. In this case the argument OPT1 is the generator
845           matrix, and is required. Additionally, OPT2 containing the
846           syndrome lookup table (see "syndtable") can also be passed.
847
848     `'cyclic' or 'cyclic/binary''
849           A cyclic code is assumed with the message MSG being in a
850           binary format. The generator polynomial to use can be defined
851           in OPT1.  The default generator polynomial to use will be
852           "cyclpoly(N,K)". Additionally, OPT2 containing the syndrome
853           lookup table (see "syndtable") can also be passed.
854
855     `'hamming' or 'hamming/binary''
856           A Hamming code is assumed with the message MSG being in a
857           binary format. In this case N must be of an integer of the
858           form `2^M-1', where M is an integer. In addition K must be
859           `N-M'. The primitive polynomial to use can be defined in
860           OPT1. The default primitive polynomial to use is the same as
861           defined by "hammgen". The variable OPT2 should not be defined.
862
863     `'bch' or 'bch/binary''
864           A BCH code is assumed with the message MSG being in a binary
865           format. The primitive polynomial to use can be defined in
866           OPT2.  The error correction capability of the code can also
867           be defined in OPT1. Use the empty matrix [] to let the error
868           correction capability take the default value.
869
870      In addition the argument 'binary' above can be replaced with
871      'decimal', in which case the message is assumed to be a decimal
872      vector, with each value representing a symbol to be coded. The
873      binary format can be in two forms
874
875     `An X-by-N matrix'
876           Each row of this matrix represents a symbol to be decoded
877
878     `A vector with length divisible by N'
879           The coded symbols are created from groups of N elements of
880           this vector
881
882      The decoded message is return in MSG. The number of errors
883      encountered is returned in ERR. If the coded message format is
884      'decimal' or a 'binary' matrix, then ERR is a column vector having
885      a length equal to the number of decoded symbols. If CODE is a
886      'binary' vector, then ERR is the same length as MSG and indicated
887      the number of errors in each symbol. If the value ERR is positive
888      it indicates the number of errors corrected in the corresponding
889      symbol. A negative value indicates an uncorrectable error. The
890      corrected code is returned in CCODE in a similar format to the
891      coded message MSG. The variable CERR contains similar data to ERR
892      for CCODE.
893
894      It should be noted that all internal calculations are performed in
895      the binary format. Therefore for large values of N, it is
896      preferable to use the binary format to pass the messages to avoid
897      possible rounding errors. Additionally, if repeated calls to
898      "decode" will be performed, it is often faster to create a
899      generator matrix externally with the functions "hammgen" or
900      "cyclgen", rather than let "decode" recalculate this matrix at
901      each iteration. In this case TYP should be 'linear'. The exception
902      to this case is BCH codes, where the required syndrome table is
903      too large. The BCH decoder, decodes directly from the polynomial
904      never explicitly forming the syndrome table.
905
906
907    See also: encode, cyclgen, cyclpoly, hammgen, bchdeco, bchpoly,
908 syndtable
909
910
911
912
913 # name: <cell-element>
914 # type: sq_string
915 # elements: 1
916 # length: 24
917 Top level block decoder.
918
919
920
921 # name: <cell-element>
922 # type: sq_string
923 # elements: 1
924 # length: 8
925 deintrlv
926
927
928 # name: <cell-element>
929 # type: sq_string
930 # elements: 1
931 # length: 135
932  -- Function File: DEINTRLVD = deintrlv (DATA, ELEMENTS)
933      Restore elements of DATA according to ELEMENTS.
934
935      See also: intrlv
936
937
938
939
940
941 # name: <cell-element>
942 # type: sq_string
943 # elements: 1
944 # length: 47
945 Restore elements of DATA according to ELEMENTS.
946
947
948
949 # name: <cell-element>
950 # type: sq_string
951 # elements: 1
952 # length: 8
953 demodmap
954
955
956 # name: <cell-element>
957 # type: sq_string
958 # elements: 1
959 # length: 2342
960  -- Function File: z =  demodmap (Y,FD,FS,'ask',M)
961  -- Function File: z =  demodmap (Y,FD,FS,'fsk',M,TONE)
962  -- Function File: z =  demodmap (Y,FD,FS,'msk')
963  -- Function File: z =  demodmap (Y,FD,FS,'psk',M)
964  -- Function File: z =  demodmap (Y,FD,FS,'qask',M)
965  -- Function File: z =  demodmap (Y,FD,FS,'qask/cir',NSIG,AMP,PHS)
966  -- Function File: z =  demodmap (Y,FD,FS,'qask/arb',INPHASE,QUADR)
967  -- Function File: z =  demodmap (Y,FD,FS,'qask/arb',MAP)
968  -- Function File: z =  demodmap (Y,[FD, OFF],...)
969      Demapping of an analog signal to a digital signal. The function
970      "demodmap" must have at least three input arguments and one output
971      argument. Argument Y is a complex variable representing the analog
972      signal to be demapped. The variables FD and FS are the sampling
973      rate of the of digital signal and the sampling rate of the analog
974      signal respectively. It is required that `FS/FD' is an integer.
975
976      The available mapping of the digital signal are
977
978     'ask'
979           Amplitude shift keying
980
981     'fsk'
982           Frequency shift keying
983
984     'msk'
985           Minimum shift keying
986
987     'psk'
988           Phase shift keying
989
990     'qask'
991     'qsk'
992     'qam'
993           Quadraure amplitude shift keying
994
995      In addition the 'qask', 'qsk' and 'qam' method can be modified
996      with the flags '/cir' or '/arb'. That is 'qask/cir' and
997      'qask/arb', etc are valid methods and give circular- and
998      arbitrary-qask mappings respectively. Also the method 'fsk' and
999      'msk' can be modified with the flag '/max', in which case Y is
1000      assumed to be a matrix with M columns, representing the symbol
1001      correlations.
1002
1003      The variable M is the order of the modulation to use. By default
1004      this is 2, and in general should be specified.
1005
1006      For 'qask/cir', the additional arguments are the same as for
1007      "apkconst", and you are referred to "apkconst" for the definitions
1008      of the additional variables.
1009
1010      For 'qask/arb', the additional arguments INPHASE and QUADR give
1011      the in-phase and quadrature components of the mapping, in a
1012      similar mapping to the outputs of "qaskenco" with one argument.
1013      Similar MAP represents the in-phase and quadrature components of
1014      the mapping as the real and imaginary parts of the variable MAP.
1015
1016    See also: modmap, ddemodce, ademodce, apkconst, qaskenco
1017
1018
1019
1020
1021 # name: <cell-element>
1022 # type: sq_string
1023 # elements: 1
1024 # length: 50
1025 Demapping of an analog signal to a digital signal.
1026
1027
1028
1029 # name: <cell-element>
1030 # type: sq_string
1031 # elements: 1
1032 # length: 9
1033 egolaydec
1034
1035
1036 # name: <cell-element>
1037 # type: sq_string
1038 # elements: 1
1039 # length: 1044
1040  -- Function File:  egolaydec (R)
1041      Given R, the received Extended Golay code, this function tries to
1042      decode R using the Extended Golay code parity check matrix.
1043      Extended Golay code (24,12) which can correct upto 3 errors.
1044
1045      The received code R, needs to be of length Nx24, for encoding. We
1046      can decode several codes at once, if they are stacked as a matrix
1047      of 24columns, each code in a separate row.
1048
1049      The generator G used in here is same as obtained from the function
1050      egolaygen.
1051
1052      The function returns the error-corrected code word from the
1053      received word. If decoding failed, the second return value is 1,
1054      otherwise it is 0.
1055
1056      Extended Golay code (24,12) which can correct upto 3 errors.
1057      Decoding algorithm follows from Lin & Costello.
1058
1059      Ref: Lin & Costello, pg 128, Ch4, 'Error Control Coding', 2nd ed,
1060      Pearson.
1061
1062            M=[rand(10,12)>0.5];
1063            C1=egolayenc(M);
1064            C1(:,1)=mod(C1(:,1)+1,2)
1065            C2=egolaydec(C1)
1066
1067
1068    See also: egolaygen, egolayenc
1069
1070
1071
1072
1073 # name: <cell-element>
1074 # type: sq_string
1075 # elements: 1
1076 # length: 80
1077 Given R, the received Extended Golay code, this function tries to
1078 decode R using
1079
1080
1081
1082 # name: <cell-element>
1083 # type: sq_string
1084 # elements: 1
1085 # length: 9
1086 egolayenc
1087
1088
1089 # name: <cell-element>
1090 # type: sq_string
1091 # elements: 1
1092 # length: 505
1093  -- Function File:  egolayenc (M)
1094      Given M, encode M using the Extended Golay code.
1095
1096      The message M, needs to be of size Nx12, for encoding.  We can
1097      encode several messages, into codes at once, if they are stacked
1098      in the order suggested.
1099
1100      The generator G used in here is same as obtained from the function
1101      egolaygen. Extended Golay code (24,12) which can correct upto 3
1102      errors.
1103
1104           M=(rand(10,12)>0.5);
1105           C=egolayenc(M)
1106
1107
1108    See also: egolaygen, egolaydec
1109
1110
1111
1112
1113 # name: <cell-element>
1114 # type: sq_string
1115 # elements: 1
1116 # length: 48
1117 Given M, encode M using the Extended Golay code.
1118
1119
1120
1121 # name: <cell-element>
1122 # type: sq_string
1123 # elements: 1
1124 # length: 9
1125 egolaygen
1126
1127
1128 # name: <cell-element>
1129 # type: sq_string
1130 # elements: 1
1131 # length: 239
1132  -- Function File:  egolaygen ()
1133      Returns the Extended Golay code (24,12) generator matrix, which
1134      can correct upto 3 errors. The second argument is the partiy check
1135      matrix, for this code.
1136
1137
1138    See also: egolaydec, egolayenc
1139
1140
1141
1142
1143 # name: <cell-element>
1144 # type: sq_string
1145 # elements: 1
1146 # length: 80
1147 Returns the Extended Golay code (24,12) generator matrix, which can
1148 correct upto
1149
1150
1151
1152 # name: <cell-element>
1153 # type: sq_string
1154 # elements: 1
1155 # length: 6
1156 encode
1157
1158
1159 # name: <cell-element>
1160 # type: sq_string
1161 # elements: 1
1162 # length: 3341
1163  -- Function File: CODE = encode (MSG,N,K)
1164  -- Function File: CODE = encode (MSG,N,K,TYP)
1165  -- Function File: CODE = encode (MSG,N,K,TYP,OPT)
1166  -- Function File: [CODE, ADDED] = encode (...)
1167      Top level block encoder. This function makes use of the lower level
1168      functions such as "cyclpoly", "cyclgen", "hammgen", and "bchenco".
1169      The message to code is pass in MSG, the codeword length is N and
1170      the message length is K. This function is used to encode messages
1171      using either:
1172
1173     A [n,k] linear block code defined by a generator matrix
1174
1175     A [n,k] cyclic code defined by a generator polynomial
1176
1177     A [n,k] Hamming code defined by a primitive polynomial
1178
1179     A [n,k] BCH code code defined by a generator polynomial
1180
1181      The type of coding to use is defined by the variable TYP. This
1182      variable is a string taking one of the values
1183
1184     `'linear' or 'linear/binary''
1185           A linear block code is assumed with the coded message CODE
1186           being in a binary format. In this case the argument OPT is
1187           the generator matrix, and is required.
1188
1189     `'cyclic' or 'cyclic/binary''
1190           A cyclic code is assumed with the coded message CODE being in
1191           a binary format. The generator polynomial to use can be
1192           defined in OPT.  The default generator polynomial to use will
1193           be "cyclpoly(N,K)"
1194
1195     `'hamming' or 'hamming/binary''
1196           A Hamming code is assumed with the coded message CODE being
1197           in a binary format. In this case N must be of an integer of
1198           the form `2^M-1', where M is an integer. In addition K must
1199           be `N-M'. The primitive polynomial to use can be defined in
1200           OPT. The default primitive polynomial to use is the same as
1201           defined by "hammgen".
1202
1203     `'bch' or 'bch/binary''
1204           A BCH code is assumed with the coded message CODE being in a
1205           binary format. The generator polynomial to use can be defined
1206           in OPT.  The default generator polynomial to use will be
1207           "bchpoly(N,K)"
1208
1209      In addition the argument 'binary' above can be replaced with
1210      'decimal', in which case the message is assumed to be a decimal
1211      vector, with each value representing a symbol to be coded. The
1212      binary format can be in two forms
1213
1214     `An X-by-K matrix'
1215           Each row of this matrix represents a symbol to be coded
1216
1217     `A vector'
1218           The symbols are created from groups of K elements of this
1219           vector.  If the vector length is not divisble by K, then
1220           zeros are added and the number of zeros added is returned in
1221           ADDED.
1222
1223      It should be noted that all internal calculations are performed in
1224      the binary format. Therefore for large values of N, it is
1225      preferable to use the binary format to pass the messages to avoid
1226      possible rounding errors. Additionally, if repeated calls to
1227      "encode" will be performed, it is often faster to create a
1228      generator matrix externally with the functions "hammgen" or
1229      "cyclgen", rather than let "encode" recalculate this matrix at
1230      each iteration. In this case TYP should be 'linear'. The exception
1231      to this case is BCH codes, whose encoder is implemented directly
1232      from the polynomial and is significantly faster.
1233
1234
1235    See also: decode, cyclgen, cyclpoly, hammgen, bchenco, bchpoly
1236
1237
1238
1239
1240 # name: <cell-element>
1241 # type: sq_string
1242 # elements: 1
1243 # length: 24
1244 Top level block encoder.
1245
1246
1247
1248 # name: <cell-element>
1249 # type: sq_string
1250 # elements: 1
1251 # length: 10
1252 eyediagram
1253
1254
1255 # name: <cell-element>
1256 # type: sq_string
1257 # elements: 1
1258 # length: 1488
1259  -- Function File:  eyediagram (X,N)
1260  -- Function File:  eyediagram (X,N,PER)
1261  -- Function File:  eyediagram (X,N,PER,OFF)
1262  -- Function File:  eyediagram (X,N,PER,OFF,STR)
1263  -- Function File:  eyediagram (X,N,PER,OFF,STR,H)
1264  -- Function File: H = eyediagram (...)
1265      Plot the eye-diagram of a signal. The signal X can be either in one
1266      of three forms
1267
1268     A real vector
1269           In this case the signal is assumed to be real and represented
1270           by the vector X. A single eye-diagram representing this
1271           signal is plotted.
1272
1273     A complex vector
1274           In this case the in-phase and quadrature components of the
1275           signal are plotted seperately.
1276
1277     A matrix with two columns
1278           In this case the first column represents the in-phase and the
1279           second the quadrature components of a complex signal.
1280
1281      Each line of the eye-diagram has N elements and the period is
1282      assumed to be given by PER. The time axis is then [-PER/2 PER/2].
1283      By default PER is 1.
1284
1285      By default the signal is assumed to start at -PER/2. This can be
1286      overridden by the OFF variable, which gives the number of samples
1287      to delay the signal.
1288
1289      The string STR is a plot style string (example 'r+'), and by
1290      default is the default gnuplot line style.
1291
1292      The figure handle to use can be defined by H. If H is not given,
1293      then the next available figure handle is used. The figure handle
1294      used in returned on HOUT.
1295
1296    See also: scatterplot
1297
1298
1299
1300
1301 # name: <cell-element>
1302 # type: sq_string
1303 # elements: 1
1304 # length: 33
1305 Plot the eye-diagram of a signal.
1306
1307
1308
1309 # name: <cell-element>
1310 # type: sq_string
1311 # elements: 1
1312 # length: 8
1313 fibodeco
1314
1315
1316 # name: <cell-element>
1317 # type: sq_string
1318 # elements: 1
1319 # length: 860
1320  -- Function File:   fibodeco (CODE)
1321      Returns the decoded fibonacci value from the binary vectors CODE.
1322      Universal codes like fibonacci codes Have a useful synchronization
1323      property, only for 255 maximum value we have designed these
1324      routines. We assume user has partitioned the code into several
1325      unique segments based on the suffix property of unique strings
1326      "11" and we just decode the parts. Partitioning the stream is as
1327      simple as identifying the "11" pairs that occur, at the
1328      terminating ends. This system implements the standard binaary
1329      Fibonacci codes, which means that row vectors can only contain 0
1330      or 1. Ref: `http://en.wikipedia.org/wiki/Fibonacci_coding'
1331
1332               fibodeco({[0 1 0 0 1 1]}) %decoded to 10
1333               fibodeco({[1 1],[0 1 1],[0 0 1 1],[1 0 1 1]}) %[1:4]
1334
1335    See also: fiboenco
1336
1337
1338
1339
1340 # name: <cell-element>
1341 # type: sq_string
1342 # elements: 1
1343 # length: 65
1344 Returns the decoded fibonacci value from the binary vectors CODE.
1345
1346
1347
1348 # name: <cell-element>
1349 # type: sq_string
1350 # elements: 1
1351 # length: 8
1352 fiboenco
1353
1354
1355 # name: <cell-element>
1356 # type: sq_string
1357 # elements: 1
1358 # length: 1121
1359  -- Function File:  fiboenco (NUM)
1360      Returns the cell-array of encoded fibonacci value from the column
1361      vectors NUM.  Universal codes like fibonacci codes have a useful
1362      synchronization property, only for 255 maximum value we have
1363      designed these routines. We assume user has partitioned the code
1364      into several unique segments based on the suffix property of
1365      unique elements [1 1] and we just decode the parts. Partitioning
1366      the stream is as simple as identifying the [1 1] pairs that occur,
1367      at the terminating ends. This system implements the standard
1368      binaary Fibonacci codes, which means that row vectors can only
1369      contain 0 or 1. Ref: http://en.wikipedia.org/wiki/Fibonacci_coding
1370      Ugly O(k.N^2) encoder.Ref: Wikipedia article accessed March, 2006.
1371      `http://en.wikipedia.org/wiki/Fibonacci_coding',  UCI Data
1372      Compression Book, `http://www.ics.uci.edu/~dan/pubs/DC-Sec3.html',
1373      (accessed October 2006)
1374
1375                fiboenco(10) #=  code is {[ 0 1 0 0 1 1]}
1376                fiboenco(1:4) #= code is {[1 1],[0 1 1],[0 0 1 1],[1 0 1 1]}
1377
1378    See also: fibodeco
1379
1380
1381
1382
1383 # name: <cell-element>
1384 # type: sq_string
1385 # elements: 1
1386 # length: 78
1387 Returns the cell-array of encoded fibonacci value from the column
1388 vectors NUM.
1389
1390
1391
1392 # name: <cell-element>
1393 # type: sq_string
1394 # elements: 1
1395 # length: 15
1396 fibosplitstream
1397
1398
1399 # name: <cell-element>
1400 # type: sq_string
1401 # elements: 1
1402 # length: 727
1403  -- Function File:   fibosplitstream (CODE)
1404      Returns the split data stream at the word boundaries.  Assuming
1405      the stream was originally encoded using `fiboenco' and this
1406      routine splits the stream at the points where '11' occur together
1407      & gives us the code-words which can later be decoded from the
1408      `fibodeco' This however doesnt mean that we intend to verify if
1409      all the codewords are correct, and infact the last symbol in th
1410      return list can or can-not be a valid codeword.
1411
1412      A example use of `fibosplitstream' would be
1413
1414           fibodeco(fibosplitstream([fiboenco(randint(1,100,[0 255])){:}]))
1415           fibodeco(fibosplitstream([fiboenco(1:10){:}]))
1416
1417      See also: fiboenco, fibodeco
1418
1419
1420
1421
1422
1423 # name: <cell-element>
1424 # type: sq_string
1425 # elements: 1
1426 # length: 53
1427 Returns the split data stream at the word boundaries.
1428
1429
1430
1431 # name: <cell-element>
1432 # type: sq_string
1433 # elements: 1
1434 # length: 7
1435 fmdemod
1436
1437
1438 # name: <cell-element>
1439 # type: sq_string
1440 # elements: 1
1441 # length: 192
1442  -- Function File: fmdemod (X,FC,FS)
1443      Create the FM demodulation of the signal x with carrier frequency
1444      fs. Where x is sample at frequency fs.
1445
1446      See also: ammod, amdemod, fmmod
1447
1448
1449
1450
1451
1452 # name: <cell-element>
1453 # type: sq_string
1454 # elements: 1
1455 # length: 69
1456 Create the FM demodulation of the signal x with carrier frequency fs.
1457
1458
1459
1460 # name: <cell-element>
1461 # type: sq_string
1462 # elements: 1
1463 # length: 5
1464 fmmod
1465
1466
1467 # name: <cell-element>
1468 # type: sq_string
1469 # elements: 1
1470 # length: 190
1471  -- Function File: fmmod (X,FC,FS)
1472      Create the FM modulation of the signal x with carrier frequency
1473      fs. Where x is sample at frequency fs.
1474
1475      See also: ammod, fmdemod, amdemod
1476
1477
1478
1479
1480
1481 # name: <cell-element>
1482 # type: sq_string
1483 # elements: 1
1484 # length: 67
1485 Create the FM modulation of the signal x with carrier frequency fs.
1486
1487
1488
1489 # name: <cell-element>
1490 # type: sq_string
1491 # elements: 1
1492 # length: 7
1493 gen2par
1494
1495
1496 # name: <cell-element>
1497 # type: sq_string
1498 # elements: 1
1499 # length: 436
1500  -- Function File: PAR = gen2par (GEN)
1501  -- Function File: GEN = gen2par (PAR)
1502      Converts binary generator matrix GEN to the parity chack matrix
1503      PAR and visa-versa. The input matrix must be in standard form.
1504      That is a generator matrix must be k-by-n and in the form [eye(k)
1505      P] or [P eye(k)], and the parity matrix must be (n-k)-by-n and of
1506      the form [eye(n-k) P'] or [P' eye(n-k)].
1507
1508
1509    See also: cyclgen, hammgen
1510
1511
1512
1513
1514 # name: <cell-element>
1515 # type: sq_string
1516 # elements: 1
1517 # length: 80
1518 Converts binary generator matrix GEN to the parity chack matrix PAR and
1519 visa-ver
1520
1521
1522
1523 # name: <cell-element>
1524 # type: sq_string
1525 # elements: 1
1526 # length: 11
1527 genqamdemod
1528
1529
1530 # name: <cell-element>
1531 # type: sq_string
1532 # elements: 1
1533 # length: 158
1534  -- Function File: [Z] = genqamdemod(Y,CONST)
1535         Compute the general quadrature amplitude demodulation of y.
1536
1537      See also: genqammod, qammod, qamdemod
1538
1539
1540
1541
1542
1543 # name: <cell-element>
1544 # type: sq_string
1545 # elements: 1
1546 # length: 60
1547         Compute the general quadrature amplitude demodulation of y.
1548
1549
1550
1551 # name: <cell-element>
1552 # type: sq_string
1553 # elements: 1
1554 # length: 9
1555 genqammod
1556
1557
1558 # name: <cell-element>
1559 # type: sq_string
1560 # elements: 1
1561 # length: 556
1562  -- Function File: Y = genqammod (X, C)
1563      Modulates an information sequence of intergers X in the range `[0
1564      ... M-1]' onto a quadrature amplitude modulated signal Y, where
1565      `M = length(c) - 1' and C is a 1D vector specifing the signal
1566      constellation mapping to be used. An example of combined 4PAM-4PSK
1567      is
1568
1569            d = randint(1,1e4,8);
1570            c = [1+j -1+j -1-j 1-j 1+sqrt(3) j*(1+sqrt(3)) -1-sqrt(3) -j*(1+sqrt(3))];
1571            y = genqammod(d,c);
1572            z = awgn(y,20);
1573            plot(z,'rx')
1574
1575    See also: genqamdemod
1576
1577
1578
1579
1580 # name: <cell-element>
1581 # type: sq_string
1582 # elements: 1
1583 # length: 67
1584 Modulates an information sequence of intergers X in the range `[0 .
1585
1586
1587
1588 # name: <cell-element>
1589 # type: sq_string
1590 # elements: 1
1591 # length: 7
1592 gftable
1593
1594
1595 # name: <cell-element>
1596 # type: sq_string
1597 # elements: 1
1598 # length: 265
1599  -- Function File:  gftable (M, PRIMPOLY)
1600      This function exists for compatiability with matlab. As the octave
1601      galois fields store a copy of the lookup tables for every field in
1602      use internally, there is no need to use this function.
1603
1604
1605    See also: gf
1606
1607
1608
1609
1610 # name: <cell-element>
1611 # type: sq_string
1612 # elements: 1
1613 # length: 52
1614 This function exists for compatiability with matlab.
1615
1616
1617
1618 # name: <cell-element>
1619 # type: sq_string
1620 # elements: 1
1621 # length: 8
1622 gfweight
1623
1624
1625 # name: <cell-element>
1626 # type: sq_string
1627 # elements: 1
1628 # length: 820
1629  -- Function File: W =  gfweight (GEN)
1630  -- Function File: W =  gfweight (GEN,'gen')
1631  -- Function File: W =  gfweight (PAR,'par')
1632  -- Function File: W =  gfweight (P,n)
1633      Calculate the minimum weight or distance of a linear block code.
1634      The code can be either defined by its generator or parity check
1635      matrix, or its generator polynomial. By default if the first
1636      argument is a matrix, it is assumed to be the generator matrix of
1637      the code. The type of the matrix can be defined by a flag 'gen'
1638      for the generator matrix or 'par' for the parity check matrix.
1639
1640      If the first argument is a vector, it is assumed that it defines
1641      the generator polynomial of the code. In this case a second
1642      argument is required that defines the codeword length.
1643
1644
1645    See also: hammgen, cyclpoly, bchpoly
1646
1647
1648
1649
1650 # name: <cell-element>
1651 # type: sq_string
1652 # elements: 1
1653 # length: 64
1654 Calculate the minimum weight or distance of a linear block code.
1655
1656
1657
1658 # name: <cell-element>
1659 # type: sq_string
1660 # elements: 1
1661 # length: 10
1662 golombdeco
1663
1664
1665 # name: <cell-element>
1666 # type: sq_string
1667 # elements: 1
1668 # length: 931
1669  -- Function File:  golombdeco (CODE, M)
1670      Returns the Golomb decoded signal vector using CODE and M.
1671      Compulsory m is need to be specified. A restrictions is that a
1672      signal set must strictly be non-negative. The value of code is a
1673      cell array of row-vectors which have the  encoded golomb value for
1674      a single sample. The Golomb algorithm is,  used to encode the
1675      'code' and only that can be meaningfully decoded. CODE is assumed
1676      to have been of format generated by the function `golombenco'.
1677      Also the parameter M need to be a non-zero number, unless which it
1678      makes divide-by-zero errors.  This function works backward the
1679      Golomb algorithm see `golombenco' for more detials on that.
1680      Reference: Solomon Golomb, Run length Encodings, 1966 IEEE Trans
1681      Info' Theory
1682
1683      An exmaple of the use of `golombdeco' is
1684             golombdeco(golombenco(1:4,2),2)
1685
1686    See also: golombenco
1687
1688
1689
1690
1691 # name: <cell-element>
1692 # type: sq_string
1693 # elements: 1
1694 # length: 58
1695 Returns the Golomb decoded signal vector using CODE and M.
1696
1697
1698
1699 # name: <cell-element>
1700 # type: sq_string
1701 # elements: 1
1702 # length: 10
1703 golombenco
1704
1705
1706 # name: <cell-element>
1707 # type: sq_string
1708 # elements: 1
1709 # length: 1615
1710  -- Function File:  golombenco (SIG, M)
1711      Returns the Golomb coded signal as cell array.  Also  total length
1712      of output code in bits can be obtained.  This function uses a M
1713      need to be supplied for encoding signal vector into a golomb coded
1714      vector. A restrictions is that a signal set must strictly be
1715      non-negative.  Also the parameter M need to be a non-zero number,
1716      unless which it makes divide-by-zero errors.  The Golomb algorithm
1717      [1], is used to encode the data into unary coded quotient part
1718      which is represented as a set of 1's separated from the K-part
1719      (binary) using a zero. This scheme doesnt need any kind of
1720      dictionaries, it is a parameterized prefix codes.  Implementation
1721      is close to O(N^2), but this implementation *may be* sluggish,
1722      though correct.  Details of the scheme are, to encode the
1723      remainder(r of number N) using the floor(log2(m)) bits when rem is
1724      in range 0:(2^ceil(log2(m)) - N), and encode it as
1725      r+(2^ceil(log2(m)) - N), using total of 2^ceil(log2(m)) bits in
1726      other instance it doesnt belong to case 1. Quotient is coded
1727      simply just using the unary code. Also accroding to [2] Golomb
1728      codes are optimal for sequences using the bernoulli probability
1729      model: P(n)=p^n-1.q & p+q=1, and when M=[1/log2(p)], or P=2^(1/M).
1730
1731      Reference: 1. Solomon Golomb, Run length Encodings, 1966 IEEE Trans
1732      Info' Theory. 2. Khalid Sayood, Data Compression, 3rd Edition
1733
1734      An exmaple of the use of `golombenco' is
1735             golombenco(1:4,2) #
1736             golombenco(1:10,2) #
1737
1738    See also: golombdeco
1739
1740
1741
1742
1743 # name: <cell-element>
1744 # type: sq_string
1745 # elements: 1
1746 # length: 46
1747 Returns the Golomb coded signal as cell array.
1748
1749
1750
1751 # name: <cell-element>
1752 # type: sq_string
1753 # elements: 1
1754 # length: 7
1755 hammgen
1756
1757
1758 # name: <cell-element>
1759 # type: sq_string
1760 # elements: 1
1761 # length: 784
1762  -- Function File: H =  hammgen (M)
1763  -- Function File: H =  hammgen (M,P)
1764  -- Function File: [H,G] =  hammgen (...)
1765  -- Function File: [H,G,N,K] =  hammgen (...)
1766      Produce the parity check and generator matrices of a Hamming code.
1767      The variable M defines the [N,K] Hamming code where `N = 2 ^ M -
1768      1' and `K = N - M'.  M must be between 3 and 16.
1769
1770      The parity check matrix is generated relative to the primitive
1771      polynomial of GF(2^M). If P is specified the default primitive
1772      polynomial of GF(2^M) is overridden. P must be a valid primitive
1773      polynomial of the correct order for GF(2^M).
1774
1775      The parity check matrix is returned in the M by N matrix H, and if
1776      requested the generator matrix is returned in the K by N matrix G.
1777
1778
1779    See also: gen2par
1780
1781
1782
1783
1784 # name: <cell-element>
1785 # type: sq_string
1786 # elements: 1
1787 # length: 66
1788 Produce the parity check and generator matrices of a Hamming code.
1789
1790
1791
1792 # name: <cell-element>
1793 # type: sq_string
1794 # elements: 1
1795 # length: 9
1796 helintrlv
1797
1798
1799 # name: <cell-element>
1800 # type: sq_string
1801 # elements: 1
1802 # length: 109
1803  -- Function File: OUTDATA = helintrlv (DATA, COL, NGRP,STP)
1804      COL-by-NGRP.
1805
1806      See also: heldeintrlv
1807
1808
1809
1810
1811
1812 # name: <cell-element>
1813 # type: sq_string
1814 # elements: 1
1815 # length: 12
1816 COL-by-NGRP.
1817
1818
1819
1820 # name: <cell-element>
1821 # type: sq_string
1822 # elements: 1
1823 # length: 15
1824 helscandeintrlv
1825
1826
1827 # name: <cell-element>
1828 # type: sq_string
1829 # elements: 1
1830 # length: 128
1831  -- Function File: OUTDATA = helscandeintrlv (DATA, NROWS, NCOLS,NSHIFT)
1832      NROWS-by-NCOLS.
1833
1834      See also: helscandeintrlv
1835
1836
1837
1838
1839
1840 # name: <cell-element>
1841 # type: sq_string
1842 # elements: 1
1843 # length: 15
1844 NROWS-by-NCOLS.
1845
1846
1847
1848 # name: <cell-element>
1849 # type: sq_string
1850 # elements: 1
1851 # length: 13
1852 helscanintrlv
1853
1854
1855 # name: <cell-element>
1856 # type: sq_string
1857 # elements: 1
1858 # length: 126
1859  -- Function File: OUTDATA = helscanintrlv (DATA, NROWS, NCOLS,NSHIFT)
1860      NROWS-by-NCOLS.
1861
1862      See also: helscandeintrlv
1863
1864
1865
1866
1867
1868 # name: <cell-element>
1869 # type: sq_string
1870 # elements: 1
1871 # length: 15
1872 NROWS-by-NCOLS.
1873
1874
1875
1876 # name: <cell-element>
1877 # type: sq_string
1878 # elements: 1
1879 # length: 11
1880 huffmandeco
1881
1882
1883 # name: <cell-element>
1884 # type: sq_string
1885 # elements: 1
1886 # length: 893
1887  -- Function File: SIG = huffmandeco (HCODE, DICT)
1888      Decode signal encoded by `huffmanenco'.
1889
1890      This function uses a dict built from the `huffmandict' and uses it
1891      to decode a signal list into a huffman list. A restriction is that
1892      HCODE is expected to be a binary code
1893
1894      The returned SIG set that strictly belongs in the range `[1,N]'
1895      with `N = length(DICT)'. Also DICT can only be from the
1896      `huffmandict' routine. Whenever decoding fails, those signal
1897      values a re indicated by `-1', and we successively try to restart
1898      decoding from the next bit that hasn't failed in decoding,
1899      ad-infinitum. An example of the use of `huffmandeco' is:
1900
1901           hd    = huffmandict (1:4, [0.5 0.25 0.15 0.10]);
1902           hcode = huffmanenco (1:4, hd);
1903           back  = huffmandeco (hcode, hd)
1904                 => [1 2 3 4]
1905
1906      See also: huffmandict, huffmanenco
1907
1908
1909
1910
1911
1912 # name: <cell-element>
1913 # type: sq_string
1914 # elements: 1
1915 # length: 39
1916 Decode signal encoded by `huffmanenco'.
1917
1918
1919
1920 # name: <cell-element>
1921 # type: sq_string
1922 # elements: 1
1923 # length: 11
1924 huffmandict
1925
1926
1927 # name: <cell-element>
1928 # type: sq_string
1929 # elements: 1
1930 # length: 1497
1931  -- Function File:  huffmandict (SYMB, PROB)
1932  -- Function File:  huffmandict (SYMB, PROB, TOGGLE)
1933  -- Function File:  huffmandict (SYMB, PROB, TOGGLE, MINVAR)
1934      Builds a Huffman code, given a probability list. The Huffman codes
1935      per symbol are output as a list of strings-per-source symbol. A
1936      zero probability symbol is NOT assigned any codeword as this
1937      symbol doesn't occur in practice anyway.
1938
1939      TOGGLE is an optional argument with values 1 or 0, that starts
1940      building a code based on 1's or 0's, defaulting to 0. Also MINVAR
1941      is a boolean value that is useful in choosing if you want to
1942      optimize buffer for transmission in the applications of Huffman
1943      coding, however it doesn't affect the type or average codeword
1944      length of the generated code. An example of the use of
1945      `huffmandict' is
1946
1947             huffmandict(symbols, [0.5 0.25 0.15 0.1]) => CW(0,10,111,110)
1948             huffmandict(symbols, 0.25*ones(1,4)) => CW(11,10,01,00)
1949
1950             prob=[0.5 0 0.25 0.15 0.1]
1951             dict=huffmandict(1:5,[0.5 0 0.25 0.15 0.1],1)
1952             entropy(prob)
1953             laverage(dict,prob)
1954
1955             x =   [0.20000   0.40000   0.20000   0.10000   0.10000];
1956             #illustrates the minimum variance thing.
1957             huffmandict(1,x,0,true) #min variance tree.
1958             huffmandict(1,x)     #normal huffman tree.
1959
1960      Reference: Dr.Rao's course EE5351 Digital Video Coding, at
1961      UT-Arlington.
1962
1963      See also: huffmandeco, huffmanenco
1964
1965
1966
1967
1968
1969 # name: <cell-element>
1970 # type: sq_string
1971 # elements: 1
1972 # length: 48
1973 Builds a Huffman code, given a probability list.
1974
1975
1976
1977 # name: <cell-element>
1978 # type: sq_string
1979 # elements: 1
1980 # length: 11
1981 huffmanenco
1982
1983
1984 # name: <cell-element>
1985 # type: sq_string
1986 # elements: 1
1987 # length: 605
1988  -- Function File:  huffmanenco (SIG, DICT)
1989      Returns the Huffman encoded signal using DICT. This function uses
1990      a DICT built from the `huffmandict' and uses it to encode a signal
1991      list into a huffman list. A restrictions is that a signal set must
1992      strictly belong in the range `[1,N]' with `N = length(dict)'.
1993      Also DICT can only be from the `huffmandict' routine.  An exmaple
1994      of the use of `huffmanenco' is
1995
1996           hd = huffmandict (1:4, [0.5 0.25 0.15 0.10]);
1997           huffmanenco (1:4, hd);
1998                 => [1 0 1 0 0 0 0 0 1]
1999
2000      See also: huffmandict, huffmandeco
2001
2002
2003
2004
2005
2006 # name: <cell-element>
2007 # type: sq_string
2008 # elements: 1
2009 # length: 46
2010 Returns the Huffman encoded signal using DICT.
2011
2012
2013
2014 # name: <cell-element>
2015 # type: sq_string
2016 # elements: 1
2017 # length: 6
2018 intrlv
2019
2020
2021 # name: <cell-element>
2022 # type: sq_string
2023 # elements: 1
2024 # length: 137
2025  -- Function File: INTRLVD = intrlv (DATA, ELEMENTS)
2026      Interleaved elements of DATA according to ELEMENTS.
2027
2028      See also: deintrlv
2029
2030
2031
2032
2033
2034 # name: <cell-element>
2035 # type: sq_string
2036 # elements: 1
2037 # length: 51
2038 Interleaved elements of DATA according to ELEMENTS.
2039
2040
2041
2042 # name: <cell-element>
2043 # type: sq_string
2044 # elements: 1
2045 # length: 6
2046 lloyds
2047
2048
2049 # name: <cell-element>
2050 # type: sq_string
2051 # elements: 1
2052 # length: 1895
2053  -- Function File: [TABLE, CODES] =  lloyds (SIG,INIT_CODES)
2054  -- Function File: [TABLE, CODES] =  lloyds (SIG,LEN)
2055  -- Function File: [TABLE, CODES] =  lloyds (SIG,...,TOL)
2056  -- Function File: [TABLE, CODES] =  lloyds (SIG,...,TOL,TYPE)
2057  -- Function File: [TABLE, CODES, DIST] =  lloyds (...)
2058  -- Function File: [TABLE, CODES, DIST, RELDIST] =  lloyds (...)
2059      Optimize the quantization table and codes to reduce distortion.
2060      This is based on the article by Lloyd
2061
2062      S. Lloyd _Least squared quantization in PCM_, IEEE Trans Inform
2063      Thoery, Mar 1982, no 2, p129-137
2064
2065      which describes an iterative technique to reduce the quantization
2066      error by making the intervals of the table such that each interval
2067      has the same area under the PDF of the training signal SIG. The
2068      initial codes to try can either be given in the vector INIT_CODES
2069      or as scalar LEN. In the case of a scalar the initial codes will
2070      be an equi-spaced vector of length LEN between the minimum and
2071      maximum value of the training signal.
2072
2073      The stopping criteria of the iterative algorithm is given by
2074
2075           abs(DIST(n) - DIST(n-1)) < max(TOL, abs(EPS*max(SIG))
2076
2077      By default TOL is 1.e-7. The final input argument determines how
2078      the updated table is created. By default the centroid of the
2079      values of the training signal that fall within the interval
2080      described by CODES are used to update TABLE. If TYPE is any other
2081      string than "centroid", this behaviour is overriden and TABLE is
2082      updated as follows.
2083
2084           TABLE = (CODE(2:length(CODE)) + CODE(1:length(CODE-1))) / 2
2085
2086      The optimized values are returned as TABLE and CODE. In addition
2087      the distortion of the the optimized codes representing the
2088      training signal is returned as DIST. The relative distortion in
2089      the final iteration is also returned as RELDIST.
2090
2091
2092    See also: quantiz
2093
2094
2095
2096
2097 # name: <cell-element>
2098 # type: sq_string
2099 # elements: 1
2100 # length: 63
2101 Optimize the quantization table and codes to reduce distortion.
2102
2103
2104
2105 # name: <cell-element>
2106 # type: sq_string
2107 # elements: 1
2108 # length: 8
2109 lz77deco
2110
2111
2112 # name: <cell-element>
2113 # type: sq_string
2114 # elements: 1
2115 # length: 347
2116  -- Function File: M = lz77deco (C, ALPH, LA, N)
2117      Lempel-Ziv 77 source algorithm decoding implementation. Where
2118
2119     M
2120           message decoded (1xN).
2121
2122     C
2123           encoded message (Mx3).
2124
2125     ALPH
2126           size of alphabet.
2127
2128     LA
2129           lookahead buffer size.
2130
2131     N
2132           sliding window buffer size.
2133
2134      See also: lz77enco
2135
2136
2137
2138
2139
2140 # name: <cell-element>
2141 # type: sq_string
2142 # elements: 1
2143 # length: 55
2144 Lempel-Ziv 77 source algorithm decoding implementation.
2145
2146
2147
2148 # name: <cell-element>
2149 # type: sq_string
2150 # elements: 1
2151 # length: 8
2152 lz77enco
2153
2154
2155 # name: <cell-element>
2156 # type: sq_string
2157 # elements: 1
2158 # length: 298
2159  -- Function File: C = lz77enco (M, ALPH, LA, N)
2160      Lempel-Ziv 77 source algorithm implementation. Where
2161
2162     C
2163           encoded message (Mx3).
2164
2165     ALPH
2166           size of alphabet.
2167
2168     LA
2169           lookahead buffer size.
2170
2171     N
2172           sliding window buffer size.
2173
2174      See also: lz77deco
2175
2176
2177
2178
2179
2180 # name: <cell-element>
2181 # type: sq_string
2182 # elements: 1
2183 # length: 46
2184 Lempel-Ziv 77 source algorithm implementation.
2185
2186
2187
2188 # name: <cell-element>
2189 # type: sq_string
2190 # elements: 1
2191 # length: 11
2192 matdeintrlv
2193
2194
2195 # name: <cell-element>
2196 # type: sq_string
2197 # elements: 1
2198 # length: 171
2199  -- Function File: INTRLVD = matdeintrlv (DATA, NROWS, NCOLS)
2200      Restore elements of DATA with a tempory matrix of size
2201      NROWS-by-NCOLS.
2202
2203      See also: matintrlv
2204
2205
2206
2207
2208
2209 # name: <cell-element>
2210 # type: sq_string
2211 # elements: 1
2212 # length: 70
2213 Restore elements of DATA with a tempory matrix of size NROWS-by-NCOLS.
2214
2215
2216
2217 # name: <cell-element>
2218 # type: sq_string
2219 # elements: 1
2220 # length: 9
2221 matintrlv
2222
2223
2224 # name: <cell-element>
2225 # type: sq_string
2226 # elements: 1
2227 # length: 175
2228  -- Function File: INTRLVD = matintrlv (DATA, NROWS, NCOLS)
2229      Interleaved elements of DATA with a tempory matrix of size
2230      NROWS-by-NCOLS.
2231
2232      See also: matdeintrlv
2233
2234
2235
2236
2237
2238 # name: <cell-element>
2239 # type: sq_string
2240 # elements: 1
2241 # length: 74
2242 Interleaved elements of DATA with a tempory matrix of size
2243 NROWS-by-NCOLS.
2244
2245
2246
2247 # name: <cell-element>
2248 # type: sq_string
2249 # elements: 1
2250 # length: 6
2251 minpol
2252
2253
2254 # name: <cell-element>
2255 # type: sq_string
2256 # elements: 1
2257 # length: 262
2258  -- Function File:  minpol (V)
2259      Finds the minimum polynomial for elements of a Galois Field. For  a
2260      vector V with N components, representing N values in a Galois
2261      Field GF(2^M), return the minimum polynomial in GF(2) representing
2262      thos values.
2263
2264
2265
2266
2267 # name: <cell-element>
2268 # type: sq_string
2269 # elements: 1
2270 # length: 60
2271 Finds the minimum polynomial for elements of a Galois Field.
2272
2273
2274
2275 # name: <cell-element>
2276 # type: sq_string
2277 # elements: 1
2278 # length: 6
2279 modmap
2280
2281
2282 # name: <cell-element>
2283 # type: sq_string
2284 # elements: 1
2285 # length: 2594
2286  -- Function File:  modmap (METHOD,...)
2287  -- Function File: y =  modmap (X,FD,FS,'ask',M)
2288  -- Function File: y =  modmap (X,FD,FS,'fsk',M,TONE)
2289  -- Function File: y =  modmap (X,FD,FS,'msk')
2290  -- Function File: y =  modmap (X,FD,FS,'psk',M)
2291  -- Function File: y =  modmap (X,FD,FS,'qask',M)
2292  -- Function File: y =  modmap (X,FD,FS,'qask/cir',NSIG,AMP,PHS)
2293  -- Function File: y =  modmap (X,FD,FS,'qask/arb',INPHASE,QUADR)
2294  -- Function File: y =  modmap (X,FD,FS,'qask/arb',MAP)
2295      Mapping of a digital signal to an analog signal. With no output
2296      arguments "modmap" plots the constellation of the mapping. In this
2297      case the first argument must be the string METHOD defining one of
2298      'ask', 'fsk', 'msk', 'qask', 'qask/cir' or 'qask/arb'. The
2299      arguments following the string METHOD are generally the same as
2300      those after the corresponding string in the fucntion call without
2301      output arguments.  The exception is `modmap('msk',FD)'.
2302
2303      With an output argument, Y is the complex mapped analog signal. In
2304      this case the arguments X, FD and FS are required. The variable X
2305      is the digital signal to be mapped, FD is the sampling rate of the
2306      of digital signal and the FS is the sampling rate of the analog
2307      signal. It is required that `FS/FD' is an integer.
2308
2309      The available mapping of the digital signal are
2310
2311     'ask'
2312           Amplitude shift keying
2313
2314     'fsk'
2315           Frequency shift keying
2316
2317     'msk'
2318           Minimum shift keying
2319
2320     'psk'
2321           Phase shift keying
2322
2323     'qask'
2324     'qsk'
2325     'qam'
2326           Quadraure amplitude shift keying
2327
2328      In addition the 'qask', 'qsk' and 'qam' method can be modified
2329      with the flags '/cir' or '/arb'. That is 'qask/cir' and
2330      'qask/arb', etc are valid methods and give circular- and
2331      arbitrary-qask mappings respectively.
2332
2333      The additional argument M is the order of the modulation to use.
2334      M must be larger than the largest element of X. The variable TONE
2335      is the FSK tone to use in the modulation.
2336
2337      For 'qask/cir', the additional arguments are the same as for
2338      "apkconst", and you are referred to "apkconst" for the definitions
2339      of the additional variables.
2340
2341      For 'qask/arb', the additional arguments INPHASE and QUADR give
2342      the in-phase and quadrature components of the mapping, in a
2343      similar mapping to the outputs of "qaskenco" with one argument.
2344      Similar MAP represents the in-phase and quadrature components of
2345      the mapping as the real and imaginary parts of the variable MAP.
2346
2347    See also: demodmap, dmodce, amodce, apkconst, qaskenco
2348
2349
2350
2351
2352 # name: <cell-element>
2353 # type: sq_string
2354 # elements: 1
2355 # length: 48
2356 Mapping of a digital signal to an analog signal.
2357
2358
2359
2360 # name: <cell-element>
2361 # type: sq_string
2362 # elements: 1
2363 # length: 7
2364 oct2dec
2365
2366
2367 # name: <cell-element>
2368 # type: sq_string
2369 # elements: 1
2370 # length: 192
2371  -- Function File: D = oct2dec (C)
2372      Convert octal to decimal values.
2373
2374      Each element of the octal matrix C is converted to a decimal value.
2375
2376      See also: base2dec, bin2dec, dec2bin
2377
2378
2379
2380
2381
2382 # name: <cell-element>
2383 # type: sq_string
2384 # elements: 1
2385 # length: 32
2386 Convert octal to decimal values.
2387
2388
2389
2390 # name: <cell-element>
2391 # type: sq_string
2392 # elements: 1
2393 # length: 8
2394 pamdemod
2395
2396
2397 # name: <cell-element>
2398 # type: sq_string
2399 # elements: 1
2400 # length: 717
2401  -- Function File: Y =  pamdemod (X, M)
2402  -- Function File: Y =  pamdemod (X, M, PHI)
2403  -- Function File: Y =  pamdemod (X, M, PHI, TYPE)
2404      Demodulates a pulse amplitude modulated signal X into an
2405      information sequence of integers in the range `[0 ... M-1]'.  PHI
2406      controls the initial phase and TYPE controls the constellation
2407      mapping. If TYPE is set to 'Bin' will result in binary encoding,
2408      in contrast, if set to 'Gray' will give Gray encoding.  An example
2409      of Gray-encoded 8-PAM is
2410
2411           d = randint(1,1e4,8);
2412           y = pammod(d,8,0,'Gray');
2413           z = awgn(y,20);
2414           d_est = pamdemod(z,8,0,'Gray');
2415           plot(z,'rx')
2416           biterr(d,d_est)
2417
2418    See also: pammod
2419
2420
2421
2422
2423 # name: <cell-element>
2424 # type: sq_string
2425 # elements: 1
2426 # length: 80
2427 Demodulates a pulse amplitude modulated signal X into an information
2428 sequence of
2429
2430
2431
2432 # name: <cell-element>
2433 # type: sq_string
2434 # elements: 1
2435 # length: 6
2436 pammod
2437
2438
2439 # name: <cell-element>
2440 # type: sq_string
2441 # elements: 1
2442 # length: 645
2443  -- Function File: Y =  pammod (X, M)
2444  -- Function File: Y =  pammod (X, M, PHI)
2445  -- Function File: Y =  pammod (X, M, PHI, TYPE)
2446      Modulates an information sequence of integers X in the range `[0
2447      ... M-1]' onto a pulse amplitude modulated signal Y.  PHI controls
2448      the initial phase and TYPE controls the constellation mapping. If
2449      TYPE is set to 'Bin' will result in binary encoding, in contrast,
2450      if set to 'Gray' will give Gray encoding.  An example of
2451      Gray-encoded 8-PAM is
2452
2453           d = randint(1,1e4,8);
2454           y = pammod(d,8,0,'Gray');
2455           z = awgn(y,20);
2456           plot(z,'rx')
2457
2458    See also: pamdemod
2459
2460
2461
2462
2463 # name: <cell-element>
2464 # type: sq_string
2465 # elements: 1
2466 # length: 66
2467 Modulates an information sequence of integers X in the range `[0 .
2468
2469
2470
2471 # name: <cell-element>
2472 # type: sq_string
2473 # elements: 1
2474 # length: 14
2475 prbs_generator
2476
2477
2478 # name: <cell-element>
2479 # type: sq_string
2480 # elements: 1
2481 # length: 1534
2482  Implement book keeping for a Pseudo-Random Binary Sequence ( PRBS )
2483  also called as a Linear Feedback Shift Register.
2484  
2485  Given a polynomial create a PRBS structure for that polynomial.
2486  Now all we need is to just create this polynomial and make it work.
2487  polynomial must be a vector containing the powers of x and an optional
2488  value 1. eg: x^3 + x^2 + x + 1 must be written as [3 2 1 0]
2489  all the coefficients are either 1 or 0. It generates only a Binary \
2490  sequence, and the generator polynomial need to be only a binary
2491  polynomial in GF(2).
2492  
2493  connections, contains a struct of vectors where each vector is the
2494  connection list mapping its vec(2:end) elements to the vec(1) output.
2495  
2496  Example: If you had a PRBS shift register like the diagram
2497  below with 4 registers we use representation by polynomial
2498  of [ 1 2 3 4], and feedback connections between [ 1 3 4 ].
2499  The output PRBS sequence is taken from the position 4.
2500  
2501   +---+    +----+   +---+   +---+
2502   | D |----| D  |---| D |---| D |
2503   +---+    +----+   +---+   +---+
2504     |                 |       |
2505     \                 /      /
2506     [+]---------------+------+
2507    1   +    0.D   + 1.D^2 + 1.D^3
2508  
2509  The code to implement this PRBS with a start state of [1 0 1 1]
2510  will be:
2511  
2512  prbs=prbs_generator([1 3 4],{[1 3 4]},[1 0 1 1]);
2513  x = prbs_sequence(prbs) #gives 15
2514  
2515  prbs_iterator( prbs, 15 ) #15 binary digits seen
2516  [ 1   1   0   1   0   1   1   1   1   0   0   0   1   0   0 ]
2517  
2518  See Also: This function is to be used along with functions 
2519  prbs_iterator, and prbs_sequence.
2520
2521
2522
2523 # name: <cell-element>
2524 # type: sq_string
2525 # elements: 1
2526 # length: 80
2527  Implement book keeping for a Pseudo-Random Binary Sequence ( PRBS )
2528  also calle
2529
2530
2531
2532 # name: <cell-element>
2533 # type: sq_string
2534 # elements: 1
2535 # length: 13
2536 prbs_iterator
2537
2538
2539 # name: <cell-element>
2540 # type: sq_string
2541 # elements: 1
2542 # length: 1172
2543  This function generates the output bits from the PRBS
2544  state, for the number of iterations specified.
2545
2546  First argument is the PRBS structure obtained from prbs_generator.
2547  PRBS iterations is specified in the second argument.
2548  PRBS start state is taken from the prbs.sregs.
2549
2550  Second argument of the output is PRBS structure with a new
2551  state. This allows usage like: 
2552  
2553  [ seq, prbs ] =  prbs_iterator( prbs, niterations );
2554  
2555  while the state of the PRBS is updated.
2556  
2557  Example: If you had a PRBS shift register like the diagram
2558  below with 4 registers we use representation by polynomial
2559  of [ 1 2 3 4], and feedback connections between [ 1 3 4 ].
2560  The output PRBS sequence is taken from the position 4.
2561  
2562   +---+    +----+   +---+   +---+
2563   | D |----| D  |---| D |---| D |
2564   +---+    +----+   +---+   +---+
2565     |                 |       |
2566     \                 /      /
2567     [+]---------------+------+
2568    1   +    0.D   + 1.D^2 + 1.D^3
2569
2570  The code to implement this PRBS will be 
2571  prbs=prbs_generator([1 3 4],{[1 3 4]},[1 0 1 1]);
2572  x = prbs_iterator(prbs,15)
2573  
2574  See Also: This function is to be used along with functions 
2575  prbs_iterator, prbs_generator and prbs_sequence.
2576
2577
2578
2579 # name: <cell-element>
2580 # type: sq_string
2581 # elements: 1
2582 # length: 80
2583  This function generates the output bits from the PRBS
2584  state, for the number of
2585
2586
2587
2588 # name: <cell-element>
2589 # type: sq_string
2590 # elements: 1
2591 # length: 13
2592 prbs_sequence
2593
2594
2595 # name: <cell-element>
2596 # type: sq_string
2597 # elements: 1
2598 # length: 960
2599  Implement book keeping for a Pseudo-Random Binary Sequence ( PRBS )
2600  also called as a Linear Feedback Shift Register.
2601  
2602  For the given PRBS in a intial state, compute the PRBS sequence length.
2603  Length is period of output when the PRBS state is same as 
2604  the start state of PRBS.
2605  
2606  Example: If you had a PRBS shift register like the diagram
2607  below with 4 registers we use representation by polynomial
2608  of [ 1 2 3 4], and feedback connections between [ 1 3 4 ].
2609  The output PRBS sequence is taken from the position 4.
2610  
2611   +---+    +----+   +---+   +---+
2612   | D |----| D  |---| D |---| D |
2613   +---+    +----+   +---+   +---+
2614     |                 |       |
2615     \                 /      /
2616     [+]---------------+------+
2617    1   +    0.D   + 1.D^2 + 1.D^3
2618
2619  The code to implement this PRBS will be 
2620  prbs=prbs_generator([1 3 4],{[1 3 4]},[1 0 1 1]);
2621  x = prbs_sequence(prbs) #gives 15
2622  
2623
2624  See Also: This function is to be used along with functions 
2625  prbs_generator.
2626
2627
2628
2629 # name: <cell-element>
2630 # type: sq_string
2631 # elements: 1
2632 # length: 80
2633  Implement book keeping for a Pseudo-Random Binary Sequence ( PRBS )
2634  also calle
2635
2636
2637
2638 # name: <cell-element>
2639 # type: sq_string
2640 # elements: 1
2641 # length: 8
2642 pskdemod
2643
2644
2645 # name: <cell-element>
2646 # type: sq_string
2647 # elements: 1
2648 # length: 734
2649  -- Function File: Y =  pamdemod (X, M)
2650  -- Function File: Y =  pamdemod (X, M, PHI)
2651  -- Function File: Y =  pamdemod (X, M, PHI, TYPE)
2652      Demodulates a complex-baseband phase shift keying modulated signal
2653      into an information sequence of integers in the range `[0 ...
2654      M-1]'. PHI controls the initial phase and TYPE controls the
2655      constellation mapping. If TYPE is set to 'Bin' will result in
2656      binary encoding, in contrast, if set to 'Gray' will give Gray
2657      encoding.  An example of Gray-encoded 8-PSK is
2658
2659           d = randint(1,1e3,8);
2660           y = pskmod(d,8,0,'Gray');
2661           z = awgn(y,20);
2662           d_est = pskdemod(z,8,0,'Gray');
2663           plot(z,'rx')
2664           biterr(d,d_est)
2665
2666    See also: pskmod
2667
2668
2669
2670
2671 # name: <cell-element>
2672 # type: sq_string
2673 # elements: 1
2674 # length: 80
2675 Demodulates a complex-baseband phase shift keying modulated signal into
2676 an infor
2677
2678
2679
2680 # name: <cell-element>
2681 # type: sq_string
2682 # elements: 1
2683 # length: 6
2684 pskmod
2685
2686
2687 # name: <cell-element>
2688 # type: sq_string
2689 # elements: 1
2690 # length: 662
2691  -- Function File: Y =  pskmod (X, M)
2692  -- Function File: Y =  pskmod (X, M, PHI)
2693  -- Function File: Y =  pskmod (X, M, PHI, TYPE)
2694      Modulates an information sequence of integers X in the range `[0
2695      ... M-1]' onto a complex baseband phase shift keying modulated
2696      signal Y. PHI controls the initial phase and TYPE controls the
2697      constellation mapping. If TYPE is set to 'Bin' will result in
2698      binary encoding, in contrast, if set to 'Gray' will give Gray
2699      encoding. An example of Gray-encoded QPSK is
2700
2701           d = randint(1,5e3,4);
2702           y = pskmod(d,4,0,'Gray');
2703           z = awgn(y,30);
2704           plot(z,'rx')
2705
2706    See also: pskdemod
2707
2708
2709
2710
2711 # name: <cell-element>
2712 # type: sq_string
2713 # elements: 1
2714 # length: 66
2715 Modulates an information sequence of integers X in the range `[0 .
2716
2717
2718
2719 # name: <cell-element>
2720 # type: sq_string
2721 # elements: 1
2722 # length: 8
2723 qamdemod
2724
2725
2726 # name: <cell-element>
2727 # type: sq_string
2728 # elements: 1
2729 # length: 142
2730  -- Function File: qamdemod (X,M)
2731      Create the QAM demodulation of x with a size of alphabet m.
2732
2733      See also: qammod, pskmod, pskdemod
2734
2735
2736
2737
2738
2739 # name: <cell-element>
2740 # type: sq_string
2741 # elements: 1
2742 # length: 59
2743 Create the QAM demodulation of x with a size of alphabet m.
2744
2745
2746
2747 # name: <cell-element>
2748 # type: sq_string
2749 # elements: 1
2750 # length: 6
2751 qammod
2752
2753
2754 # name: <cell-element>
2755 # type: sq_string
2756 # elements: 1
2757 # length: 140
2758  -- Function File: qammod (X,M)
2759      Create the QAM modulation of x with a size of alphabet m.
2760
2761      See also: qamdemod, pskmod, pskdemod
2762
2763
2764
2765
2766
2767 # name: <cell-element>
2768 # type: sq_string
2769 # elements: 1
2770 # length: 57
2771 Create the QAM modulation of x with a size of alphabet m.
2772
2773
2774
2775 # name: <cell-element>
2776 # type: sq_string
2777 # elements: 1
2778 # length: 8
2779 qaskdeco
2780
2781
2782 # name: <cell-element>
2783 # type: sq_string
2784 # elements: 1
2785 # length: 1177
2786  -- Function File: MSG = qaskdeco (C,M)
2787  -- Function File: MSG = qaskdeco (INPHASE,QUADR,M)
2788  -- Function File: MSG = qaskdeco (...,MNMX)
2789      Demaps an analog signal using a square QASK constellation. The
2790      input signal maybe either a complex variable C, or as two real
2791      variables INPHASE and QUADR representing the in-phase and
2792      quadrature components of the signal.
2793
2794      The argument M must be a positive integer power of 2. By deafult
2795      the same constellation as created in "qaskenco" is used by
2796      "qaskdeco".  If is possible to change the values of the minimum
2797      and maximum of the in-phase and quadrature components of the
2798      constellation to account for linear changes in the signal values
2799      in the received signal. The variable MNMX is a 2-by-2 matrix of
2800      the following form
2801
2802               |   min in-phase      ,   max in-phase      |
2803               |   min quadrature    ,   max quadrature    |
2804
2805      If `sqrt(M)' is an integer, then "qaskenco" uses a Gray mapping.
2806      Otherwise, an attempt is made to create a nearly square mapping
2807      with a minimum Hamming distance between adjacent constellation
2808      points.
2809
2810    See also: qaskenco
2811
2812
2813
2814
2815 # name: <cell-element>
2816 # type: sq_string
2817 # elements: 1
2818 # length: 58
2819 Demaps an analog signal using a square QASK constellation.
2820
2821
2822
2823 # name: <cell-element>
2824 # type: sq_string
2825 # elements: 1
2826 # length: 8
2827 qaskenco
2828
2829
2830 # name: <cell-element>
2831 # type: sq_string
2832 # elements: 1
2833 # length: 1685
2834  -- Function File:  qaskenco (M)
2835  -- Function File:  qaskenco (MSG,M)
2836  -- Function File: Y =  qaskenco (...)
2837  -- Function File: [INPHASE, QUADR] = qaskenco (...)
2838      Map a digital signal using a square QASK constellation. The
2839      argument M must be a positive integer power of 2. With two input
2840      arguments the variable MSG represents the message to be encoded.
2841      The values of MSG must be between 0 and `M-1'. In all cases
2842      `qaskenco(M)' is equivalent to `qaskenco(1:M,M)'
2843
2844      Three types of outputs can be created depending on the number of
2845      output arguments. That is
2846
2847     No output arguments
2848           In this case "qaskenco" plots the constellation. Only the
2849           points in MSG are plotted, which in the case of a single input
2850           argument is all constellation points.
2851
2852     A single output argument
2853           The returned variable is a complex variable representing the
2854           in-phase and quadrature components of the mapped  message
2855           MSG. With, a single input argument this effectively gives the
2856           mapping from symbols to constellation points
2857
2858     Two output arguments
2859           This is the same as two ouput arguments, expect that the
2860           in-phase and quadrature components are returned explicitly.
2861           That is
2862
2863                octave> c = qaskenco(msg, m);
2864                octave> [a, b] = qaskenco(msg, m);
2865                octave> all(c == a + 1i*b)
2866                ans = 1
2867
2868      If `sqrt(M)' is an integer, then "qaskenco" uses a Gray mapping.
2869      Otherwise, an attempt is made to create a nearly square mapping
2870      with a minimum Hamming distance between adjacent constellation
2871      points.
2872
2873    See also: qaskdeco
2874
2875
2876
2877
2878 # name: <cell-element>
2879 # type: sq_string
2880 # elements: 1
2881 # length: 55
2882 Map a digital signal using a square QASK constellation.
2883
2884
2885
2886 # name: <cell-element>
2887 # type: sq_string
2888 # elements: 1
2889 # length: 5
2890 qfunc
2891
2892
2893 # name: <cell-element>
2894 # type: sq_string
2895 # elements: 1
2896 # length: 92
2897  -- Function File: [Y] = qfunc (X)
2898      Compute the Q function.
2899
2900      See also: erfc, erf
2901
2902
2903
2904
2905
2906 # name: <cell-element>
2907 # type: sq_string
2908 # elements: 1
2909 # length: 23
2910 Compute the Q function.
2911
2912
2913
2914 # name: <cell-element>
2915 # type: sq_string
2916 # elements: 1
2917 # length: 8
2918 qfuncinv
2919
2920
2921 # name: <cell-element>
2922 # type: sq_string
2923 # elements: 1
2924 # length: 103
2925  -- Function File: [Y] = qfuncinv (X)
2926      Compute the inverse Q function.
2927
2928      See also: erfc, erf
2929
2930
2931
2932
2933
2934 # name: <cell-element>
2935 # type: sq_string
2936 # elements: 1
2937 # length: 31
2938 Compute the inverse Q function.
2939
2940
2941
2942 # name: <cell-element>
2943 # type: sq_string
2944 # elements: 1
2945 # length: 7
2946 quantiz
2947
2948
2949 # name: <cell-element>
2950 # type: sq_string
2951 # elements: 1
2952 # length: 813
2953  -- Function File: QIDX =  quantiz (X, TABLE)
2954  -- Function File: [QIDX, Q] =  quantiz (X, TABLE, CODES)
2955  -- Function File: [ QIDX, Q, D] =  quantiz (...)
2956      Quantization of an arbitrary signal relative to a paritioning.
2957
2958     `qidx = quantiz(x, table)'
2959           Determine position of x in strictly monotonic table.  The
2960           first   interval, using index 0, corresponds to x <= table(1).
2961            Subsequent intervals are table(i-1) < x <= table(i).
2962
2963     `[qidx, q] = quantiz(x, table, codes)'
2964           Associate each interval of the table with a code.  Use
2965           codes(1)   for x <= table(1) and codes(n+1) for table(n) < x
2966           <= table(n+1).
2967
2968     `[qidx, q, d] = quantiz(...)'
2969           Compute distortion as mean squared distance of x from the
2970           corresponding quantization values.
2971
2972
2973
2974
2975 # name: <cell-element>
2976 # type: sq_string
2977 # elements: 1
2978 # length: 62
2979 Quantization of an arbitrary signal relative to a paritioning.
2980
2981
2982
2983 # name: <cell-element>
2984 # type: sq_string
2985 # elements: 1
2986 # length: 12
2987 randdeintrlv
2988
2989
2990 # name: <cell-element>
2991 # type: sq_string
2992 # elements: 1
2993 # length: 160
2994  -- Function File: INTRLVD = randdeintrlv (DATA, STATE)
2995      Restore elements of DATA with a random permutation.
2996
2997      See also: randintrlv, intrlv, deintrlv
2998
2999
3000
3001
3002
3003 # name: <cell-element>
3004 # type: sq_string
3005 # elements: 1
3006 # length: 51
3007 Restore elements of DATA with a random permutation.
3008
3009
3010
3011 # name: <cell-element>
3012 # type: sq_string
3013 # elements: 1
3014 # length: 7
3015 randerr
3016
3017
3018 # name: <cell-element>
3019 # type: sq_string
3020 # elements: 1
3021 # length: 987
3022  -- Function File: B =  randerr (N)
3023  -- Function File: B =  randerr (N,M)
3024  -- Function File: B =  randerr (N,M,ERR)
3025  -- Function File: B =  randerr (N,M,ERR,SEED)
3026      Generate a matrix of random bit errors. The size of the matrix is
3027      N rows by M columns. By default M is equal to N.  Bit errors in
3028      the matrix are indicated by a 1.
3029
3030      The variable ERR determines the number of errors per row. By
3031      default the return matrix B has exactly one bit error per row.  If
3032      ERR is a scalar, there each row of B has exactly this number of
3033      errors per row. If ERR is a vector then each row has a number of
3034      errors that is in this vector. Each number of errors has an equal
3035      probability. If ERR is a matrix with two rows, then the first row
3036      determines the number of errors and the second their probabilities.
3037
3038      The variable SEED allows the random number generator to be seeded
3039      with a fixed value. The initial seed will be restored when
3040      returning.
3041
3042
3043
3044
3045 # name: <cell-element>
3046 # type: sq_string
3047 # elements: 1
3048 # length: 39
3049 Generate a matrix of random bit errors.
3050
3051
3052
3053 # name: <cell-element>
3054 # type: sq_string
3055 # elements: 1
3056 # length: 7
3057 randint
3058
3059
3060 # name: <cell-element>
3061 # type: sq_string
3062 # elements: 1
3063 # length: 800
3064  -- Function File: B =  randint (N)
3065  -- Function File: B =  randint (N,M)
3066  -- Function File: B =  randint (N,M,RANGE)
3067  -- Function File: B =  randint (N,M,RANGE,SEED)
3068      Generate a matrix of random binary numbers. The size of the matrix
3069      is N rows by M columns. By default M is equal to N.
3070
3071      The range in which the integers are generated will is determined by
3072      the variable RANGE. If RANGE is an integer, the value will lie in
3073      the range [0,RANGE-1], or [RANGE+1,0] if RANGE is negative. If
3074      RANGE contains two elements the intgers will lie within these two
3075      elements, inclusive. By default RANGE is assumed to be [0:1].
3076
3077      The variable SEED allows the random number generator to be seeded
3078      with a fixed value. The initial seed will be restored when
3079      returning.
3080
3081
3082
3083
3084 # name: <cell-element>
3085 # type: sq_string
3086 # elements: 1
3087 # length: 43
3088 Generate a matrix of random binary numbers.
3089
3090
3091
3092 # name: <cell-element>
3093 # type: sq_string
3094 # elements: 1
3095 # length: 10
3096 randintrlv
3097
3098
3099 # name: <cell-element>
3100 # type: sq_string
3101 # elements: 1
3102 # length: 150
3103  -- Function File: INTRLVD = randintrlv (DATA, STATE)
3104      Interleaves elements of DATA with a random permutation.
3105
3106      See also: intrlv, deintrlv
3107
3108
3109
3110
3111
3112 # name: <cell-element>
3113 # type: sq_string
3114 # elements: 1
3115 # length: 55
3116 Interleaves elements of DATA with a random permutation.
3117
3118
3119
3120 # name: <cell-element>
3121 # type: sq_string
3122 # elements: 1
3123 # length: 7
3124 randsrc
3125
3126
3127 # name: <cell-element>
3128 # type: sq_string
3129 # elements: 1
3130 # length: 845
3131  -- Function File: B =  randsrc (N)
3132  -- Function File: B =  randsrc (N,M)
3133  -- Function File: B =  randsrc (N,M,ALPHABET)
3134  -- Function File: B =  randsrc (N,M,ALPHABET,SEED)
3135      Generate a matrix of random symbols. The size of the matrix is N
3136      rows by M columns. By default M is equal to N.
3137
3138      The variable ALPHABET can be either a row vector or a matrix with
3139      two rows. When ALPHABET is a row vector the symbols returned in B
3140      are chosen with equal probability from ALPHABET. When ALPHABET has
3141      two rows, the second row determines the probabilty with which each
3142      of the symbols is chosen. The sum of the probabilities must equal
3143      1. By default ALPHABET is [-1 1].
3144
3145      The variable SEED allows the random number generator to be seeded
3146      with a fixed value. The initial seed will be restored when
3147      returning.
3148
3149
3150
3151
3152 # name: <cell-element>
3153 # type: sq_string
3154 # elements: 1
3155 # length: 36
3156 Generate a matrix of random symbols.
3157
3158
3159
3160 # name: <cell-element>
3161 # type: sq_string
3162 # elements: 1
3163 # length: 13
3164 reedmullerdec
3165
3166
3167 # name: <cell-element>
3168 # type: sq_string
3169 # elements: 1
3170 # length: 1165
3171  -- Function File:  reedmullerdec (VV,G,R,M)
3172      Decode the received code word VV using  the RM-generator matrix G,
3173      of order R, M, returning the code-word C. We use the standard
3174      majority logic vote method due to Irving S. Reed. The received
3175      word has to be a matrix of column size equal to to code-word size
3176      (i.e 2^m). Each row is treated as a separate received word.
3177
3178      The second return value is the message M got from C.
3179
3180      G is obtained from definition type construction of Reed Muller
3181      code, of order R, length 2^M. Use the function reedmullergen, for
3182      the generator matrix for the (R,M) order RM code.
3183
3184      Faster code constructions (also easier) exist, but since finding
3185      permutation order of the basis vectors, is important, we stick
3186      with the standard definitions. To use decoder function
3187      reedmullerdec,  you need to use this specific generator function.
3188
3189      see: Lin & Costello, Ch.4, "Error Control Coding", 2nd Ed, Pearson.
3190
3191           G=reedmullergen(2,4);
3192           M=[rand(1,11)>0.5];
3193           C=mod(M*G,2);
3194           [dec_C,dec_M]=reedmullerdec(C,G,2,4)
3195
3196
3197    See also: reedmullergen, reedmullerenc
3198
3199
3200
3201
3202 # name: <cell-element>
3203 # type: sq_string
3204 # elements: 1
3205 # length: 80
3206 Decode the received code word VV using  the RM-generator matrix G, of
3207 order R, M
3208
3209
3210
3211 # name: <cell-element>
3212 # type: sq_string
3213 # elements: 1
3214 # length: 13
3215 reedmullerenc
3216
3217
3218 # name: <cell-element>
3219 # type: sq_string
3220 # elements: 1
3221 # length: 581
3222  -- Function File:  reedmullerenc (MSG,R,M)
3223      Definition type construction of Reed Muller code, of order R,
3224      length 2^M. This function returns the generator matrix for the
3225      said order RM code.
3226
3227      Encodes the given message word/block, of column size k,
3228      corresponding to the RM(R,M), and outputs a code matrix C, on each
3229      row with corresponding codeword.  The second return value is the
3230      G, which is generator matrix used for this code.
3231
3232           MSG=[rand(10,11)>0.5];
3233           [C,G]=reedmullerenc(MSG,2,4);
3234
3235
3236    See also: reedmullerdec, reedmullergen
3237
3238
3239
3240
3241 # name: <cell-element>
3242 # type: sq_string
3243 # elements: 1
3244 # length: 73
3245 Definition type construction of Reed Muller code, of order R, length
3246 2^M.
3247
3248
3249
3250 # name: <cell-element>
3251 # type: sq_string
3252 # elements: 1
3253 # length: 13
3254 reedmullergen
3255
3256
3257 # name: <cell-element>
3258 # type: sq_string
3259 # elements: 1
3260 # length: 848
3261  -- Function File:  reedmullergen (R,M)
3262      Definition type construction of Reed Muller code, of order R,
3263      length 2^M. This function returns the generator matrix for the
3264      said order RM code.
3265
3266      RM(r,m) codes are characterized by codewords, `sum ( (m,0) + (m,1)
3267      + ... + (m,r)'.  Each of the codeword is got through spanning the
3268      space, using the finite set of m-basis codewords.  Each codeword
3269      is 2^M elements long.  see: Lin & Costello, "Error Control
3270      Coding", 2nd Ed.
3271
3272      Faster code constructions (also easier) exist, but since finding
3273      permutation order of the basis vectors, is important, we stick
3274      with the standard definitions. To use decoder function
3275      reedmullerdec,  you need to use this specific generator function.
3276
3277           G=reedmullergen(2,4);
3278
3279
3280    See also: reedmullerdec, reedmullerenc
3281
3282
3283
3284
3285 # name: <cell-element>
3286 # type: sq_string
3287 # elements: 1
3288 # length: 73
3289 Definition type construction of Reed Muller code, of order R, length
3290 2^M.
3291
3292
3293
3294 # name: <cell-element>
3295 # type: sq_string
3296 # elements: 1
3297 # length: 8
3298 ricedeco
3299
3300
3301 # name: <cell-element>
3302 # type: sq_string
3303 # elements: 1
3304 # length: 708
3305  -- Function File:  ricedeco (CODE, K)
3306      Returns the Rice decoded signal vector using CODE and K.
3307      Compulsory K is need to be specified.  A restrictions is that a
3308      signal set must strictly be non-negative.  The value of code is a
3309      cell array of row-vectors which have the encoded rice value for a
3310      single sample. The Rice algorithm is  used to encode the 'code'
3311      and only that can be meaningfully decoded. CODE is assumed to have
3312      been of format generated by the function `riceenco'.
3313
3314      Reference: Solomon Golomb, Run length Encodings, 1966 IEEE Trans
3315      Info' Theory
3316
3317      An exmaple of the use of `ricedeco' is
3318             ricedec(riceenco(1:4,2),2)
3319
3320    See also: riceenco
3321
3322
3323
3324
3325 # name: <cell-element>
3326 # type: sq_string
3327 # elements: 1
3328 # length: 56
3329 Returns the Rice decoded signal vector using CODE and K.
3330
3331
3332
3333 # name: <cell-element>
3334 # type: sq_string
3335 # elements: 1
3336 # length: 8
3337 riceenco
3338
3339
3340 # name: <cell-element>
3341 # type: sq_string
3342 # elements: 1
3343 # length: 1101
3344  -- Function File:  riceenco (SIG, K)
3345      Returns the Rice encoded signal using K or optimal K .  Default
3346      optimal K is chosen between 0-7. Currently no other way to
3347      increase the range except to specify explicitly. Also returns K
3348      parameter used (in case it were to be chosen optimally) and LTOT
3349      the total length of output code in bits.  This function uses a K
3350      if supplied or by default chooses the optimal K for encoding
3351      signal vector into a rice coded vector.  A restrictions is that a
3352      signal set must strictly be non-negative.  The Rice algorithm is
3353      used to encode the data into unary coded quotient part which is
3354      represented as a set of 1's separated from the K-part (binary)
3355      using a zero. This scheme doesnt need any kind of dictionaries and
3356      its close to O(N), but this implementation *may be* sluggish,
3357      though correct.
3358
3359      Reference: Solomon Golomb, Run length Encodings, 1966 IEEE Trans
3360      Info' Theory
3361
3362      An exmaple of the use of `riceenco' is
3363             riceenco(1:4) #
3364             riceenco(1:10,2) #
3365
3366    See also: ricedeco
3367
3368
3369
3370
3371 # name: <cell-element>
3372 # type: sq_string
3373 # elements: 1
3374 # length: 54
3375 Returns the Rice encoded signal using K or optimal K .
3376
3377
3378
3379 # name: <cell-element>
3380 # type: sq_string
3381 # elements: 1
3382 # length: 7
3383 rledeco
3384
3385
3386 # name: <cell-element>
3387 # type: sq_string
3388 # elements: 1
3389 # length: 422
3390  -- Function File:  rledeco (MESSAGE)
3391      Returns decoded run-length MESSAGE.  The RLE encoded MESSAGE has
3392      to be in the form of a row-vector. The message format (encoded
3393      RLE) is like  repetition [factor, value]+.
3394
3395      An example use of `rledeco' is
3396                    message=[1 5 2 4 3 1];
3397                    rledeco(message) #gives
3398                    ans = [    5   4   4   1   1   1]
3399
3400    See also: rledeco
3401
3402
3403
3404
3405 # name: <cell-element>
3406 # type: sq_string
3407 # elements: 1
3408 # length: 35
3409 Returns decoded run-length MESSAGE.
3410
3411
3412
3413 # name: <cell-element>
3414 # type: sq_string
3415 # elements: 1
3416 # length: 7
3417 rleenco
3418
3419
3420 # name: <cell-element>
3421 # type: sq_string
3422 # elements: 1
3423 # length: 468
3424  -- Function File:  rleenco (MESSAGE)
3425      Returns  run-length encoded MESSAGE. The rle form is built from
3426      MESSAGE. The original MESSAGE has to be in the form of a
3427      row-vector. The encoded MESSAGE format (encoded RLE) is like
3428      [repetition factor]+, values.
3429
3430      An example use of `rleenco' is
3431                    message=[    5   4   4   1   1   1]
3432                    rleenco(message) #gives
3433                    ans = [1 5 2 4 3 1];
3434
3435    See also: rleenco
3436
3437
3438
3439
3440 # name: <cell-element>
3441 # type: sq_string
3442 # elements: 1
3443 # length: 36
3444 Returns  run-length encoded MESSAGE.
3445
3446
3447
3448 # name: <cell-element>
3449 # type: sq_string
3450 # elements: 1
3451 # length: 7
3452 rsdecof
3453
3454
3455 # name: <cell-element>
3456 # type: sq_string
3457 # elements: 1
3458 # length: 832
3459  -- Function File:  rsdecof (IN,OUT)
3460  -- Function File:  rsdecof (IN,OUT,T)
3461      Decodes an ascii file using a Reed-Solomon coder. The input file is
3462      defined by IN and the result is written to the output file OUT.
3463      The type of coding to use is determined by whether the input file
3464      is 7- or 8-bit. If the input file is 7-bit, the default coding is
3465      [127,117].  while the default coding for an 8-bit file is a [255,
3466      235]. This allows for 5 or 10 error characters in 127 or 255
3467      symbols to be corrected respectively. The number of errors that
3468      can be corrected can be overridden by the variable T.
3469
3470      If the file is not an integer multiple of the message size (127 or
3471      255) in length, then the file is padded with the EOT (ascii
3472      character 4) character before decoding.
3473
3474
3475    See also: rsencof
3476
3477
3478
3479
3480 # name: <cell-element>
3481 # type: sq_string
3482 # elements: 1
3483 # length: 49
3484 Decodes an ascii file using a Reed-Solomon coder.
3485
3486
3487
3488 # name: <cell-element>
3489 # type: sq_string
3490 # elements: 1
3491 # length: 7
3492 rsencof
3493
3494
3495 # name: <cell-element>
3496 # type: sq_string
3497 # elements: 1
3498 # length: 1070
3499  -- Function File:  rsencof (IN,OUT)
3500  -- Function File:  rsencof (IN,OUT,T)
3501  -- Function File:  rsencof (...,PAD)
3502      Encodes an ascii file using a Reed-Solomon coder. The input file is
3503      defined by IN and the result is written to the output file OUT.
3504      The type of coding to use is determined by whether the input file
3505      is 7- or 8-bit. If the input file is 7-bit, the default coding is
3506      [127,117].  while the default coding for an 8-bit file is a [255,
3507      235]. This allows for 5 or 10 error characters in 127 or 255
3508      symbols to be corrected respectively. The number of errors that
3509      can be corrected can be overridden by the variable T.
3510
3511      If the file is not an integer multiple of the message size (127 or
3512      255) in length, then the file is padded with the EOT (ascii
3513      character 4) characters before coding. Whether these characters
3514      are written to the output is defined by the PAD variable. Valid
3515      values for PAD are "pad" (the default) and "nopad", which write or
3516      not the padding respectively.
3517
3518
3519    See also: rsdecof
3520
3521
3522
3523
3524 # name: <cell-element>
3525 # type: sq_string
3526 # elements: 1
3527 # length: 49
3528 Encodes an ascii file using a Reed-Solomon coder.
3529
3530
3531
3532 # name: <cell-element>
3533 # type: sq_string
3534 # elements: 1
3535 # length: 9
3536 rsgenpoly
3537
3538
3539 # name: <cell-element>
3540 # type: sq_string
3541 # elements: 1
3542 # length: 1634
3543  -- Function File: G =  rsgenpoly (N,K)
3544  -- Function File: G =  rsgenpoly (N,K,P)
3545  -- Function File: G =  rsgenpoly (N,K,P,B,S)
3546  -- Function File: G =  rsgenpoly (N,K,P,B)
3547  -- Function File: [G, T] =  rsgenpoly (...)
3548      Creates a generator polynomial for a Reed-Solomon coding with
3549      message length of K and codelength of N. N must be greater than K
3550      and their difference must be even. The generator polynomial is
3551      returned on G as a polynomial over the Galois Field GF(2^M) where
3552      N is equal to `2^M-1'. If M is not integer the next highest
3553      integer value is used and a generator for a shorten Reed-Solomon
3554      code is returned.
3555
3556      The elements of G represent the coefficients of the polynomial in
3557      descending order. If the length of G is lg, then the generator
3558      polynomial is given by
3559
3560           G(0) * x^(lg-1) + G(1) * x^(lg-2) + ... + G(lg-1) * x + G(lg).
3561
3562      If P is defined then it is used as the primitive polynomial of the
3563      the Galois Field GF(2^M). The default primitive polynomial will be
3564      used if P is equal to [].
3565
3566      The variables B and S determine the form of the generator
3567      polynomial in the following manner.
3568
3569           G = (X - A^(B*S)) * (X - A^((B+1)*S)) * ... * (X - A^((B+2*T-1)*S)).
3570
3571      where T is `(N-K)/2', and A is the primitive element of the Galois
3572      Field. Therefore B is the first consecutive root of the generator
3573      polynomial and S is the primitive element to generate the the
3574      polynomial roots.
3575
3576      If requested the variable T, which gives the error correction
3577      capability of the the Reed-Solomon code
3578
3579    See also: gf, rsenc, rsdec
3580
3581
3582
3583
3584 # name: <cell-element>
3585 # type: sq_string
3586 # elements: 1
3587 # length: 80
3588 Creates a generator polynomial for a Reed-Solomon coding with message
3589 length of 
3590
3591
3592
3593 # name: <cell-element>
3594 # type: sq_string
3595 # elements: 1
3596 # length: 11
3597 scatterplot
3598
3599
3600 # name: <cell-element>
3601 # type: sq_string
3602 # elements: 1
3603 # length: 1438
3604  -- Function File:  scatterplot (X)
3605  -- Function File:  scatterplot (X,N)
3606  -- Function File:  scatterplot (X,N,OFF)
3607  -- Function File:  scatterplot (X,N,OFF,STR)
3608  -- Function File:  scatterplot (X,N,OFF,STR,H)
3609  -- Function File: H = scatterplot (...)
3610      Display the scatter plot of a signal. The signal X can be either in
3611      one of three forms
3612
3613     A real vector
3614           In this case the signal is assumed to be real and represented
3615           by the vector X. The scatterplot is plotted along the x axis
3616           only.
3617
3618     A complex vector
3619           In this case the in-phase and quadrature components of the
3620           signal are plotted seperately on the x and y axes
3621           respectively.
3622
3623     A matrix with two columns
3624           In this case the first column represents the in-phase and the
3625           second the quadrature components of a complex signal and are
3626           plotted on the x and y axes respectively.
3627
3628      Each point of the scatter plot is assumed to be seperated by N
3629      elements in the signal. The first element of the signal to plot is
3630      determined by OFF. By default N is 1 and OFF is 0.
3631
3632      The string STR is a plot style string (example 'r+'), and by
3633      default is the default gnuplot point style.
3634
3635      The figure handle to use can be defined by H. If H is not given,
3636      then the next available figure handle is used. The figure handle
3637      used in returned on HOUT.
3638
3639    See also: eyediagram
3640
3641
3642
3643
3644 # name: <cell-element>
3645 # type: sq_string
3646 # elements: 1
3647 # length: 37
3648 Display the scatter plot of a signal.
3649
3650
3651
3652 # name: <cell-element>
3653 # type: sq_string
3654 # elements: 1
3655 # length: 15
3656 shannonfanodeco
3657
3658
3659 # name: <cell-element>
3660 # type: sq_string
3661 # elements: 1
3662 # length: 1012
3663  -- Function File:  shannonfanodeco (HCODE,DICT)
3664      Returns the original signal that was Shannonfano encoded. The
3665      signal was encoded using `shannonfanoenco'. This function uses a
3666      dict built from the `shannonfanodict' and uses it to decode a
3667      signal list into a shannonfano list. Restrictions include hcode is
3668      expected to be a binary code; returned signal set that strictly
3669      belongs in the `range [1,N]', with `N=length(dict)'. Also dict can
3670      only be from the `shannonfanodict(...)' routine. Whenever decoding
3671      fails, those signal values are indicated by -1, and we successively
3672      try to restart decoding from the next bit that hasnt failed in
3673      decoding, ad-infinitum.
3674
3675      An example use of `shannonfanodeco' is
3676                    hd=shannonfanodict(1:4,[0.5 0.25 0.15 0.10])
3677                    hcode=shannonfanoenco(1:4,hd) #  [ 1   0   1   0   0   0   0   0   1 ]
3678                    shannonfanodeco(hcode,hd) # [1 2 3 4]
3679
3680    See also: shannonfanoenco, shannonfanodict
3681
3682
3683
3684
3685 # name: <cell-element>
3686 # type: sq_string
3687 # elements: 1
3688 # length: 57
3689 Returns the original signal that was Shannonfano encoded.
3690
3691
3692
3693 # name: <cell-element>
3694 # type: sq_string
3695 # elements: 1
3696 # length: 15
3697 shannonfanodict
3698
3699
3700 # name: <cell-element>
3701 # type: sq_string
3702 # elements: 1
3703 # length: 654
3704  -- Function File:  shannonfanodict (SYMBOLS,SYMBOL_PROBABILITES)
3705      Returns the code dictionary for source using shanno fano algorithm.
3706      Dictionary is built from SYMBOL_PROBABILITIES using the shannon
3707      fano scheme.  Output is a dictionary cell-array, which are
3708      codewords, and correspond to the order of input probability.
3709
3710                    CW=shannonfanodict(1:4,[0.5 0.25 0.15 0.1]);
3711                    assert(redundancy(CW,[0.5 0.25 0.15 0.1]),0.25841,0.001)
3712                    shannonfanodict(1:5,[0.35 0.17 0.17 0.16 0.15])
3713                    shannonfanodict(1:8,[8 7 6 5 5 4 3 2]./40)
3714
3715    See also: shannonfanoenc, shannonfanodec
3716
3717
3718
3719
3720 # name: <cell-element>
3721 # type: sq_string
3722 # elements: 1
3723 # length: 67
3724 Returns the code dictionary for source using shanno fano algorithm.
3725
3726
3727
3728 # name: <cell-element>
3729 # type: sq_string
3730 # elements: 1
3731 # length: 15
3732 shannonfanoenco
3733
3734
3735 # name: <cell-element>
3736 # type: sq_string
3737 # elements: 1
3738 # length: 662
3739  -- Function File:  shannonfanoenco (HCODE,DICT)
3740      Returns the Shannon Fano encoded signal using DICT.  This function
3741      uses a DICT built from the `shannonfanodict' and uses it to encode
3742      a signal list into a shannon fano code.  Restrictions include a
3743      signal set that strictly belongs  in the `range [1,N]' with
3744      `N=length(dict)'. Also dict can only be from the
3745      `shannonfanodict()' routine.  An example use of `shannonfanoenco'
3746      is
3747
3748                    hd=shannonfanodict(1:4,[0.5 0.25 0.15 0.10])
3749                    shannonfanoenco(1:4,hd) #  [   0   1   0   1   1   0   1   1   1   0]
3750
3751    See also: shannonfanodeco, shannonfanodict
3752
3753
3754
3755
3756 # name: <cell-element>
3757 # type: sq_string
3758 # elements: 1
3759 # length: 51
3760 Returns the Shannon Fano encoded signal using DICT.
3761
3762
3763
3764 # name: <cell-element>
3765 # type: sq_string
3766 # elements: 1
3767 # length: 6
3768 symerr
3769
3770
3771 # name: <cell-element>
3772 # type: sq_string
3773 # elements: 1
3774 # length: 1568
3775  -- Function File: [NUM, RATE] =  symerr (A,B)
3776  -- Function File: [NUM, RATE] =  symerr (...,FLAG)
3777  -- Function File: [NUM, RATE IND] =  symerr (...)
3778      Compares two matrices and returns the number of symbol errors and
3779      the symbol error rate. The variables A and B can be either:
3780
3781     Both matrices
3782           In this case both matrices must be the same size and then by
3783           default the the return values NUM and RATE are the overall
3784           number of symbol errors and the overall symbol error rate.
3785
3786     One column vector
3787           In this case the column vector is used for symbol error
3788           comparision column-wise with the matrix. The returned values
3789           NUM and RATE are then row vectors containing the num of
3790           symbol errors and the symbol error rate for each of the
3791           column-wise comparisons. The number of rows in the matrix
3792           must be the same as the length of the column vector
3793
3794     One row vector
3795           In this case the row vector is used for symbol error
3796           comparision row-wise with the matrix. The returned values NUM
3797           and RATE are then column vectors containing the num of symbol
3798           errors and the symbol error rate for each of the row-wise
3799           comparisons. The number of columns in the matrix must be the
3800           same as the length of the row vector
3801
3802      This behaviour can be overridden with the variable FLAG. FLAG can
3803      take the value 'column-wise', 'row-wise' or 'overall'. A
3804      column-wise comparision is not possible with a row vector and
3805      visa-versa.
3806
3807
3808
3809
3810 # name: <cell-element>
3811 # type: sq_string
3812 # elements: 1
3813 # length: 80
3814 Compares two matrices and returns the number of symbol errors and the
3815 symbol err
3816
3817
3818
3819 # name: <cell-element>
3820 # type: sq_string
3821 # elements: 1
3822 # length: 11
3823 systematize
3824
3825
3826 # name: <cell-element>
3827 # type: sq_string
3828 # elements: 1
3829 # length: 729
3830  -- Function File:  systematize (G)
3831      Given G, extract P partiy check matrix. Assume row-operations in
3832      GF(2).  G is of size KxN, when decomposed through row-operations
3833      into a I of size KxK identity matrix, and a parity check matrix P
3834      of size Kx(N-K).
3835
3836      Most arbitrary code with a given generator matrix G, can be
3837      converted into its systematic form using this function.
3838
3839      This function returns 2 values, first is default being GX the
3840      systematic version of the G matrix, and then the parity check
3841      matrix P.
3842
3843             G=[1 1 1 1; 1 1 0 1; 1 0 0 1];
3844             [Gx,P]=systematize(G);
3845
3846             Gx = [1 0 0 1; 0 1 0 0; 0 0 1 0];
3847             P = [1 0 0];
3848
3849
3850    See also: bchpoly, biterr
3851
3852
3853
3854
3855 # name: <cell-element>
3856 # type: sq_string
3857 # elements: 1
3858 # length: 39
3859 Given G, extract P partiy check matrix.
3860
3861
3862
3863 # name: <cell-element>
3864 # type: sq_string
3865 # elements: 1
3866 # length: 7
3867 vec2mat
3868
3869
3870 # name: <cell-element>
3871 # type: sq_string
3872 # elements: 1
3873 # length: 376
3874  -- Function File: M =  vec2mat (V, C)
3875  -- Function File: M =  vec2mat (V, C, D)
3876  -- Function File: [M, ADD] =  vec2mat (...)
3877      Converts the vector V into a C column matrix with row priority
3878      arrangement and with the final column padded with the value D to
3879      the correct length. By default D is 0. The amount of padding added
3880      to the matrix is returned in ADD.
3881
3882
3883
3884
3885 # name: <cell-element>
3886 # type: sq_string
3887 # elements: 1
3888 # length: 80
3889 Converts the vector V into a C column matrix with row priority
3890 arrangement and w
3891
3892
3893
3894 # name: <cell-element>
3895 # type: sq_string
3896 # elements: 1
3897 # length: 3
3898 wgn
3899
3900
3901 # name: <cell-element>
3902 # type: sq_string
3903 # elements: 1
3904 # length: 1012
3905  -- Function File: Y = wgn (M,N,P)
3906  -- Function File: Y = wgn (M,N,P,IMP)
3907  -- Function File: Y = wgn (M,N,P,IMP,SEED,)
3908  -- Function File: Y = wgn (...,'TYPE')
3909  -- Function File: Y = wgn (...,'OUTPUT')
3910      Returns a M-by-N matrix Y of white Gaussian noise. P specifies the
3911      power of the output noise, which is assumed to be referenced to an
3912      impedance of 1 Ohm, unless IMP explicitly defines the impedance.
3913
3914      If SEED is defined then the randn function is seeded with this
3915      value.
3916
3917      The arguments TYPE and OUTPUT must follow the above numerial
3918      arguments, but can be specified in any order. TYPE specifies the
3919      units of P, and can be 'dB', 'dBW', 'dBm' or 'linear'. 'dB' is in
3920      fact the same as 'dBW' and is keep as a misnomer of Matlab. The
3921      units of 'linear' are in Watts.
3922
3923      The OUTPUT variable should be either 'real' or 'complex'. If the
3924      output is complex then the power P is divided equally betwen the
3925      real and imaginary parts.
3926
3927      See also: randn, awgn
3928
3929
3930
3931
3932
3933 # name: <cell-element>
3934 # type: sq_string
3935 # elements: 1
3936 # length: 50
3937 Returns a M-by-N matrix Y of white Gaussian noise.
3938
3939
3940
3941
3942