Mercurial > hg > ltpda
diff m-toolbox/test/test_ao_waveform.m @ 0:f0afece42f48
Import.
author | Daniele Nicolodi <nicolodi@science.unitn.it> |
---|---|
date | Wed, 23 Nov 2011 19:22:13 +0100 |
parents | |
children |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/m-toolbox/test/test_ao_waveform.m Wed Nov 23 19:22:13 2011 +0100 @@ -0,0 +1,63 @@ +% 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 \ No newline at end of file