view m-toolbox/test/test_ao_spectrogram.m @ 45:a59cdb8aaf31 database-connection-manager

Merge
author Daniele Nicolodi <nicolodi@science.unitn.it>
date Tue, 06 Dec 2011 19:07:22 +0100
parents f0afece42f48
children
line wrap: on
line source

% 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)