⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 fig4_11.m

📁 these are the Mtlab functions to plot the figures in the book Communication system (by Haykin)
💻 M
字号:



%the ideal filter (direct implementation).
fst=60;fsy=525;
deltat=1/fst;deltay=1/fsy;
clear H0 ft fy;
%ft=[-2*fst:fst/50:2*fst];lt=length(ft);
%fy=[-2*fsy:fsy/50:2*fsy];ly=length(fy);
ft=[-2.5*fst:fst/50:2.5*fst];lt=length(ft);
fy=[-2.5*fsy:fsy/50:2.5*fsy];ly=length(fy);
deltat3=1/300;deltay3=1/13125;

H0=zeros(lt,ly);
for (i=1:lt) 
   if (ft(i)>=-5*fst/12)&(ft(i)<=5*fst/12)
      
      for (j=1:ly)
         if (fy(j)>=-4*fsy/9)&(fy(j)<=4*fsy/9)
            
            if (ft(i)<-10/54*fst)&(ft(i)>=-5/12*fst)
               if (fy(j)<=fsy/fst*ft(i)+fsy/2)&(fy(j)>=-fsy/fst*ft(i)-fsy/2)
                  H0(i,j)=126/125;
               end;
            elseif (ft(i)>=-10/54*fst)&(ft(i)<=0)
               if (fy(j)<=7*fsy/(10*fst)*ft(i)+4*fsy/9)&(fy(j)>=-7*fsy/(10*fst)*ft(i)-4*fsy/9)
                  H0(i,j)=126/125;
               end;
            elseif (ft(i)<=10/54*fst)&(ft(i)>0)
               if (fy(j)<=-7*fsy/(10*fst)*ft(i)+4*fsy/9)&(fy(j)>=7*fsy/(10*fst)*ft(i)-4*fsy/9)
                  H0(i,j)=126/125;
               end;
            elseif (ft(i)>10/54*fst)&(ft(i)<=5/12*fst)
               if (fy(j)<=-fsy/fst*ft(i)+fsy/2)&(fy(j)>=fsy/fst*ft(i)-fsy/2)
                  H0(i,j)=126/125;
               end;
            end;
         end;
      end;
   end;
end;

figure;subplot(1,3,1)
imagesc(sqrt(H0')),colormap(gray(256));axis image; axis off;
%text(0,270,'-2.5f_{s,t,2}')
%text(240,270,'2.5f_{s,t,2}')
%text(-35,0,'2.5f_{s,y,2}')
%text(-38,250,'-2.5f_{s,y,2}')

%subplot(2,1,1);
%imagesc(sqrt(H0)),colormap(gray(256));axis image; axis off;

%concatenation of H2 and H3, ideal one.

H23=zeros(lt,ly);
for (i=1:lt) 
   if (ft(i)>=-5*fst/12)&(ft(i)<=5*fst/12)
      
      for (j=1:ly)
         if (fy(j)>=-fsy/2)&(fy(j)<=fsy/2)
            H23(i,j)=126/125;
         end;
      end;
   end;
end;
subplot(1,3,2)
imagesc(sqrt(H23')),colormap(gray(256));axis image; axis off;

H=zeros(lt,ly);
for (i=1:lt) 
   Ht(i)=1;
   for (k=1:5)
      Ht(i)=Ht(i)+(1-k/6)*cos(2*pi*ft(i)*k*deltat3)*2;
   end;
end;
for (i=1:ly) 
   Hy(i)=1;
   for (k=1:20)
      Hy(i)=Hy(i)+(1-k/21)*cos(2*pi*fy(i)*k*deltay3)*2;
   end;
end;
H=Hy'*Ht;

subplot(1,3,3)
imagesc(sqrt(H)),colormap(gray(256));axis image; axis off;


print -deps2 ch4-PAL-NTSC-freq.eps

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -