% /home/dimarzio/Documents/working/12303/quiz/q10.m
% Fri Nov 23 13:14:47 2018
%
% Quiz 10 fetal blood oxygen monitor

f1=65/60;f2=120/60;f3=3/10;
t=[0:2^16-1]*10/2^16;
v1=3*exp(-1+2*sin(2*pi*f1*t));
v2=4*exp(-1+2*sin(2*pi*f2*t+0.54));
v3=0.5*cos(2*pi*f3*t);
v=1+v1+v2+v3+4*randn(size(t))+t/2;

f=fftaxisshift(fftaxis(t));

V=fftshift(fft(v));

[pt,pf,ff,VF]=plotpair(t,v,20);
figure(pt);%print -depsc q10a.eps
figure(pf);%print -depsc q10b.eps
moose=axis;axis([-1,8,moose(3:4)]);
%print -depsc q10c.eps
axis([-20,20,-1,1]);
%print -depsc q10d.eps
