comparison matlab/MATLAB-Chroma-Toolbox_2.0/test_convert_pitch_to_CRP.m @ 0:b54ee0a0be67

Import MATLAB Chroma Toolbox
author Chris Cannam
date Wed, 05 Aug 2015 21:08:56 +0100
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:b54ee0a0be67
1 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2 % Name: test_convert_pitch_to_CRP.m
3 % Date of Revision: 2011-03
4 % Programmer: Meinard Mueller, Sebastian Ewert
5 %
6 % Description:
7 % * Computes CRP features (f_crp) from pitch features (f_pitch)
8 % * CRP is a chroma-like feature tuned for timbre-invariance
9 %
10 % Reference:
11 % Details on the feature computation can be found in the following articles:
12 %
13 % Meinard Mueller, Sebastian Ewert, and Sebastian Kreuzer
14 % Making chroma features more robust to timbre changes.
15 % Proceedings of IEEE International Conference on Acoustics, Speech, and
16 % Signal Processing (ICASSP), Taipei, Taiwan, pp. 1869-1872, 2009.
17 %
18 % Meinard Mueller, and Sebastian Ewert
19 % Towards Timbre-Invariant Audio Features for Harmony-Based Music.
20 % IEEE Transactions on Audio, Speach, and Language Processing.
21 %
22 % License:
23 % This file is part of 'Chroma Toolbox'.
24 %
25 % 'Chroma Toolbox' is free software: you can redistribute it and/or modify
26 % it under the terms of the GNU General Public License as published by
27 % the Free Software Foundation, either version 2 of the License, or
28 % (at your option) any later version.
29 %
30 % 'Chroma Toolbox' is distributed in the hope that it will be useful,
31 % but WITHOUT ANY WARRANTY; without even the implied warranty of
32 % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
33 % GNU General Public License for more details.
34 %
35 % You should have received a copy of the GNU General Public License
36 % along with 'Chroma Toolbox'. If not, see <http://www.gnu.org/licenses/>.
37 %
38 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
39
40 clear;
41 close all hidden;
42
43 directory = 'data_feature/';
44
45
46 %filename = 'Bach_BWV988-Aria-Measures1-4_Meinard_fast.wav';
47 %filename = 'Burgmueller_Op100-02-FirstPart_Meinard_SE.wav';
48 %filename = 'Systematic_Cadence-C-Major_Meinard_portato.wav';
49 %filename = 'Systematic_Cadence-C-Major_Meinard_staccato.wav';
50 %filename = 'Systematic_Scale-C-Major_Meinard_fast.wav';
51 %filename = 'Systematic_Scale-C-Major_Meinard_middle.wav';
52 filename = 'Systematic_Chord-C-Major_Eight-Instruments.wav';
53
54
55 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
56 % Loads pitch features (f_pitch) and computes CRP features (f_crp)
57 %
58 % Note: feature filename is specified by WAV filename
59 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
60
61 win_len = 4410;
62 filename_pitch = strcat(filename(1:end-4),'_pitch_',num2str(win_len));
63 load(strcat(directory,filename_pitch)); % load f_pitch and sideinfo;
64
65 parameter.coeffsToKeep = [55:120];
66 parameter.applyLogCompr = 1;
67 parameter.factorLogCompr = 1000;
68 parameter.featureRate = sideinfo.pitch.featureRate;
69 [f_crp,sideinfo] = pitch_to_CRP(f_pitch,parameter,sideinfo);
70
71 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
72 % Visualization of CRP chromagram
73 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
74
75 parameter.featureRate = sideinfo.CRP.featureRate;
76 parameter.xlabel = 'Time [Seconds]';
77 parameter.title = 'CRP chromagram';
78 visualizeCRP(f_crp,parameter);
79