0% found this document useful (0 votes)
17 views

Lab 8

Uploaded by

Mudasser Ahmad
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
17 views

Lab 8

Uploaded by

Mudasser Ahmad
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

Page 1 of 2

Lab#8 Reg# 15PWELE4695

SCRAMBLING TECHNIQUE

Code:

function [ ] = myami( my_data )


%%ami with B8ZS
% 1-->alternate +a and -a
% 0-->0 volts
%8 consecutiove zeros are replaced by 000VB0VB
my_data=input('enter data: ');
a=-3;
amplitude=0;
count=0;
% mapping
for i = 1 : length (my_data)
if my_data(i)==1
amplitude(i)=-a;
a=-a;
count=0;
else
amplitude(i)=0;
count=count+1;
if count ==8;
amplitude(i-7:i)=[0 0 0 a -a 0 -a a];
end
end
end
amplitude;

%pulse shapping
t= 0:0.01:length(my_data);
signal=0;
i=1;
for j=1:length(t)
if t(j)<i
signal(j)=amplitude(i);
else
signal(j)=amplitude(i);
Page 2 of 2

i=i+1;
end
end

%plotting

plot(t,signal);
axis([0 length(my_data) -4 4])

Output:
>> myami
enter data: [1 0 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 0 0]

You might also like