Mercurial > hg > ltpda
comparison m-toolbox/test/test_ltpda_polydetrend.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 ltpda_polydetrend | |
2 % | |
3 % M Hewitson, A Monsky 01-03-07 | |
4 % | |
5 % $Id: test_ltpda_polydetrend.m,v 1.16 2009/02/02 15:20:37 hewitson Exp $ | |
6 % | |
7 function test_ltpda_polydetrend() | |
8 | |
9 | |
10 %% Make test AOs | |
11 | |
12 nsecs = 10; | |
13 fs = 1000; | |
14 | |
15 pl = plist('nsecs', nsecs, 'fs', fs, 'tsfcn', '2e5*sin(2*pi*0.000433*t) + randn(size(t))'); | |
16 a1 = ao(pl); | |
17 | |
18 iplot(a1) | |
19 | |
20 % Polynomial detrend | |
21 a2 = detrend(a1, plist('N', 3)); | |
22 iplot(a2) | |
23 | |
24 % Look at the polynomial | |
25 a3 = a1-a2; | |
26 iplot(a3) | |
27 | |
28 % Reproduce from history | |
29 a_out = rebuild(a2); | |
30 | |
31 iplot(a_out) | |
32 plot(a_out.hist) | |
33 | |
34 end |