Professional Documents
Culture Documents
DC Lab 01
DC Lab 01
DC Lab 01
SOFTWARE ENGINEERING
COLLEGE OF E&ME, NUST,
RAWALPINDI
Lab Number 08
Submitted By:
Affra Nazir
CE 41 A
325292
LAB TASKS:
Task 1:
Generate random (uniform distributed) binary numbers with length 100000. Do the pulse
modulation by representing each bit (pulse) by 10 numerical values using the following line
codes:
1. NRZ-L
2. RZ-L (Bipolar-RZ)
3. Bi-Phase-L
4. RZ-AMI
The maximum magnitude of the pulse should be 1 and minimum should be -1.
Plot the waveform time[sec] vs amplitude[volts] to show the set pattern of respective pulses of
above-mentioned encoding schemes.
NRZ-L:
% Generate random binary numbers
binary_numbers = [1,1,1,0,0,0,1,0,1,1]
RZ-L (Bipolar-RZ)
CODE;
% Generate a random binary sequence of length 100000
binary_seq = [1,1,0,0,1,0,0,0,1,0];
output:
Bi-Phase-L
Code:
% Generate random binary numbers with length 10
bits = randi([0 1], 1, 10);
RZ-AMI:
Code:
% Generate random binary numbers
binaryData = [1,0,1,0,1,0,1,0,1,0]