wolffd@0
|
1 function mirtest(audio)
|
wolffd@0
|
2
|
wolffd@0
|
3 if not(nargin)
|
wolffd@0
|
4 audio = 'ragtime';
|
wolffd@0
|
5 end
|
wolffd@0
|
6
|
wolffd@0
|
7 %% Version 1.0
|
wolffd@0
|
8
|
wolffd@0
|
9 mirpeaks(mirspectrum(audio,'Mel'))
|
wolffd@0
|
10 f = mirframe(audio,.5,.5)
|
wolffd@0
|
11 mirpeaks(mirspectrum(f,'Mel'),'Total',1)
|
wolffd@0
|
12 mirpeaks(mirautocor(f),'Total',1,'NoBegin')
|
wolffd@0
|
13 mirpeaks(mirspectrum(f),'Total',1,'NoBegin')
|
wolffd@0
|
14 mirpeaks(mirchromagram(f),'Total',1)
|
wolffd@0
|
15 mirpeaks(mirkeystrength(f),'Total',1)
|
wolffd@0
|
16 %mirpeaks(mirfluctuation(f),'Total',1,'NoBegin') %Not implemented yet..
|
wolffd@0
|
17 [a,b,c] = mirkey(audio)
|
wolffd@0
|
18
|
wolffd@0
|
19 %%
|
wolffd@0
|
20 %pause
|
wolffd@0
|
21 clear a b c f
|
wolffd@0
|
22 close all
|
wolffd@0
|
23
|
wolffd@0
|
24 f = mirfeatures(audio);
|
wolffd@0
|
25 sf = mirstat(f);
|
wolffd@0
|
26
|
wolffd@0
|
27 f.dynamics.rms{1}
|
wolffd@0
|
28 f.fluctuation.peak{1}
|
wolffd@0
|
29 f.fluctuation.centroid{1}
|
wolffd@0
|
30 f.rhythm.tempo{:}
|
wolffd@0
|
31 f.rhythm.attack.time{:}
|
wolffd@0
|
32 f.rhythm.attack.slope{1}
|
wolffd@0
|
33 sf.dynamics.rms
|
wolffd@0
|
34 sf.fluctuation.peak
|
wolffd@0
|
35 sf.fluctuation.centroid
|
wolffd@0
|
36 sf.rhythm.tempo
|
wolffd@0
|
37 sf.rhythm.attack.time
|
wolffd@0
|
38 sf.rhythm.attack.slope
|
wolffd@0
|
39
|
wolffd@0
|
40 %pause
|
wolffd@0
|
41 close all
|
wolffd@0
|
42
|
wolffd@0
|
43 f.timbre.zerocross{:}
|
wolffd@0
|
44 f.spectral.centroid{:}
|
wolffd@0
|
45 f.spectral.brightness{:}
|
wolffd@0
|
46 f.spectral.spread{:}
|
wolffd@0
|
47 f.spectral.skewness{:}
|
wolffd@0
|
48 f.spectral.kurtosis{:}
|
wolffd@0
|
49 f.spectral.rolloff95{:}
|
wolffd@0
|
50 f.spectral.rolloff85{:}
|
wolffd@0
|
51 f.spectral.spectentropy{:}
|
wolffd@0
|
52 f.spectral.flatness{:}
|
wolffd@0
|
53 sf.timbre.zerocross
|
wolffd@0
|
54 sf.spectral.centroid
|
wolffd@0
|
55 sf.spectral.brightness
|
wolffd@0
|
56 sf.spectral.spread
|
wolffd@0
|
57 sf.spectral.skewness
|
wolffd@0
|
58 sf.spectral.kurtosis
|
wolffd@0
|
59 sf.spectral.rolloff95
|
wolffd@0
|
60 sf.spectral.rolloff85
|
wolffd@0
|
61 sf.spectral.spectentropy
|
wolffd@0
|
62 sf.spectral.flatness
|
wolffd@0
|
63
|
wolffd@0
|
64 %pause
|
wolffd@0
|
65 close all
|
wolffd@0
|
66
|
wolffd@0
|
67 f.spectral.roughness{:}
|
wolffd@0
|
68 f.spectral.irregularity{:}
|
wolffd@0
|
69 %f.timbre.inharmonicity{:}
|
wolffd@0
|
70 f.spectral.mfcc{:}
|
wolffd@0
|
71 f.spectral.dmfcc{:}
|
wolffd@0
|
72 f.spectral.ddmfcc{:}
|
wolffd@0
|
73 f.timbre.lowenergy{:}
|
wolffd@0
|
74 sf.spectral.roughness
|
wolffd@0
|
75 sf.spectral.irregularity
|
wolffd@0
|
76 %sf.timbre.inharmonicity
|
wolffd@0
|
77 sf.spectral.mfcc
|
wolffd@0
|
78 sf.spectral.dmfcc
|
wolffd@0
|
79 sf.spectral.ddmfcc
|
wolffd@0
|
80 sf.timbre.lowenergy
|
wolffd@0
|
81
|
wolffd@0
|
82 %pause
|
wolffd@0
|
83 close all
|
wolffd@0
|
84
|
wolffd@0
|
85 f.timbre.spectralflux{:}
|
wolffd@0
|
86 %f.pitch.salient{:}
|
wolffd@0
|
87 f.tonal.chromagram.peak{:}
|
wolffd@0
|
88 f.tonal.chromagram.centroid{:}
|
wolffd@0
|
89 f.tonal.keyclarity{:}
|
wolffd@0
|
90 f.tonal.mode{:}
|
wolffd@0
|
91 f.tonal.hcdf{:}
|
wolffd@0
|
92 sf.timbre.spectralflux
|
wolffd@0
|
93 %sf.pitch.salient
|
wolffd@0
|
94 sf.tonal.chromagram.peak
|
wolffd@0
|
95 sf.tonal.chromagram.centroid
|
wolffd@0
|
96 sf.tonal.keyclarity
|
wolffd@0
|
97 sf.tonal.mode
|
wolffd@0
|
98 sf.tonal.hcdf
|
wolffd@0
|
99
|
wolffd@0
|
100 mirexport('resultdemo.txt',sf)
|
wolffd@0
|
101 mirexport('resultdemo.arff',f)
|
wolffd@0
|
102
|
wolffd@0
|
103 %% Version 1.1
|
wolffd@0
|
104
|
wolffd@0
|
105 %pause
|
wolffd@0
|
106 clear f
|
wolffd@0
|
107 close all
|
wolffd@0
|
108
|
wolffd@0
|
109 mirlength(audio)
|
wolffd@0
|
110 s = mirspectrum(audio,'cents','Min',50)
|
wolffd@0
|
111 s = mirspectrum(s,'Collapsed')
|
wolffd@0
|
112 mirspectrum(s,'Gauss')
|
wolffd@0
|
113 ss = mirspectrum(s,'Smooth')
|
wolffd@0
|
114 p = mirpeaks(ss,'Extract')
|
wolffd@0
|
115 mirkurtosis(p)
|
wolffd@0
|
116 [le,f] = mirlowenergy(audio,'ASR')
|
wolffd@0
|
117 p = mirpitch(audio,'frame')
|
wolffd@0
|
118 mirpitch(p,'median')
|
wolffd@0
|
119 mirauditory(audio)
|
wolffd@0
|
120 mirroughness('ragtime')
|
wolffd@0
|
121
|
wolffd@0
|
122 %%
|
wolffd@0
|
123 %pause
|
wolffd@0
|
124 clear s ss p le f
|
wolffd@0
|
125 close all
|
wolffd@0
|
126
|
wolffd@0
|
127 fb = mirfilterbank('Design','NbChannels',5)
|
wolffd@0
|
128 f = mirfeatures(fb);
|
wolffd@0
|
129 %sf = mirstat(f);
|
wolffd@0
|
130 f = mireval(f,audio)
|
wolffd@0
|
131
|
wolffd@0
|
132 f.dynamics.rms{1}
|
wolffd@0
|
133 f.fluctuation.peak{1}
|
wolffd@0
|
134 f.fluctuation.centroid{1}
|
wolffd@0
|
135 f.rhythm.tempo{:}
|
wolffd@0
|
136 f.rhythm.attack.time{:}
|
wolffd@0
|
137 f.rhythm.attack.slope{1}
|
wolffd@0
|
138
|
wolffd@0
|
139 %pause
|
wolffd@0
|
140 close all
|
wolffd@0
|
141
|
wolffd@0
|
142 f.timbre.zerocross{:}
|
wolffd@0
|
143 f.spectral.centroid{:}
|
wolffd@0
|
144 f.spectral.brightness{:}
|
wolffd@0
|
145 f.spectral.spread{:}
|
wolffd@0
|
146 f.spectral.skewness{:}
|
wolffd@0
|
147 f.spectral.kurtosis{:}
|
wolffd@0
|
148 f.spectral.rolloff95{:}
|
wolffd@0
|
149 f.spectral.rolloff85{:}
|
wolffd@0
|
150 f.spectral.spectentropy{:}
|
wolffd@0
|
151 f.spectral.flatness{:}
|
wolffd@0
|
152
|
wolffd@0
|
153 %pause
|
wolffd@0
|
154 close all
|
wolffd@0
|
155
|
wolffd@0
|
156 f.spectral.roughness{:}
|
wolffd@0
|
157 f.spectral.irregularity{:}
|
wolffd@0
|
158 %f.timbre.inharmonicity{:}
|
wolffd@0
|
159 f.spectral.mfcc{:}
|
wolffd@0
|
160 f.spectral.dmfcc{:}
|
wolffd@0
|
161 f.spectral.ddmfcc{:}
|
wolffd@0
|
162 f.timbre.lowenergy{:}
|
wolffd@0
|
163
|
wolffd@0
|
164 %pause
|
wolffd@0
|
165 close all
|
wolffd@0
|
166
|
wolffd@0
|
167 f.timbre.spectralflux{:}
|
wolffd@0
|
168 %f.pitch.salient{:}
|
wolffd@0
|
169 f.tonal.chromagram.peak{:}
|
wolffd@0
|
170 f.tonal.chromagram.centroid{:}
|
wolffd@0
|
171 f.tonal.keyclarity{:}
|
wolffd@0
|
172 f.tonal.mode{:}
|
wolffd@0
|
173 f.tonal.hcdf{:} |