Mercurial > hg > simscene-py
comparison demo.m @ 14:b1901e8d8f5f
initial commit
author | Mathieu Lagrange <mathieu.lagrange@cnrs.fr> |
---|---|
date | Tue, 17 Mar 2015 09:34:13 +0100 |
parents | |
children | fc99c676c280 |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 14:b1901e8d8f5f |
---|---|
1 % SimScene is a set of Matlab functions dedicated to the simulation of acoustic scenes. | |
2 % This tool is specifically tailored to the evaluation of machine listening systems. | |
3 % Thus, extensive and precise annotation of the scene content is provided together with the simulated scene. | |
4 % | |
5 % This tool is a research tool, provided as-is with the hope that it will be | |
6 % useful and easy to adapt to the needs of others. Do not hesitate to provide | |
7 % us with feedback at the following mail address: mathieu.lagrange@cnrs.fr | |
8 % | |
9 % SimScene have been tested on Matlab R2013b. The input audio files must be sampled at 44100 Hz. | |
10 | |
11 % clear all; | |
12 % close all; | |
13 | |
14 inputPath='./sound/'; | |
15 outputPath='./results/'; | |
16 | |
17 %% timeMode: 'generate' -- ebrMode: 'generate' | |
18 | |
19 timeMode='generate'; | |
20 ebrMode='generate'; | |
21 sceneDuration=15; | |
22 | |
23 score.sceneDuration=sceneDuration; | |
24 score.backgrounds={{'forest','forest', 1}}; | |
25 score.events={{'alouette','alouette', 12, 0, 2, 0.1, 1, 10, 0, 0},... | |
26 {'bulbul' ,'bulbul' , 6 , 0, 2, 0, 3, 13, 0, 0},... | |
27 {'geai' ,'geai' , 6 , 0, 1, 0.25, 5, 10, 0, 0}}; | |
28 | |
29 sceneId = ['demo_forest_timeMode_' timeMode '_ebrMode_' ebrMode]; | |
30 disp(sceneId); | |
31 | |
32 simScene(inputPath,outputPath,score,... | |
33 'timeMode',timeMode,'ebrMode',ebrMode,'outputFileName',sceneId); | |
34 | |
35 %% timeMode: 'replicate' -- ebrMode: 'replicate' | |
36 | |
37 instanceAnnotFile='./scene2Replicate/forest.txt'; | |
38 instanceAudioFile='./scene2Replicate/forest.wav'; | |
39 | |
40 timeMode='replicate'; | |
41 ebrMode='replicate'; | |
42 sceneId = ['demo_forest_timeMode_' timeMode '_ebrMode_' ebrMode]; | |
43 disp(sceneId); | |
44 | |
45 score.backgrounds={{'forest','forest', 1}}; | |
46 | |
47 score.events={{'alouette','', -3, 0, 0, 0, 0, 0, 0, 0},... % Only change <ebr> | |
48 {'bulbul','', 3, 0, 0, 0, 6, 0, 0, 0}}; % Change <ebr> and <start_time> | |
49 | |
50 % If score.event is of length 1 and <label>='', offsets will be used for all classes. | |
51 % score.events={{'','',-6,0,0,0,0,0,0,0}}; % Change <ebr> for the three sound classes of bird. | |
52 | |
53 simScene(inputPath,outputPath,score,... | |
54 'timeMode',timeMode,'ebrMode',ebrMode,'outputFileName',sceneId,... | |
55 'instanceAnnotFile',instanceAnnotFile,'instanceAudioFile',instanceAudioFile); | |
56 | |
57 %% timeMode: 'abstract' -- ebrMode: 'abstract' | |
58 | |
59 instanceAnnotFile='./scene2Replicate/forest.txt'; | |
60 instanceAudioFile='./scene2Replicate/forest.wav'; | |
61 | |
62 timeMode='abstract'; | |
63 ebrMode='abstract'; | |
64 sceneId = ['demo_forest_timeMode_' timeMode '_ebrMode_' ebrMode]; | |
65 disp(sceneId); | |
66 | |
67 score.backgrounds={{'forest','forest', 1}}; | |
68 score.events={{'geai','', -3, 0, 5, 0, 1, 0, 0, 0}}; % Change <ebr>, <mean_time_between_instances> and <start_time> | |
69 | |
70 simScene(inputPath,outputPath,score,... | |
71 'timeMode',timeMode,'ebrMode',ebrMode,'outputFileName',sceneId,... | |
72 'instanceAnnotFile',instanceAnnotFile,'instanceAudioFile',instanceAudioFile); |