Mercurial > hg > ltpda
comparison m-toolbox/test/test_ao_zeropad.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 | |
2 | |
3 % Compute time-series | |
4 Nsecs = 1e2; % 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 % Zero pad x3 | |
12 bz = zeropad(b, plist('Factor', 10)); | |
13 | |
14 % Zero pad with N samples | |
15 cz = zeropad(b, plist('N', 100)); | |
16 | |
17 iplot(b,bz,cz) | |
18 | |
19 % Spectra | |
20 bxx = abs(fft(b)).^2; | |
21 bzxx = abs(fft(bz)).^2; | |
22 czxx = abs(fft(cz)).^2; | |
23 | |
24 iplot(bzxx, bxx, czxx) | |
25 |