comparison m-toolbox/test/test_ao_spectrogram.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 % function test_ao_spectrogram()
2 % TEST_AO_SPECTROGRAM test spectrogram function for analysis objects.
3 %
4 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5 %
6 % DESCRIPTION: TEST_AO_SPECTROGRAM test spectrogram function for analysis
7 % objects.
8 %
9 % CALL: test_ao_spectrogram;
10 %
11 % HISTORY: 26-12-2007 Hewitson
12 % Creation.
13 %
14 % VERSION: % $Id: test_ao_spectrogram.m,v 1.1 2008/01/30 21:36:26 hewitson Exp $
15 %
16 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
17
18 clear all
19
20
21 %% Make time-series object
22 nsecs = 100;
23 fs = 100;
24 p = plist('waveform', 'noise', 'fs', fs, 'nsecs', nsecs);
25 n = ao(p);
26 p = plist('waveform', 'chirp', 'fs', fs, 'nsecs', nsecs, 'f0', 0, 'f1', 50, 't1', nsecs);
27 s = ao(p);
28
29 a = s+n;
30
31 %% Make spectrogram
32
33 sxx = spectrogram(a, plist('Nfft', 4*fs));
34
35
36 figure
37 imagesc(sxx.data.x, sxx.data.y, sxx.data.z)