Maximal length sequence generation.

Namespace: dsp::telecom

Prototype

BitStream code_mls(int n)

Parameters

nGenerating polynomial degree (must be between 1 and 16).

Description

This function generate a binary code of length \(m=2^n-1\), using a shift register and a primitive polynomial.

Example


  soit bs = code_mls(4);
  soit nrz = (bs.array() - 0.5) * 2;
  soit [lags, rl] = xcorrb(nrz);
  soit [lags2, rc] = ccorr(nrz);

  Figures f;
  f.subplot().plot(nrz, "|bo", "Code MLS - 15 bits");
  f.gcf().axes().supprime_decorations();
  f.subplot().plot(lags2, abs(rc), "r-o", "Auto-corrélation circulaire");
  f.subplot().plot(lags, abs(rl), "r-o", "Auto-corrélation linéaire");

See also

code_Barker()