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.

T2mask.m
%calculating PSD
pspc=zeros(1024,1);
pspcf=zeros(1024,1);
for ii=1:256
x=ceil(rand(256,3)*2-1);
for i=1:256
    if x(i,1)==0 
        xa=-1;
        xb=0;
    else
        xa=1;
        xb=-2;
    end
    if x(i,2)==0
        xl(i)=xa;
    else
        xl(i)=xb;
    end
    if x(i,3)==1
        xl(i)=xl(i)*(-1);
    end
end
xl=0.9*xl;
xll=zeros(1024,1);
xll(1:4:1024)=xl;
tfilt=[0.36 0.8 1 0.75 0.26];
xlf=conv(xll,tfilt);
xll(2:4:1024)=xl;
xll(3:4:1024)=xl;
xll(4:4:1024)=xl;
    pspc=pspc+abs(fft(xll,1024));
    pspcf=pspcf+abs(fft(xlf(3:1026),1024));
end
pspc=pspc/256;
pspc=pspc.^2/100/0.001/5e7/4;
pspcf=pspcf/256;
pspcf=pspcf.^2/100/0.001/5e7/4;
figure(1)
logpspc=10*log10(pspc(1:513));
logpspcf=10*log10(pspcf(1:513));
f=[1:513]/513*5e7;
plot(f,logpspc,f,logpspcf)
grid
xlabel('Frequency (Hz)')
ylabel('PSD (dBm/Hz)')

Contact us