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.

schannel.m
%fisrt block
r1=133;
r2=14;
r3=95.3;
r4=95.3;
r5=68.1;
r6=649;
l=5.6e-6;
c=560e-12;
[aa,ba,ca,da,adn]=sablockclc(r1,r2,l);
%aa=[5.6e-6 1.47e2];
%ba=[7.45e-4 1.86e3];
%ca=[0 0];
%da=[5.6e-6 1.47e2];
%adn=[5.6e-6 1.47e2];
aa=aa(2:3);
ba=ba(2:3);
ca=ca(2:3);
da=da(2:3);
adn=adn(2:3);
[ab,bb,cb,db,bdn]=sbblockclc(r3,r4,r5,r6,c);
%ab=[5.94e-5 8.12e2];
%bb=[8.02e-3 1.46e5];
%cb=[3.63e-7 1];
%db=[5.94e-5 8.12e2];
%bdn=[2.48e-5 7.17e2];
[A1,B1,C1,D1,Dn1]=sblockclc(aa,ba,ca,da,adn,ab,bb,cb,db,bdn);
%second block
r1=2320;
r2=1;
r3=95.3;
r4=95.3;
r5=3.83;
r6=11300;
l=0.68e-6;
c=68e-12;
[aa,ba,ca,da,adn]=sablockclc(r1,r2,l);
aa=aa(2:3);
ba=ba(2:3);
ca=ca(2:3);
da=da(2:3);
adn=adn(2:3);
%aa=[6.8e-7 2.32e3];
%ba=[1.58e-3 2.32e3];
%ca=[0 0];
%da=[6.8e-7 2.32e3];
%adn=[6.8e-7 2.32e3];
[ab,bb,cb,db,bdn]=sbblockclc(r3,r4,r5,r6,c);
%ab=[7.34e-5 1.14e4];
%bb=[7.52e-3 2.16e6];
%cb=[7.68e-7 1];
%db=[7.34e-5 1.14e4];
%bdn=[2.94e-6 1.13e4];
[A2,B2,C2,D2,Dn2]=sblockclc(aa,ba,ca,da,adn,ab,bb,cb,db,bdn);
%third block
r1=14000;
r2=1;
r3=95.3;
r4=95.3;
r5=1;
r6=10000;
l=0.82e-6;
c=82e-12;
[aa,ba,ca,da,adn]=sablockclc(r1,r2,l);
aa=aa(2:3);
ba=ba(2:3);
ca=ca(2:3);
da=da(2:3);
adn=adn(2:3);
%aa=[8.2e-7 1.4e4];
%ba=[1.15e-2 1.4e4];
%ca=[0 0];
%da=[8.2e-7 1.4e4];
%adn=[8.2e-7 1.4e4];
[ab,bb,cb,db,bdn]=sbblockclc(r3,r4,r5,r6,c);
%ab=[7.81e-5 1.01e4];
%bb=[7.6e-3 1.92e6];
%cb=[8.2e-7 1];
%db=[7.81e-5 1.01e4];
%bdn=[8.2e-7 1.0e4];
[A3,B3,C3,D3,Dn3]=sblockclc(aa,ba,ca,da,adn,ab,bb,cb,db,bdn);
%fourth block
r1=22600;
r2=1;
r3=95.3;
r4=95.3;
r5=0;
r6=11800;
l=0.82e-6;
c=82e-12;
[aa,ba,ca,da,adn]=sablockclc(r1,r2,l);
aa=aa(2:3);
ba=ba(2:3);
ca=ca(2:3);
da=da(2:3);
adn=adn(2:3);
%aa=[8.2e-7 2.26e4];
%ba=[1.85e-2 2.26e4];
%ca=[0 0];
%da=[8.2e-7 2.26e4];
%adn=[8.2e-7 2.26e4];
[ab,bb,cb,db,bdn]=sbblockclc(r3,r4,r5,r6,c);
%ab=[9.18e-5 1.19e4];
%bb=[8.75e-3 2.26e6];
%cb=[9.68e-7 1];
%db=[9.18e-5 1.19e4];
%bdn=[0 1.18e4];
[A4,B4,C4,D4,Dn4]=sblockclc(aa,ba,ca,da,adn,ab,bb,cb,db,bdn);
a12=conv(A1,A2)+conv(B1,C2);
b12=conv(A1,B2)+conv(B1,D2);
c12=conv(C1,A2)+conv(D1,C2);
d12=conv(C1,B2)+conv(D1,D2);
dn12=conv(Dn1,Dn2);
a123=conv(a12,A3)+conv(b12,C3);
b123=conv(a12,B3)+conv(b12,D3);
c123=conv(c12,A3)+conv(d12,C3);
d123=conv(c12,B3)+conv(d12,D3);
dn123=conv(dn12,Dn3);
a1234=conv(a123,A4)+conv(b123,C4);
b1234=conv(a123,B4)+conv(b123,D4);
c1234=conv(c123,A4)+conv(d123,C4);
d1234=conv(c123,B4)+conv(d123,D4);
dn1234=conv(dn123,Dn4);
f=[1:200]/200*20e6;
hsn=200*dn1234;
hsd=100*100*c1234+100*d1234+100*a1234+b1234;
h=freqs(hsn,hsd,2*pi*f);
figure(1)
plot(f,20*log10(abs(h)))
grid
xlabel('Frequency (Hz)')
ylabel('Magnitude (dB)')

Contact us