annotate toolboxes/MIRtoolbox1.3.2/MIRToolbox/mirfluctuation.m @ 0:e9a9cd732c1e tip

first hg version after svn
author wolffd
date Tue, 10 Feb 2015 15:05:51 +0000
parents
children
rev   line source
wolffd@0 1 function varargout = mirfluctuation(orig,varargin)
wolffd@0 2 % f = mirfluctuation(x) calculates the fluctuation strength, indicating the
wolffd@0 3 % rhythmic periodicities along the different channels.
wolffd@0 4 % Optional arguments:
wolffd@0 5 % mirfluctuation(...,'MinRes',mr) specifies the minimal frequency
wolffd@0 6 % resolution of the resulting spectral decomposition, in Hz.
wolffd@0 7 % Default: mr = .01 Hz
wolffd@0 8 % mirfluctuation(...,'Summary') returns the summary of the fluctuation,
wolffd@0 9 % i.e., the summation along the critical bands.
wolffd@0 10 %
wolffd@0 11 % E. Pampalk, A. Rauber, D. Merkl, "Content-based Organization and
wolffd@0 12 % Visualization of Music Archives",
wolffd@0 13
wolffd@0 14 sum.key = 'Summary';
wolffd@0 15 sum.type = 'Boolean';
wolffd@0 16 sum.default = 0;
wolffd@0 17 option.sum = sum;
wolffd@0 18
wolffd@0 19 mr.key = 'MinRes';
wolffd@0 20 mr.type = 'Integer';
wolffd@0 21 mr.default = .01;
wolffd@0 22 option.mr = mr;
wolffd@0 23
wolffd@0 24 specif.option = option;
wolffd@0 25
wolffd@0 26 varargout = mirfunction(@mirfluctuation,orig,varargin,nargout,specif,@init,@main);
wolffd@0 27
wolffd@0 28
wolffd@0 29 function [f type] = init(x,option)
wolffd@0 30 if iscell(x)
wolffd@0 31 x = x{1};
wolffd@0 32 end
wolffd@0 33 if isamir(x,'miraudio') && not(isframed(x))
wolffd@0 34 x = mirframe(x,.023,.5);
wolffd@0 35 end
wolffd@0 36 m = mirspectrum(x,'Power','Terhardt','Bark','dB','Mask');
wolffd@0 37 f = mirspectrum(m,'AlongBands','Max',10,'Window',0,...
wolffd@0 38 'Resonance','Fluctuation','MinRes',option.mr);
wolffd@0 39 if option.sum
wolffd@0 40 f = mirsummary(f);
wolffd@0 41 end
wolffd@0 42 type = 'mirspectrum';
wolffd@0 43
wolffd@0 44
wolffd@0 45 function f = main(f,option,postoption)
wolffd@0 46 f = set(f,'Title','Fluctuation');