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.

Cnext.m
f=[1:1025]/1025*15e6;
df=max(f)/1024;
hnpw=5.88e-12.*f.^1.5;
hn3=7.94e-14.*f.^1.5;
hn4=2.51e-15.*f.^1.5;
hn5=6.31e-16.*f.^1.5;
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
S3=10.^(he3./10);
%Category 4
S4=10.^(he4./10);
%Category 5
S5=10.^(he5./10);
% Quad-22
Sq=10.^(heq./10);
% FW-26
Sf=10.^(hef./10);
%Category 3
Cd0e3=9000*log2(1+S3./hn3);
Cd1e3=zeros(1,1013);
fCd1e=f(5:1017);
for i=1:1013
   for j=i:i+11
      Cd1e3(i)=Cd1e3(i)+df*log2(1+S3(j)/hn3(j));
   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+S3(j)/hn3(j));
   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+S3(j)/hn3(j));
   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+S3(j)/hn3(j));
   end
end
%Category 4
Cd0e4=9000*log2(1+S4./hn4);
Cd1e4=zeros(1,1013);
for i=1:1013
   for j=i:i+11
      Cd1e4(i)=Cd1e4(i)+df*log2(1+S4(j)/hn4(j));
   end
end
Cd2e4=zeros(1,957);
for i=1:957
   for j=i:i+67
      Cd2e4(i)=Cd2e4(i)+df*log2(1+S4(j)/hn4(j));
   end
end
Cd3e4=zeros(1,684);
for i=1:684
   for j=i:i+340
      Cd3e4(i)=Cd3e4(i)+df*log2(1+S4(j)/hn4(j));
   end
end
Cd4e4=zeros(1,343);
for i=1:343
   for j=i:i+681
      Cd4e4(i)=Cd4e4(i)+df*log2(1+S4(j)/hn4(j));
   end
end
%Category 5
Cd0e5=9000*log2(1+S5./hn5);
Cd1e5=zeros(1,1013);
for i=1:1013
   for j=i:i+11
      Cd1e5(i)=Cd1e5(i)+df*log2(1+S5(j)/hn5(j));
   end
end
Cd2e5=zeros(1,957);
for i=1:957
   for j=i:i+67
      Cd2e5(i)=Cd2e5(i)+df*log2(1+S5(j)/hn5(j));
   end
end
Cd3e5=zeros(1,684);
for i=1:684
   for j=i:i+340
      Cd3e5(i)=Cd3e5(i)+df*log2(1+S5(j)/hn5(j));
   end
end
Cd4e5=zeros(1,343);
for i=1:343
   for j=i:i+681
      Cd4e5(i)=Cd4e5(i)+df*log2(1+S5(j)/hn5(j));
   end
end
%Quad 22
Cd0eq=9000*log2(1+Sq./hnpw);
Cd1eq=zeros(1,1013);
for i=1:1013
   for j=i:i+11
      Cd1eq(i)=Cd1eq(i)+df*log2(1+Sq(j)/hnpw(j));
   end
end
Cd2eq=zeros(1,957);
for i=1:957
   for j=i:i+67
      Cd2eq(i)=Cd2eq(i)+df*log2(1+Sq(j)/hnpw(j));
   end
end
Cd3eq=zeros(1,684);
for i=1:684
   for j=i:i+340
      Cd3eq(i)=Cd3eq(i)+df*log2(1+Sq(j)/hnpw(j));
   end
end
Cd4eq=zeros(1,343);
for i=1:343
   for j=i:i+681
      Cd4eq(i)=Cd4eq(i)+df*log2(1+Sq(j)/hnpw(j));
   end
end
%FW-26
Cd0ef=9000*log2(1+Sf./hnpw);
Cd1ef=zeros(1,1013);
for i=1:1013
   for j=i:i+11
      Cd1ef(i)=Cd1ef(i)+df*log2(1+Sf(j)/hnpw(j));
   end
end
Cd2ef=zeros(1,957);
for i=1:957
   for j=i:i+67
      Cd2ef(i)=Cd2ef(i)+df*log2(1+Sf(j)/hnpw(j));
   end
end
Cd3ef=zeros(1,684);
for i=1:684
   for j=i:i+340
      Cd3ef(i)=Cd3ef(i)+df*log2(1+Sf(j)/hnpw(j));
   end
end
Cd4ef=zeros(1,343);
for i=1:343
   for j=i:i+681
      Cd4ef(i)=Cd4ef(i)+df*log2(1+Sf(j)/hnpw(j));
   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