//code for Bipolar AMI
clc;
clear;
x=[0 1 0 1 0 0 0 1 1 0 1 1 0 0 0 1];
T=length(x);
n=200;
N=n*T;
dt=T/N;
pulse=-1;
t=0:dt:T;
y=zeros(1,length(t));
for i=0:T-1;
if x(i+1)==1
if pulse==-1
y(i*n+1 : (i+1)*n)=-1;
else
pulse=1;
y(i*n+1 : (i+1)*n)=1;
end;
else
y(i*n+1 : (i+1)*n)=0;
end;
end;
plot(t,y);
axis([0 t(end) -2 2]);
grid on;
title('Bipolar AMI');
//end;
//the output is like this :-
clc;
clear;
x=[0 1 0 1 0 0 0 1 1 0 1 1 0 0 0 1];
T=length(x);
n=200;
N=n*T;
dt=T/N;
pulse=-1;
t=0:dt:T;
y=zeros(1,length(t));
for i=0:T-1;
if x(i+1)==1
if pulse==-1
y(i*n+1 : (i+1)*n)=-1;
else
pulse=1;
y(i*n+1 : (i+1)*n)=1;
end;
else
y(i*n+1 : (i+1)*n)=0;
end;
end;
plot(t,y);
axis([0 t(end) -2 2]);
grid on;
title('Bipolar AMI');
//end;
//the output is like this :-
this is the output of given input |
I think the output has a wrong transition, because that i've known, bipolar AMI has a different transition. As i know, the output will make transition if bit meet 1. And transition will change if the bit 1 meet other bit 1. And in the transition, there is a different side. I mean, if the first bit 1 make transition on negative side, then the second bit 1 will make transition in positive side.. But your blog still give benefit to me.. So i just want to say thanks...
ReplyDeleteGiven a waveform (input in the form of voltage levels), that belongs to Bipolar Pseudo ternary, determine the beginning and end of the bit periods (i.e. extract clock information) and give the data sequence. Record your results. Plot graphs to substantiate your recorded observations.
ReplyDeletecan i get answer for this question. it's urgent