Main Content

Generate Gold Code Sequence

Generate the same Gold code sequences using two PN Sequence Generator blocks or one Gold Sequence Generator block.

Two PN Sequence Generator blocks and one Gold code sequence block are configured to output the gold sequence resulting from preferred polynomials $x^5+x^2+1$ and $x^5+x^4+x^3+x^2+1$. For the PN Sequence Generator blocks, an XOR block combines the output and saves the resulting sequence to the workspace variable out.pn_seq_xor. The Gold Sequence Generator block saves its output sequence to the workspace variable out.gold_seq.

Run the model and compare the outputs.

The XORd PN sequence output is:

pn_seq_xor =

     0     0     0     0     0     0     1     0     1     1     1

The Gold sequence output is:

gold_seq =

     0     0     0     0     0     0     1     0     1     1     1

To explore further, change the Sequence index parameter in the Gold Sequence Generator block and add a delay for the second PN Sequence Generator block.

See Also