2012HackSessionNotes » History » Version 8

Luis Figueira, 2012-06-20 04:32 PM
minor changes

1 6 Luis Figueira
h1. 2012 Hack Session Notes
2 1 Luis Figueira
3 1 Luis Figueira
4 8 Luis Figueira
h2. Running SMALLbox Add-ons 
5 1 Luis Figueira
6 8 Luis Figueira
_note: this is an example add-on developed by Daniele Barchiese._ 
7 8 Luis Figueira
8 6 Luis Figueira
These are the steps needed to interface SMALLbox add-ons to the core SMALLbox distribulation:
9 1 Luis Figueira
10 1 Luis Figueira
# Download the add-on distribution from: http://code.soundsoftware.ac.uk/projects/incoherentdl/files
11 1 Luis Figueira
** The version you wish to download is *version 1.1*
12 1 Luis Figueira
** unzip the downloaded file - this will create a folder named incoherentdl-v1_1
13 8 Luis Figueira
# Place the add-on code in any convenient location of your file system
14 8 Luis Figueira
** if you copy it to somewhere outside the SMALLBox folder, you'll need to add it to your path
15 8 Luis Figueira
*** @addpath(genpath('{incoherentdl-v1_1}'))@
16 8 Luis Figueira
** if you place it under the @{SMALLBox Root}/Toolboxes@ folder, it will be added when you run the init script
17 6 Luis Figueira
# Modify the relevant files in the folder @{SMALLBox Root}/config/@
18 6 Luis Figueira
** modify or create @{SMALLBox Root}/config/SMALL_learn_config_local.m@
19 7 Luis Figueira
*** @cp {SMALLBox Root}/config/SMALL_learn_local.m {SMALLBox Root}/config/SMALL_learn_config_local.m@
20 6 Luis Figueira
**** this local file is not tracked by Mercurial 
21 6 Luis Figueira
**** if you need to revert to the _default_ SMALLbox setting, you just need to delete/rename your local file
22 5 Luis Figueira
*** add the following code to the local config file: 
23 2 Luis Figueira
<pre>
24 2 Luis Figueira
elseif strcmpi(DL.toolbox , 'SMALL_incoherentDL')
25 3 Luis Figueira
  DL=SMALL_incoherentDL ( Problem , DL ) ;
26 3 Luis Figueira
   % we need to make sure that columns are normalised to % unit lenght .
27 3 Luis Figueira
  for i = 1: size(DL.D,2)
28 3 Luis Figueira
    DL.D(: ,i)=DL.D(: ,i)/norm(DL.D(: ,i));
29 3 Luis Figueira
  end
30 2 Luis Figueira
  D = DL.D;
31 2 Luis Figueira
</pre>
32 6 Luis Figueira
# Run the @SMALLboxInit.m@ script to set environmental variables
33 6 Luis Figueira
# Run any function or script contained in the add-on.
34 4 Luis Figueira
** example: 
35 6 Luis Figueira
*** @load test_mocod.mat@ 
36 6 Luis Figueira
**** located in @incoherentdl-v1_1/results/test_mocod.mat@ (but already in path)
37 6 Luis Figueira
*** @open SMALL_test_mocod.m@
38 6 Luis Figueira
**** located in @incoherentdl-v1_1/open SMALL_test_mocod.m@
39 1 Luis Figueira
*** run the code from the block that starts on line 110 (with the comment Plot Results)
40 1 Luis Figueira
**** this will display two coherence/signal to noise ratio plots based on results previously computed