Home > Articles

  • Print
  • + Share This
This chapter is from the book

3.9 MATLAB Files

3.9.1 Coaxial Cable Insertion Loss and Impulse Response Models

function [ht,h]=abcd2hcx(a,b,c,d);
d=a;
r=75;
sz=length(a);
h=2*r*ones(sz,1)./(r*(r*c+d)+(r*a+b));
h(sz+1:2*(sz-1))=real(h(sz-1:-1:2))-sqrt(-1)*imag(h(sz-1:-1:2));
ht=real(ifft(h));

3.9.2 Splitter Input-to-Output Model

function [a,b,c,d]=splitio(f,z0);
l1=4e-5;
l2=1e-7;
k1=0.9997;
k2=0.9997;
a=0.707;
r=220;
C=4.5e-12;
lf=length(f);
W=2*pi*f';
a10=ones(lf,1)/a/k1;
b10=j*W*l1*a*(1-k1^2)/k1;
c10=ones(lf,1)./(j*W*l1*a*k1);
d10=ones(lf,1)*a/k1;
a3=ones(lf,1);
b3=zeros(lf,1);
c3=j*C*W;
d3=a3;
a1=a10.*a3+b10.*c3;
b1=a10.*b3+b10.*d3;
c1=c10.*a3+d10.*c3;
d1=c10.*b3+d10.*d3;
a2=j*W*l2*(2*(1+k2)*z0+r)+r*z0-(1-k2^2)*W.^2*l2^2;
b2=j*W*l2*r*z0-(1-k2^2)*W.^2*l2^2*(r+z0);
c2=2*j*W*l2*(1+k2)+r;
d2=2*j*W*l2*(1+k2)*(r+z0)+r*z0;
a=a1.*a2+b1.*c2;
b=a1.*b2+b1.*d2;
c=c1.*a2+d1.*c2;
d=c1.*b2+d1.*d2;
delt=j*W*l2*(1+k2)*(r+2*z0)+r*z0;
a=a./delt;
b=b./delt;
c=c./delt;
d=d./delt;

3.9.3 Splitter Output-to-Output Model

function [a,b,c,d]=splitoo(f,z1);
l1=4e-5;
l2=1e-7;
k1=0.9997;
k2=0.9997;
a=0.707;
r=220;
C=4.5e-12;
lf=length(f);
W=2*pi*f';
zm=a^2*z1;
a1=zm+j*W*l2;
b1=j*W*l2*(1+k2).*(j*W*l2*(1-k2)+2*zm);
c1=ones(lf,1);
d1=zm+j*W*l2;
a=b1+a1*r;
b=r*b1;
c=C*(r+b1)-(1-a1).^2;
d=b1+a1*r;
delt=r+b1;
a=a./delt;
b=b./delt;
c=c./delt;
d=d./delt;

3.9.4 Coaxial Cable Wiring Channel Model

f=[1:1025]/1025*1.5e8;
l1=100;
l2=25;
l3=35;
z0=75;
z1=75;
load c6.mod
load c59.mod
[a1,b1,c1,d1]=abcdcx(f,c6(:,1),c6(:,2),c6(:,3),c6(:,4),c6(:,5),l1);
[a2,b2,c2,d2]=abcdcx(f,c6(:,1),c6(:,2),c6(:,3),c6(:,4),c6(:,5),l2);
[a3,b3,c3,d3]=abcdcx(f,c6(:,1),c6(:,2),c6(:,3),c6(:,4),c6(:,5),l3);
[as1,bs1,cs1,ds1]=splitoo(f,z1);
[as2,bs2,cs2,ds2]=splitio(f,z0);
[chip1,h1]=abcd2hcx(a1,b1,c1,d1);
y1=20*log10(abs(h1(1:1025)));
at1=a1.*as1+b1.*cs1;
bt1=a1.*bs1+b1.*ds1;
ct1=c1.*as1+d1.*cs1;
dt1=c1.*bs1+d1.*ds1;
[chip2,h2]=abcd2hcx(at1,bt1,ct1,dt1);
y2=20*log10(abs(h2(1:1025)));
at2=at1.*a2+bt1.*c2;
bt2=at1.*b2+bt1.*d2;
ct2=ct1.*a2+dt1.*c2;
dt2=ct1.*b2+dt1.*d2;
[chip3,h3]=abcd2hcx(at2,bt2,ct2,dt2);
y3=20*log10(abs(h3(1:1025)));
at3=at2.*as2+bt2.*cs2;
bt3=at2.*bs2+bt2.*ds2;
ct3=ct2.*as2+dt2.*cs2;
dt3=ct2.*bs2+dt2.*ds2;
[chip4,h4]=abcd2hcx(at3,bt3,ct3,dt3);
y4=20*log10(abs(h4(1:1025)));
a=at3.*a3+bt3.*c3;
b=at3.*b3+bt3.*d3;
c=ct3.*a3+dt3.*c3;
d=ct3.*b3+dt3.*d3;
[chip,h]=abcd2hcx(a,b,c,d);
y5=20*log10(abs(h(1:1025)));
figure(2)
plot(f,y1,'k',f,y5,'k')
figure(3)
plot([1:1025]/2/1.5e8,chip(1:1025),'k')

