Mercurial > hg > ltpda
diff 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 |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/m-toolbox/test/test_ao_spectrogram.m Wed Nov 23 19:22:13 2011 +0100 @@ -0,0 +1,37 @@ +% function test_ao_spectrogram() +% TEST_AO_SPECTROGRAM test spectrogram function for analysis objects. +% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% +% DESCRIPTION: TEST_AO_SPECTROGRAM test spectrogram function for analysis +% objects. +% +% CALL: test_ao_spectrogram; +% +% HISTORY: 26-12-2007 Hewitson +% Creation. +% +% VERSION: % $Id: test_ao_spectrogram.m,v 1.1 2008/01/30 21:36:26 hewitson Exp $ +% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +clear all + + +%% Make time-series object +nsecs = 100; +fs = 100; +p = plist('waveform', 'noise', 'fs', fs, 'nsecs', nsecs); +n = ao(p); +p = plist('waveform', 'chirp', 'fs', fs, 'nsecs', nsecs, 'f0', 0, 'f1', 50, 't1', nsecs); +s = ao(p); + +a = s+n; + +%% Make spectrogram + +sxx = spectrogram(a, plist('Nfft', 4*fs)); + + +figure +imagesc(sxx.data.x, sxx.data.y, sxx.data.z) \ No newline at end of file