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.

Cbkn.m
f=[1:1025]/1025*15e6;
df=max(f)/1024;
psd1=-40;
psd2=-47.5;
psd3=-54.4;
psd4=-57.5;
psdwn=-140;
lpsdwn=10^(-140/10);
d=100/0.3048;
a3=8.17e-7;
b3=8.07e-11;
a4=7.37e-7;
b4=9.12e-12;
a5=7.26e-7;
b5=4.56e-12;
aq=6.77e-7;
bq=4.97e-11;
af=9.17e-7;
bf=4.87e-11;
he3=-(a3.*sqrt(f)+b3.*f).*328.*8.686;
he4=-(a4.*sqrt(f)+b4.*f).*328.*8.686;
he5=-(a5.*sqrt(f)+b5.*f).*328.*8.686;
heq=-(aq.*sqrt(f)+bq.*f).*328.*8.686;
hef=-(af.*sqrt(f)+bf.*f).*328.*8.686;
%Category 3
Sd1e3=10.^((psd1+he3)./10);
Sd2e3=10.^((psd2+he3)./10);
Sd3e3=10.^((psd3+he3)./10);
Sd4e3=10.^((psd4+he3)./10);
%Category 4
Sd1e4=10.^((psd1+he4)./10);
Sd2e4=10.^((psd2+he4)./10);
Sd3e4=10.^((psd3+he4)./10);
Sd4e4=10.^((psd4+he4)./10);
%Category 5
Sd1e5=10.^((psd1+he5)./10);
Sd2e5=10.^((psd2+he5)./10);
Sd3e5=10.^((psd3+he5)./10);
Sd4e5=10.^((psd4+he5)./10);
% Quad-22
Sd1eq=10.^((psd1+heq)./10);
Sd2eq=10.^((psd2+heq)./10);
Sd3eq=10.^((psd3+heq)./10);
Sd4eq=10.^((psd4+heq)./10);
% FW-26
Sd1ef=10.^((psd1+hef)./10);
Sd2ef=10.^((psd2+hef)./10);
Sd3ef=10.^((psd3+hef)./10);
Sd4ef=10.^((psd4+hef)./10);
figure(2)
plot(f,he3,'k',f,he4,'k',f,he5,'k',f,heq,'k',f,hef,'k')
%plot(f,he3,f,he4,f,he5,f,heq,f,hef,f,20*log10(abs(hq(1:1025))),f,20*log10(abs(hf(1:1025))))
grid
xlabel('Frequency (Hz)')
ylabel('Insertion Loss (dB)')
figure(3)
%Category 3
Cd0e3=9000*log2(1+Sd1e3/lpsdwn);
Cd1e3=zeros(1,1013);
fCd1e=f(5:1017);
for i=1:1013
   for j=i:i+11
      Cd1e3(i)=Cd1e3(i)+df*log2(1+Sd1e3(j)/lpsdwn);
   end
end
Cd2e3=zeros(1,957);
fCd2e=f(34:990);
for i=1:957
   for j=i:i+67
      Cd2e3(i)=Cd2e3(i)+df*log2(1+Sd2e3(j)/lpsdwn);
   end
end
Cd3e3=zeros(1,684);
fCd3e=f(171:854);
for i=1:684
   for j=i:i+340
      Cd3e3(i)=Cd3e3(i)+df*log2(1+Sd3e3(j)/lpsdwn);
   end
end
Cd4e3=zeros(1,343);
fCd4e=f(341:683);
for i=1:343
   for j=i:i+681
      Cd4e3(i)=Cd4e3(i)+df*log2(1+Sd4e3(j)/lpsdwn);
   end
end
%Category 4
Cd0e4=9000*log2(1+Sd1e4/lpsdwn);
Cd1e4=zeros(1,1013);
for i=1:1013
   for j=i:i+11
      Cd1e4(i)=Cd1e4(i)+df*log2(1+Sd1e4(j)/lpsdwn);
   end
end
Cd2e4=zeros(1,957);
for i=1:957
   for j=i:i+67
      Cd2e4(i)=Cd2e4(i)+df*log2(1+Sd2e4(j)/lpsdwn);
   end
end
Cd3e4=zeros(1,684);
for i=1:684
   for j=i:i+340
      Cd3e4(i)=Cd3e4(i)+df*log2(1+Sd3e4(j)/lpsdwn);
   end
end
Cd4e4=zeros(1,343);
for i=1:343
   for j=i:i+681
      Cd4e4(i)=Cd4e4(i)+df*log2(1+Sd4e4(j)/lpsdwn);
   end
