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

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