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.

T4mask.m
x=[-2:0.125:2];
pmask=sin(pi*x)./(pi*x).*cos(pi*x)./(1-4*x.^2);
pmask(17)=1;
pmask(13)=(pmask(12)+pmask(14))/2;
pmask(21)=(pmask(20)+pmask(22))/2;
%pause
[B,A]=butter(3,0.25);
pmask=filter(B,A,[pmask 0 0 0 0 0 0 0]);
btsq=[3 1 2 2 3 1 
2 3 1 3 1 2 
3 1 2 3 1 2 
1 2 3 3 1 2 
1 2 3 2 3 1 
2 3 1 1 2 3 
3 1 2 1 2 3 
1 2 3 1 2 3 
1 3 2 2 3 1 
2 1 3 3 1 2 
1 3 2 3 1 2 
3 2 1 3 1 2 
3 2 1 2 3 1 
2 1 3 1 2 3 
1 3 2 1 2 3 
3 2 1 1 2 3 
3 2 3 1 1 2 
3 3 2 1 2 1 
3 2 3 1 2 1 
2 3 3 1 2 1 
2 3 3 1 1 2 
3 3 2 2 1 1 
3 2 3 2 1 1 
2 3 3 2 1 1 
2 3 1 2 3 1 
2 3 1 2 1 3 
2 3 1 3 3 1 
2 3 1 2 2 3 
2 1 3 2 2 3 
2 1 3 3 3 1 
2 1 3 2 1 3 
2 1 3 2 3 1 
2 2 1 3 3 1 
1 1 3 2 2 3 
3 3 1 2 3 1 
3 3 1 2 1 3 
2 2 3 2 1 3 
2 2 3 2 3 1 
2 2 1 2 2 3 
1 1 3 3 3 1 
1 2 1 3 3 2 
1 1 2 3 2 3 
1 2 1 3 2 3 
2 1 1 3 2 3 
2 1 1 3 3 2 
1 1 2 2 3 3 
1 2 1 2 3 3 
2 1 1 2 3 3 
3 1 2 2 1 3 
2 3 1 1 3 2 
3 1 2 1 3 2 
1 2 3 1 3 2 
1 2 3 2 1 3 
2 3 1 3 2 1 
3 1 2 3 2 1 
1 2 3 3 2 1 
1 3 2 2 1 3 
2 1 3 1 3 2 
1 3 2 1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 3 2 2 1 3 
2 2 3 1 3 2 
2 3 2 1 3 2 
3 2 2 1 3 2 
3 2 2 2 1 3 
2 2 3 3 2 1 
2 3 2 3 2 1 
3 2 2 3 2 1 
3 1 2 3 3 1 
2 3 1 3 1 3 
3 1 2 3 1 3 
1 2 3 3 1 3 
1 2 3 3 3 1 
2 3 1 1 3 3 
3 1 2 1 3 3 
1 2 3 1 3 3 
1 3 2 3 3 1 
2 1 3 3 1 3 
1 3 2 3 1 3 
3 2 1 3 1 3 
3 2 1 3 3 1 
2 1 3 1 3 3 
1 3 2 1 3 3 
3 2 1 1 3 3 
3 1 2 2 2 3 
2 3 1 2 3 2 
3 1 2 2 3 2 
1 2 3 2 3 2 
1 2 3 2 2 3 
2 3 1 3 2 2 
3 1 2 3 2 2 
1 2 3 3 2 2 
1 3 2 2 2 3 
2 1 3 2 3 2 
1 3 2 2 3 2 
3 2 1 2 3 2 
3 2 1 2 2 3 
2 1 3 3 2 2 
1 3 2 3 2 2 
3 2 1 3 2 2];
pspc=zeros(1,1024);
pspc1=zeros(1,1024);
%pspc1=zeros(1,1024*2);
for i=1:256
    swave=zeros(1,24);
    swave1=zeros(1,84);
    for j=1:6
        swindx=(j-1)*4+1;
        swindx1=(j-1)*8+1;
        if btsq(i,j)==1
            swave(swindx:swindx+3)=-ones(1,4);
            swave1(swindx1:swindx1+39)=swave1(swindx1:swindx1+39)-pmask;
        end
        if btsq(i,j)==3
            swave(swindx:swindx+3)=ones(1,4);
            swave1(swindx1:swindx1+39)=swave1(swindx1:swindx1+39)+pmask;
        end
    end
    pspc=pspc+abs(fft(swave,1024));
    pspc1=pspc1+abs(fft(swave1,1024));
    %pspc1=pspc1+abs(fft(swave1,1024*2));
end
pspc=pspc/256;
pspc=pspc.^2*3.5^2/100/0.001/25e6/24;
pspc1=pspc1/256;
pspc1=pspc1.^2*3.5^2/100/0.001/25e6/48;
px=[1:512]/512*5e7;
px1=[1:256]/256*5e7;
py1=10*log10(abs(pspc(1:512)));
py2=10*log10(abs(pspc1(1:256)));
figure(2)
plot(px,py1,px1,py2)
grid
xlabel('Frequency (Hz)')
ylabel('Magnitude (dBm/Hz)')


        

Contact us