No BSD License  

Highlights from
Home Networking Basis

Home Networking Basis

by

 

11 Aug 2003 (Updated )

M-files for chapters 2-10 and Simulink models for Ethernet and Wireless Ethernet.

[A1,B1,C1,D1,Dn1]=sblockclc(aa,ba,ca,da,adn,ab,bb,cb,db,bdn);
function [A1,B1,C1,D1,Dn1]=sblockclc(aa,ba,ca,da,adn,ab,bb,cb,db,bdn);
%Parallel matrix calculation
bapbb=conv(ba,bdn)+conv(bb,adn);
capcb=conv(ca,bdn)+conv(cb,adn);
aamab=conv(aa,bdn)-conv(ab,adn);
damdb=conv(da,bdn)-conv(db,adn);
babb=conv(ba,bb);
badbdabb=conv(ba,db)+conv(da,bb);
aabbpbaab=conv(aa,bb)+conv(ba,ab);
abdn=conv(adn,bdn);
dn1=conv(bapbb,abdn);
c1=conv(bapbb,capcb)-conv(aamab,damdb);
a1=conv(aabbpbaab,abdn);
b1=conv(babb,abdn);
d1=conv(badbdabb,abdn);
%remove zeros at the highest order
if a1(1)==0
    a1=a1(2:length(a1));
    b1=b1(2:length(b1));
    c1=c1(2:length(c1));
    d1=d1(2:length(d1));
    dn1=dn1(2:length(dn1));
end
%remove common roots
a1norm=a1(1);
b1norm=b1(1);
c1norm=c1(1);
d1norm=d1(1);
dn1norm=dn1(1);
a1n=a1/a1norm;
b1n=b1/b1norm;
c1n=c1/c1norm;
d1n=d1/d1norm;
dn1n=dn1/dn1norm;
rtn=roots(a1n);
rtd=roots(dn1n);
n=0;
for i=1:length(rtn)
    for j=1:length(rtd)
        if abs((rtn(i)-rtd(j))/rtn(i))<1e-4
            n=n+1;
            compoly(n,:)=[1 -rtn(i)];
        end
    end
end      
for i=1:n
    a1n=deconv(a1n,compoly(i,:));
    b1n=deconv(b1n,compoly(i,:));
    c1n=deconv(c1n,compoly(i,:));
    d1n=deconv(d1n,compoly(i,:));
    dn1n=deconv(dn1n,compoly(i,:));
end
A1=a1n*a1norm;
B1=b1n*b1norm;
C1=c1n*c1norm;
D1=d1n*d1norm;
Dn1=dn1n*dn1norm;

Contact us