view m-toolbox/test/test_ao_upsample.m @ 51:9d5c88356247 database-connection-manager

Make unit tests database connection parameters configurable
author Daniele Nicolodi <nicolodi@science.unitn.it>
date Wed, 07 Dec 2011 17:24:37 +0100
parents f0afece42f48
children
line wrap: on
line source

% TEST_AO_UPSAMPLE tests upsample method of AO class.
%
% M Hewitson 14-05-07
%
% $Id: test_ao_upsample.m,v 1.5 2009/02/02 15:20:38 hewitson Exp $
%
function test_ao_upsample()
  
  % Make test AOs
  
  nsecs = 10;
  fs    = 100;
  
  pl = plist('nsecs', nsecs, 'fs', fs, 'tsfcn', 'sin(2*pi*7.433*t)');
  
  a1 = ao(pl);
  a1 = a1.setName('sine_wave');
  
  % Decimate
  a4 = upsample(a1, plist('N', 2));
  a5 = upsample(a1, plist('N', 3, 'Phase', 1));
  
  iplot([a1 a5 a4], plist('XRanges', [0 0.1]));
  
  
  % Rebuild from history
  a_out = rebuild(a5);
  
  iplot([a1 a_out], plist('XRanges', [0 0.1]));
  plot(a_out.hist)
  
end
% END