• Create BookmarkCreate Bookmark
• Create Note or TagCreate Note or Tag
• PrintPrint

### 4.6. Matlab Files

#### 4.6.1. Power Line Channel Model

```for ii=1:100
a0=0;
a1=8e-6;
k=0.5;
j=sqrt(-1);
%di=[150];
di=150*rand(1,10);
%gi=[0.4];
gi=0.2*(rand(1,10)-0.5);
f=[1:1000]/1000*30e6;
for i=1:1000
Hf(i)=sum(gi.*exp(-(a0+a1*f(i)^k).*di).*exp(-2e-6/150*pi*j*f(i).*di));
Hfcj=real(Hf(1000:-1:1))-j*imag(Hf(1000:-1:1));
HHf=[Hf Hfcj];
imp=real(ifft(HHf));
end
figure(1)
plot(f,20*log10(abs(Hf)))
figure(2)
plot(imp)
pause
end

```

#### 4.6.2. Power Line Noise Model

```psize=2049;
nsub=500;
perc=0.5;
f=[0:psize-1]/2048*50e6;
f(1)=0.00001;
%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;
rloc9=rand(1,30)*50e6;
rloc10=rand(1,30)*50e6;
%noise floor
nsfllog=-145;
nsflflog=ones(1,psize)*nsfllog;
nsflf=10.^(nsflflog/10);
efildlog=34.5-20;
efildflog=ones(1,psize)*efildlog;
epowflog=efildflog-149.5;
epowf=10.^(epowflog/10);
%radio interference noise level, random e-field
erfildflog=rand(1,psize)*65;
for i=1:psize
end
end
end
end
end
end
end
end
for j=1:30
if f(i)>rloc1(j)-100e3 & f(i)<rloc1(j)+100e3
end
if f(i)>rloc2(j)-100e3 & f(i)<rloc2(j)+100e3
end
if f(i)>rloc3(j)-100e3 & f(i)<rloc3(j)+100e3
end
if f(i)>rloc4(j)-100e3 & f(i)<rloc4(j)+100e3
end
if f(i)>rloc5(j)-100e3 & f(i)<rloc5(j)+100e3
end
if f(i)>rloc6(j)-100e3 & f(i)<rloc6(j)+100e3
end
if f(i)>rloc7(j)-100e3 & f(i)<rloc7(j)+100e3
end
if f(i)>rloc8(j)-100e3 & f(i)<rloc8(j)+100e3
end
end
end
%conversion at 10 MHz
erpowflog=erfildflog-149.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.*(5e6./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(10:1024),py(10:1024),'k');
grid
xlabel('Frequency (Hz)')
ylabel('Noise Level (dBm/Hz)')

```

PREVIEW

Not a subscriber?

Start A Free Trial

• Create BookmarkCreate Bookmark
• Create Note or TagCreate Note or Tag
• PrintPrint