end
%Category 5
Cd0e5=9000*log2(1+Sd1e5/lpsdwn);
Cd1e5=zeros(1,1013);
for i=1:1013
   for j=i:i+11
      Cd1e5(i)=Cd1e5(i)+df*log2(1+Sd1e5(j)/lpsdwn);
   end
end
Cd2e5=zeros(1,957);
for i=1:957
   for j=i:i+67
      Cd2e5(i)=Cd2e5(i)+df*log2(1+Sd2e5(j)/lpsdwn);
   end
end
Cd3e5=zeros(1,684);
for i=1:684
   for j=i:i+340
      Cd3e5(i)=Cd3e5(i)+df*log2(1+Sd3e5(j)/lpsdwn);
   end
end
Cd4e5=zeros(1,343);
for i=1:343
   for j=i:i+681
      Cd4e5(i)=Cd4e5(i)+df*log2(1+Sd4e5(j)/lpsdwn);
   end
end
%Quad 22
Cd0eq=9000*log2(1+Sd1eq/lpsdwn);
Cd1eq=zeros(1,1013);
for i=1:1013
   for j=i:i+11
      Cd1eq(i)=Cd1eq(i)+df*log2(1+Sd1eq(j)/lpsdwn);
   end
end
Cd2eq=zeros(1,957);
for i=1:957
   for j=i:i+67
      Cd2eq(i)=Cd2eq(i)+df*log2(1+Sd2eq(j)/lpsdwn);
   end
end
Cd3eq=zeros(1,684);
for i=1:684
   for j=i:i+340
      Cd3eq(i)=Cd3eq(i)+df*log2(1+Sd3eq(j)/lpsdwn);
   end
end
Cd4eq=zeros(1,343);
for i=1:343
   for j=i:i+681
      Cd4eq(i)=Cd4eq(i)+df*log2(1+Sd4eq(j)/lpsdwn);
   end
end
%FW-26
Cd0ef=9000*log2(1+Sd1ef/lpsdwn);
Cd1ef=zeros(1,1013);
for i=1:1013
   for j=i:i+11
      Cd1ef(i)=Cd1ef(i)+df*log2(1+Sd1ef(j)/lpsdwn);
   end
end
Cd2ef=zeros(1,957);
for i=1:957
   for j=i:i+67
      Cd2ef(i)=Cd2ef(i)+df*log2(1+Sd2ef(j)/lpsdwn);
   end
end
Cd3ef=zeros(1,684);
for i=1:684
   for j=i:i+340
      Cd3ef(i)=Cd3ef(i)+df*log2(1+Sd3ef(j)/lpsdwn);
   end
end
Cd4ef=zeros(1,343);
for i=1:343
   for j=i:i+681
      Cd4ef(i)=Cd4ef(i)+df*log2(1+Sd4ef(j)/lpsdwn);
   end
end
figure(1)
plot(f,Cd0e3,'k',f,Cd0e4,'k',f,Cd0e5,'k',f,Cd0eq,'k',f,Cd0ef,'k')
grid
xlabel('Frequency (dB)')
ylabel('Channel Capacity (Bit/Sec.)')
figure(2)
plot(fCd1e,Cd1e3,'k',fCd1e,Cd1e4,'k',fCd1e,Cd1e5,'k',fCd1e,Cd1eq,'k',fCd1e,Cd1ef,'k')
grid
xlabel('Frequency (dB)')
ylabel('Channel Capacity (Bit/Sec.)')
figure(3)
plot(fCd2e,Cd2e3,'k',fCd2e,Cd2e4,'k',fCd2e,Cd2e5,'k',fCd2e,Cd2eq,'k',fCd2e,Cd2ef,'k')
grid
xlabel('Frequency (dB)')
ylabel('Channel Capacity (Bit/Sec.)')
figure(4)
plot(fCd3e,Cd3e3,'k',fCd3e,Cd3e4,'k',fCd3e,Cd3e5,'k',fCd3e,Cd3eq,'k',fCd3e,Cd3ef,'k')
grid
xlabel('Frequency (dB)')
ylabel('Channel Capacity (Bit/Sec.)')
figure(5)
plot(fCd4e,Cd4e3,'k',fCd4e,Cd4e4,'k',fCd4e,Cd4e5,'k',fCd4e,Cd4eq,'k',fCd4e,Cd4ef,'k')
grid
xlabel('Frequency (dB)')
ylabel('Channel Capacity (Bit/Sec.)')

Contact us