Scilab & ScicosLab – Random Data Coding

Introduction

Scilab and ScicosLab are Open Source Math Programs that can be used in various engineering and scientific applications. I use ScicosLab with the Modnum tool box in all my Telecommunications work, but both Scilab/ScicosLab can be used for basic mathematics operations. In previous posts (Ref.1/7), I introduced the programs and how to perform basic operations such as the console, editor, wav files, structures and visual blocks. In this post I look at how to create random data to be used in studying modems built in Scicos.

ScicosLab Random Data NRZ, NRZI, Bipolar Mark/Space

Fig.2 Random Data, NRZ, NRZI, Bipolar Mark/Space
Fig.3 NRZ, NRZI, Bipolar Structures Read into Scicos

Figure 1 shows the ScicosLab code in the editor to create a random data stream in NRZ, NRZI and Bipolar for Mark/Space formats. The ‘rand’ function is used to create a row vector of 2048 entries. Then ’round’ is used to map this into either 0 or 1, hence 2048 random bits. This will become the NRZ waveform. Next we modify this to NRZI, where the rule is that if the data bit is a ‘1’, then flip the bit, if the bit is ‘0’, then no change. The NRZI waveform bit 1 is set to a ‘0’ to start. Finally the NRZI is modified to map the [0,1] to [-1,1] for Bipolar. As it stands these bits would just show as points, so we next create 10 copies of each bit. Then structures are created (Ref.3) and the results plotted Figure 2. The structures can be read into Scicos as shown in Figure 3 and used in various modem implementations.

Fig.4 YouTube Video Scilab & ScicosLab – Random Data Coding

Please send your comments, questions and suggestions to:
contact:

YouTube Channel
YouTube Channel

References

#1. – “Scilab & ScicosLab – Scicos Visual Blocks”

#2. – “Scilab & ScicosLab – WAV Files”

#3. – “Scilab & ScicosLab – Structures”

#4. – “Scilab & ScicosLab – Graphs”

#5. – “Scilab & ScicosLab – Open Source Math for the Spherical Triangle”

#6. – “Scilab & ScicosLab – Open Source Math for the Plane Triangle”

#7. – “Scilab & ScicosLab – Open Source Math for CelNav”

#8. – “Scilab Open Source Software”

#9. – ScicosLab Open Source Software

By Jeremy Clark

Jeremy Clark is a Senior Telecommunications Engineer and Advanced Amateur Radio Operator VE3PKC. He is the author of E-Books on Telecommunications, Navigation & Electronics.