Chris@0: %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Chris@0: % Name: test_convert_pitch_to_CRP.m Chris@0: % Date of Revision: 2011-03 Chris@0: % Programmer: Meinard Mueller, Sebastian Ewert Chris@0: % Chris@0: % Description: Chris@0: % * Computes CRP features (f_crp) from pitch features (f_pitch) Chris@0: % * CRP is a chroma-like feature tuned for timbre-invariance Chris@0: % Chris@0: % Reference: Chris@0: % Details on the feature computation can be found in the following articles: Chris@0: % Chris@0: % Meinard Mueller, Sebastian Ewert, and Sebastian Kreuzer Chris@0: % Making chroma features more robust to timbre changes. Chris@0: % Proceedings of IEEE International Conference on Acoustics, Speech, and Chris@0: % Signal Processing (ICASSP), Taipei, Taiwan, pp. 1869-1872, 2009. Chris@0: % Chris@0: % Meinard Mueller, and Sebastian Ewert Chris@0: % Towards Timbre-Invariant Audio Features for Harmony-Based Music. Chris@0: % IEEE Transactions on Audio, Speach, and Language Processing. Chris@0: % Chris@0: % License: Chris@0: % This file is part of 'Chroma Toolbox'. Chris@0: % Chris@0: % 'Chroma Toolbox' is free software: you can redistribute it and/or modify Chris@0: % it under the terms of the GNU General Public License as published by Chris@0: % the Free Software Foundation, either version 2 of the License, or Chris@0: % (at your option) any later version. Chris@0: % Chris@0: % 'Chroma Toolbox' is distributed in the hope that it will be useful, Chris@0: % but WITHOUT ANY WARRANTY; without even the implied warranty of Chris@0: % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the Chris@0: % GNU General Public License for more details. Chris@0: % Chris@0: % You should have received a copy of the GNU General Public License Chris@0: % along with 'Chroma Toolbox'. If not, see . Chris@0: % Chris@0: %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Chris@0: Chris@0: clear; Chris@0: close all hidden; Chris@0: Chris@0: directory = 'data_feature/'; Chris@0: Chris@0: Chris@0: %filename = 'Bach_BWV988-Aria-Measures1-4_Meinard_fast.wav'; Chris@0: %filename = 'Burgmueller_Op100-02-FirstPart_Meinard_SE.wav'; Chris@0: %filename = 'Systematic_Cadence-C-Major_Meinard_portato.wav'; Chris@0: %filename = 'Systematic_Cadence-C-Major_Meinard_staccato.wav'; Chris@0: %filename = 'Systematic_Scale-C-Major_Meinard_fast.wav'; Chris@0: %filename = 'Systematic_Scale-C-Major_Meinard_middle.wav'; Chris@0: filename = 'Systematic_Chord-C-Major_Eight-Instruments.wav'; Chris@0: Chris@0: Chris@0: %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Chris@0: % Loads pitch features (f_pitch) and computes CRP features (f_crp) Chris@0: % Chris@0: % Note: feature filename is specified by WAV filename Chris@0: %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Chris@0: Chris@0: win_len = 4410; Chris@0: filename_pitch = strcat(filename(1:end-4),'_pitch_',num2str(win_len)); Chris@0: load(strcat(directory,filename_pitch)); % load f_pitch and sideinfo; Chris@0: Chris@0: parameter.coeffsToKeep = [55:120]; Chris@0: parameter.applyLogCompr = 1; Chris@0: parameter.factorLogCompr = 1000; Chris@0: parameter.featureRate = sideinfo.pitch.featureRate; Chris@0: [f_crp,sideinfo] = pitch_to_CRP(f_pitch,parameter,sideinfo); Chris@0: Chris@0: %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Chris@0: % Visualization of CRP chromagram Chris@0: %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Chris@0: Chris@0: parameter.featureRate = sideinfo.CRP.featureRate; Chris@0: parameter.xlabel = 'Time [Seconds]'; Chris@0: parameter.title = 'CRP chromagram'; Chris@0: visualizeCRP(f_crp,parameter); Chris@0: