comparison m-toolbox/test/test_ao_linSubtract.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 script for ao/linSubtract
2 %
3 % M Nofrarias 14-05-09
4 %
5 % $Id: test_ao_linSubtract.m,v 1.1 2009/08/06 09:04:34 miquel Exp $
6 %
7
8 %% Make test AOs
9
10 % clear all
11
12 nsecs = 1000;
13 fs = 10;
14
15
16 pl1 = plist('nsecs', nsecs, 'fs', fs, 'tsfcn', 'randn(size(t))');
17 a1 = ao(pl1);
18
19 pl2 = plist('nsecs', nsecs, 'fs', fs, 'tsfcn', '5*sin(2*pi*0.01*t)');
20 a2 = ao(pl2);
21 a2.setName('signal')
22
23 % linear coupling
24 a3 = a1 + a2
25 a3.setName('signal+noise')
26
27 %% Linear Subtraction
28
29 pl = plist('type','bandpass',...
30 'fc',[5e-4 0.1],...
31 'order',2,...
32 'times',[1 1e3],...
33 'coupling',...
34 {{'n(1)'}});
35
36 b = [a3 a2];
37
38 a4 = linSubtract(b,pl);
39
40
41 %% Plot
42
43 iplot(a4)
44
45 iplot(a3,a2)
46
47
48 %% Test Subtraction
49
50 b = lpsd(a3,a4)
51 b.iplot
52
53 %% History
54
55 plot(a4.hist)
56
57
58
59
60
61