# Home Networking Basis

### Walter Chen (view profile)

11 Aug 2003 (Updated )

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

schannel2.m
```%fisrt block
r1=20.5+20.5;
r2=0.75+0.75;
r3=50+50;
r4=50+50;
r5=243;
r6=6650;
l=3.5e-6+3.5e-6;
c=680e-12;
aa=aa(2:3);
ba=ba(2:3);
ca=ca(2:3);
da=da(2:3);
[ab,bb,cb,db,bdn]=sbblockclc(r3,r4,r5,r6,c);
%second block
r1=43.2+43.2;
r2=0.75+0.75;
r3=50+50;
r4=50+50;
r5=118;
r6=6650;
l=1e-6+1e-6;
c=220e-12;
aa=aa(2:3);
ba=ba(2:3);
ca=ca(2:3);
da=da(2:3);
[ab,bb,cb,db,bdn]=sbblockclc(r3,r4,r5,r6,c);
%third block
r1=1e9;
r2=0.75+0.75;
r3=50+50;
r4=50+50;
r5=0;
r6=6810;
l=0.43e-6+0.43e-6;
c=82e-12;
aa=aa(2:3);
ba=ba(2:3);
ca=ca(2:3);
da=da(2:3);
[ab,bb,cb,db,bdn]=sbblockclc(r3,r4,r5,r6,c);
%fourth block
r1=1e9;
r2=0.75+0.75;
r3=50+50;
r4=50+50;
r5=0;
r6=6810;
l=0.43e-6+0.43e-6;
c=100e-12;
aa=aa(2:3);
ba=ba(2:3);
ca=ca(2:3);
da=da(2:3);
[ab,bb,cb,db,bdn]=sbblockclc(r3,r4,r5,r6,c);
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;
f=[1:256]/256*25e6;
hsn=200*dn1234;
hsd=100*100*c1234+100*d1234+100*a1234+b1234;
hnorm=hsn(9);
hsn=hsn/hnorm;
hsd=hsd/hnorm;
h=freqs(hsn,hsd,2*pi*f);
figure(1)
plot(f,20*log10(abs(h)))
grid
xlabel('Frequency (Hz)')
ylabel('Magnitude (dB)')
```