comparison m-toolbox/test/test_ao_dft.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 mc;
2
3 % Compute time-series
4 Nsecs = 1e3; % Number of seconds desired
5 fs = 10;
6
7 s = ao(plist('tsfcn', 'sin(2*pi*1.137*t)', 'fs', fs, 'Nsecs', Nsecs));
8 n = ao(plist('tsfcn', 'randn(size(t))', 'fs', fs, 'Nsecs', Nsecs));
9 b = n + s;
10
11 % Make FFT
12 tic
13 bxx = fft(b);
14 toc
15
16 % Make DFT
17 tic
18 dxx = dft(b);
19 toc
20
21 % Make DFT at a particular frequency
22 dsx = dft(b, plist('f', 1.137));
23
24 % Plot
25 iplot(bxx, dxx, dsx, plist('Markers', {'none', 'none', 'o'}));
26
27 iplot(bxx./dxx)