%%Figure 4 simulated apparent frequency t=0:1e-6:1-1e-6; y1=sin(2*pi*100*t'); y2 = 2*sin(2*pi*120*t'); y3=y1+y2; fso=exp(-1j*2*pi*110*(0:1e6-1)'/1e6); yc1=gfilter(y1.*fso,1e6,0,50); yc2=gfilter(y2.*fso,1e6,0,50); yc3=gfilter(y3.*fso,1e6,0,50); afy1=((real(yc1).*[diff(imag(yc1));1])-(imag(yc1).*[diff(real(yc1));1]))./(2*pi*0.000001*(abs(yc1).^2)); afy2=((real(yc2).*[diff(imag(yc2));1])-(imag(yc2).*[diff(real(yc2));1]))./(2*pi*0.000001*(abs(yc2).^2)); afy3=((real(yc3).*[diff(imag(yc3));1])-(imag(yc3).*[diff(real(yc3));1]))./(2*pi*0.000001*(abs(yc3).^2)); % h=figure; % plot(1:1e6-1,afy1(1:end-1)+110,'linewidth',1.5,'color','y');hold on % plot(1:1e6-1,afy2(1:end-1)+110,'linewidth',1.5,'color','k');grid on % set(gca,'xtick',[]);xlabel(' [t]=\mus','FontSize', 20) % % [ax,h1,h2]=plotyy(1:1e6-1,afy3(1:end-1)+110,1:1e6-1,abs(yc3(1:1e6-1)),'plot'); % set(ax,'fontsize',16) % % set(get(ax(1), 'Ylabel'), 'String', '[af]=Hz','FontSize', 20);ylim([95 145]) % set(get(ax(2), 'Ylabel'), 'String','[A]','FontSize', 20); % set(h1,'linewidth',2) % set(h2,'linewidth',2) % set(get(ax(2), 'Ylabel'), 'String','[A]','FontSize', 20); yyaxis left plot(1/1000:1/1000:(1e6-1)/1000,afy3(1:end-1)+110,'b','linewidth',1.5) hold on plot(1/1000:1/1000:(1e6-1)/1000,100*ones(1e6-1,1),'k','linewidth',1.5) plot(1/1000:1/1000:(1e6-1)/1000,120*ones(1e6-1,1),'k','linewidth',1.5) xlabel('[t] = ms','FontSize', 20) set(gca,'fontsize',16) ylabel('[fi] = Hz','FontSize', 20) xlim([1/1000 1.5e2]) ylim([95 145]) yyaxis right plot(1/1000:1/1000:(1e6-1)/1000,abs(yc3(1:1e6-1)),'r','linewidth',1.5) xlabel('[t] = ms','FontSize', 20) set(gca,'fontsize',16) ylabel('[|y|] = 1','FontSize', 20) xlim([1/1000 1.5e2]) print fig4.tif -dtiff