3.9.5 Ingress Noise Model

psize=2049;
nsub=500;
perc=0.5;
f=[0:psize-1]/2048*50e6;
f(1)=0.00001;
%define shortwave radio bands
mask1l=5.5e6;
mask1h=6e6;
mask2l=7e6;
mask2h=7.5e6;
mask3l=9e6;
mask3h=9.8e6;
mask4l=11.5e6;
mask4h=12e6;
mask5l=13.5e6;
mask5h=14e6;
mask6l=14.8e6;
mask6h=15e6;
mask7l=17.5e6;
mask7h=18e6;
mask8l=21.5e6;
mask8h=21.8e6;
%define 30 random peaks
rloc1=rand(1,30)*50e6;
rloc2=rand(1,30)*50e6;
rloc3=rand(1,30)*50e6;
rloc4=rand(1,30)*50e6;
rloc5=rand(1,30)*50e6;
rloc6=rand(1,30)*50e6;
rloc7=rand(1,30)*50e6;
rloc8=rand(1,30)*50e6;
%noise floor
nsfllog=-40;
nsflflog=ones(1,psize)*nsfllog;
nsflf=10.^(nsflflog/10);
%radio background noise level, e-filed
efildlog=34.5-20;
efildflog=ones(1,psize)*efildlog;
epowflog=efildflog-44.5;
epowf=10.^(epowflog/10);
%radio interference noise level, random e-field
erfildflog=rand(1,psize)*45;
%spectrum mask
erfmask=ones(1,psize)*0.1;
for i=1:psize
if f(i)>mask1l & f(i)<mask1h
erfmask(i)=1;
end
if f(i)>mask2l & f(i)<mask2h
erfmask(i)=1;
end
if f(i)>mask3l & f(i)<mask3h
erfmask(i)=1;
end
if f(i)>mask4l & f(i)<mask4h
erfmask(i)=1;
end
if f(i)>mask5l & f(i)<mask5h
erfmask(i)=1;
end
if f(i)>mask6l & f(i)<mask6h
erfmask(i)=1;
end
if f(i)>mask7l & f(i)<mask7h
erfmask(i)=1;
end
if f(i)>mask8l & f(i)<mask8h
erfmask(i)=1;
end
for j=1:30
if f(i)>rloc1(j)-100e3 & f(i)<rloc1(j)+100e3
erfmask(i)=0.2;
end
if f(i)>rloc2(j)-100e3 & f(i)<rloc2(j)+100e3
erfmask(i)=0.3;
end
if f(i)>rloc3(j)-100e3 & f(i)<rloc3(j)+100e3
erfmask(i)=0.4;
end
if f(i)>rloc4(j)-100e3 & f(i)<rloc4(j)+100e3
erfmask(i)=0.5;
end
if f(i)>rloc5(j)-100e3 & f(i)<rloc5(j)+100e3
erfmask(i)=0.6;
end
if f(i)>rloc6(j)-100e3 & f(i)<rloc6(j)+100e3
erfmask(i)=0.7;
end
if f(i)>rloc7(j)-100e3 & f(i)<rloc7(j)+100e3
erfmask(i)=0.8;
end
if f(i)>rloc8(j)-100e3 & f(i)<rloc8(j)+100e3
erfmask(i)=0.9;
end
end
end
erfildflog=erfildflog.*erfmask;
%conversion at 10 MHz
erpowflog=erfildflog-44.5;
erpowf=10.^(erpowflog/10);
%sum of background and interference noise power
epowf=epowf+erpowf;
%field to power: propotional to the power of wavelength
epowf=epowf.*(10e6./f).^2;
epowft=perc*epowf+nsflf;
f(1)=0;
nfilt=fir2(900,f/max(f),sqrt(epowft));
[h,w]=freqz(nfilt,1,1024);
px=[1:1024]/1024*50e6;
py=20*log10(abs(h));
plot(px(102:1024),py(102:1024),'k');
grid
xlabel('Frequency (Hz)')
ylabel('Noise Level (dBµV)')

3.9.6 Channel Capacity Calculation

coaxmod;
h2=(abs(h(1:1024))).^2;
nmdl;
n2=(abs(h(1:1024))).^2;
df=max(f)/1025;
f1=ceil(1025*42e6/1.5e8);
f2=ceil(1025*52e6/1.5e8);
for psd=0:50
chacap(psd+1)=sum(log(1+10^(psd/10).*h2(f1:f2)./n2(f1:f2)))*df/log(2);
end
px=[0:50]
figure(3)
plot(px,chacap,'k');
grid
xlabel('Transmit Signal Level (dBµV)')
ylabel('Channel Capacity (Bits/Sec)')
  • + Share This
  • 🔖 Save To Your Account