view m-toolbox/test/test_ao_waveform.m @ 14:6d43f39633b8 database-connection-manager

Remove unused functions from utils.jmysql
author Daniele Nicolodi <nicolodi@science.unitn.it>
date Mon, 05 Dec 2011 16:20:06 +0100
parents f0afece42f48
children
line wrap: on
line source

% TEST_AO_WAVEFORM test the waveform constructor for AO class.
%
% M Hewitson 17-05-07
%
% $Id: test_ao_waveform.m,v 1.6 2009/02/02 15:20:37 hewitson Exp $
%
function test_ao_waveform()
  
  
  % Create parameter list
  pl = plist('fs', 100, 'nsecs', 5);
  
  % sinewave
  spl = append(pl, 'waveform', 'sine wave');
  spl.append('f', 1.23);
  spl.append('phi', 30);
  
  asine = ao(spl);
  
  % noise
  spl = append(pl, 'waveform', 'noise');
  spl.append('type', 'Normal');
  
  anoise = ao(spl);
  
  % chirp
  
  spl = append(pl, 'waveform', 'chirp');
  spl.append('f0', 1);
  spl.append('f1', 50);
  spl.append('t1', 100);
  
  achirp = ao(spl)
  
  % Gaussian pulse
  
  spl = append(pl, 'waveform', 'Gaussian pulse');
  spl.append('f0', 10);
  spl.append('bw', 100);
  
  agp = ao(spl)
  
  % Square wave
  
  spl = append(pl, 'waveform', 'Square wave');
  spl.append('f', 1);
  spl.append('duty', 50);
  
  asquare = ao(spl)
  
  % Sawtooth
  
  spl = append(pl, 'waveform', 'Sawtooth');
  spl.append('f', 1);
  spl.append('width', 0.5);
  
  asaw = ao(spl)
  
  % Plots
  iplot([asine anoise achirp agp asquare asaw])
  
end
% END