Introduction to OptiSystem – How To Use The Pseudo-Random Bit Sequence Generator

Compatibility:

In this OptiSystem introductory tutorial video, we will learn how to set up the pseudo-random bit generator.

About The Component

The generator can be used to create a binary sequence of pseudo-random bits. This bit sequence can be connected to a binary sequence visualizer so that the output sequence can be seen.

Double-clicking the block shows its main properties. By double-clicking beside the bit rate, we can change the block’s bit rate to base it on other parameters or to make it get its value from a function. Pressing Evaluate, we can see the current bit rate value. If we want to change the value of the bit rate defined for the entire project, we can double-click on our workspace, and the global parameters window will pop up. 

The project’s bit rate, as well as other parameters in the pseudo-random bit sequence generator, may be changed in the global parameters window. Now, returning to the bit sequence generator and pressing Evaluate Script, we can see that the bit rate has been updated. 

With the operation mode on Probability, the bit sequence generator will generate a random output, and the probability of generating a 1 will be based on the Mark probability. The length of the sequence generated will be equal to that of the global parameter sequence length.

Testing

Before we test out the pseudo-random bit generator we set up, I will change the number of leading and trailing zeros so we can easily observe the output. As you can see, the output of the pseudo-random bit sequence generator reflected a 0.5 probability of generating a 1 at the output.

Now, I would like to change the mark probability to something lower. After calculating the project a couple of times and looking at the visualizer, we can see that the probability of generating a 1 is now much lower.

Changing Seeds

Going back into the bit sequence generator and going into the random numbers tab we can choose to either generate a random seed each time or define our seed. A Seed is a number used to initialize a pseudo-random bit sequence generator. So if we unchecked the Generate Random Seed box and instead choose our own random seed index, this means every time we run the random generator, we should receive the same set of random numbers because the seed used to generate them is the same.

Running the program twice the result is as expected. The set of random bits is the same because we used the same seed both times after setting up the pseudo-random bit generator. Going back to select the Generate Random Seed box again, we should expect that this time, the result will be different because we are not using the same seed. The other iteration boxes can be used to generate a different random seed each time the pseudo-random bit sequence generator runs for multiple iterations. 

Upon calculating the project, we can see that the result is different this time because the seed we are using has changed. 

Returning to the bit sequence generator and changing the operation mode to Order will cause the pseudo-random generator to generate a random bit sequence with a period of 2 to the power of the order minus 1.

Clicking on Order can change the value to make it dependent on other layout parameters. Pressing Evaluate, we can see its current value. We can now calculate the project and check the binary sequence visualizer to see the output. Here are a few possible scenarios:

  • By changing the output range to a larger number, we can see that the sequence ends at 1024 bits. 
  • Given an order of 10 means that the sequence period would be equal to 1023 bits. 
  • Returning to the pseudo-random bit sequence generator and changing the operation mode to alternate will cause the output sequence to alternate between ones and zeroes. 
  • Changing the operation mode to ones will cause it to output all ones. 
  • Changing the operation mode to zeros will cause it to output all zeroes.

Explore OptiSystem

This pseudo-random bit generator setup is just a glimpse of this software’s many versatile applications. From designing small-scale networks for localized research to simulating massive fiber optic network deployments, everything’s possible with OptiSystem. Explore OptiSystem and its many applications today.

Ready to try out this tutorial yourself? Get full access to OptiSystem and other OptiSystem tools with our free 30-day evaluation