m0=poly2th([1 -1.5 0.7],[0 1 0.5]);
u=idinput(1000,'prbs');
e=randn(1000,1);
% Figures 6.2 and 6.3:

y=idsim([u e],m0);
z=[y u];
ghh=etfe(z);[om,ghha]=getff(ghh);
g10=spa(z,10);[om,g10a]=getff(g10);
g50=spa(z,50);[om,g50a]=getff(g50);
g200=spa(z,200);[om,g200a]=getff(g200);
g0=th2ff(m0);[om,g0a]=getff(g0);
figure(1) % FIGURE 6.2
idplot(z,[101:200])

figure(2) % FIGURE 6,3
subplot(221)
% Could also use bodeplot([g0 ghh],'a');
loglog(om,ghha), line(om,g0a,'linewidth',2),title('a')
subplot(222)
loglog(om,g10a), line(om,g0a,'linewidth',2),title('b')
subplot(223)
loglog(om,g50a), line(om,g0a,'linewidth',2),title('c')
subplot(224)
loglog(om,g200a), line(om,g0a,'linewidth',2),title('d')
 
