comparison 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
comparison
equal deleted inserted replaced
-1:000000000000 0:f0afece42f48
1 % TEST_AO_WAVEFORM test the waveform constructor for AO class.
2 %
3 % M Hewitson 17-05-07
4 %
5 % $Id: test_ao_waveform.m,v 1.6 2009/02/02 15:20:37 hewitson Exp $
6 %
7 function test_ao_waveform()
8
9
10 % Create parameter list
11 pl = plist('fs', 100, 'nsecs', 5);
12
13 % sinewave
14 spl = append(pl, 'waveform', 'sine wave');
15 spl.append('f', 1.23);
16 spl.append('phi', 30);
17
18 asine = ao(spl);
19
20 % noise
21 spl = append(pl, 'waveform', 'noise');
22 spl.append('type', 'Normal');
23
24 anoise = ao(spl);
25
26 % chirp
27
28 spl = append(pl, 'waveform', 'chirp');
29 spl.append('f0', 1);
30 spl.append('f1', 50);
31 spl.append('t1', 100);
32
33 achirp = ao(spl)
34
35 % Gaussian pulse
36
37 spl = append(pl, 'waveform', 'Gaussian pulse');
38 spl.append('f0', 10);
39 spl.append('bw', 100);
40
41 agp = ao(spl)
42
43 % Square wave
44
45 spl = append(pl, 'waveform', 'Square wave');
46 spl.append('f', 1);
47 spl.append('duty', 50);
48
49 asquare = ao(spl)
50
51 % Sawtooth
52
53 spl = append(pl, 'waveform', 'Sawtooth');
54 spl.append('f', 1);
55 spl.append('width', 0.5);
56
57 asaw = ao(spl)
58
59 % Plots
60 iplot([asine anoise achirp agp asquare asaw])
61
62 end
63 % END