Wednesday, November 7, 2012

CONVOLUTIONAL ENCODER in Matlab


-%CONVOLUTIONAL ENCODER
clear all;
clc
m=input('enter the message vector ');

x=input('enter the output vector1 ');
y=input('enter the output vector2 ');
z=input('enter the output vector3 ');
a=conv(m,x);
b=conv(m,y);
c=conv(m,z);
a1=rem(a,2);
b1=rem(b,2);
c1=rem(c,2);
a3=cat(1,a1,b1,c1);
a4=a3(:);
code=a4'

O/P –
enter the message vector [1 1 0 1 0 1 0 0]
enter the output vector1 [1 0 0]
enter the output vector2 [1 0 1]
enter the output vector3 [1 1 0]

No comments:

Post a Comment