% smes signalu 1khz a 30khz 
t = linspace(0,0.001,300); 
o1 = 2000*pi; 
o2 = 60000*pi; 
x1 = cos(o1 * t); x2 = cos(o2 * t); x = x1+x2; 
subplot (421); plot(t,x1); 
subplot (423); plot(t,x2); 
subplot (425); plot(t,x); 

y1 = 100* cos(o1 * t - 0.02*pi); 
y2 = 1* cos(o2 * t - 0.6*pi); y= y1+y2; 
subplot (422); plot(t,y1); 
subplot (424); plot(t,y2); axis([0 0.001 -100 100]);
subplot (426); plot(t,y);  axis([0 0.001 -100 100]);
subplot (428); plot(t,y);  % maly zoom ! 

print -deps FIG/1a30.eps

%%%%%%%%%%% RC filtr %%%%%%%%%%%%%%%%%%
R = 1000; C = 1e-6; tau = R*C
b = 1; a = [tau 1]; 
% frekv od 0 do 5k:
om = (0:10:4000) * 2 * pi;  
h = freqs (b,a,om); 
subplot (211); semilogx (om,20* log10 (abs(h))); xlabel('omega [rad/s]'),
  ylabel('20log|H|'); grid; axis tight
subplot (212); semilogx (om,angle(h)); xlabel('omega [rad/s]'),
  ylabel('arg(H)'); grid; axis tight
%slidify(1,2,1,12);   
print -depsc FIG/rcfrekv.eps
