Mercurial > hg > smallbox
comparison examples/SMALL_solver_test_Audio.m @ 1:7750624e0c73 version0.5
(none)
author | idamnjanovic |
---|---|
date | Thu, 05 Nov 2009 16:36:01 +0000 |
parents | |
children | f44689e95ea4 |
comparison
equal
deleted
inserted
replaced
0:5181bee80bc1 | 1:7750624e0c73 |
---|---|
1 function SMALL_solver_test_Audio | |
2 % Example test of solvers on Sparco audio source separation problems | |
3 % | |
4 % The main purpose of this example is to show how to use SMALL structure | |
5 % to solve SPARCO audio source3 separation problems (401-402) and to | |
6 % compare results from different solvers. | |
7 % To generate SMALL.Problem part of structure you can use generateProblem | |
8 % function from Sparco toolbox giving the problem number and any | |
9 % additional parameters you might want to change. Alternatively, you can | |
10 % might want to consult sparco documentation to write a problem by | |
11 % yourself. There are four fields the must be specified in SMALL.Problem | |
12 % - A, b, sizeA and reconstruct. | |
13 % | |
14 % To generate SMALL.solver part of the structure you must specify three | |
15 % fields: | |
16 % | |
17 % SMALL.solver.toolbox - string with toolbox name is needed because | |
18 % different toolboxes are calling solver | |
19 % functions in different ways. | |
20 % SMALL.solver.name - its string representing solver name (e.g. | |
21 % SolveBP) | |
22 % SMALL.solver.param - string that contains optional parameters for | |
23 % particular solver (all parameters you want to | |
24 % specify except A, b and size of solution) | |
25 % | |
26 % Every call to SMALL_solve function will generate following output: | |
27 % | |
28 % SMALL.solver.solution - contains solution vector x | |
29 % SMALL.solver.reconstructed - vector containing signal reconstructed | |
30 % from the solution | |
31 % SMALL.solver.time - time that solver spent to find the solution | |
32 % | |
33 % SMALL_plot function plots the SMALL.solver.solution and reconstructed | |
34 % sources against original audio sources. | |
35 % SMALL_playAudio function plays audio sources of original and | |
36 % reconstructed signal as well as mixed signal. | |
37 % | |
38 % | |
39 % Ivan Damnjanovic 2009% | |
40 % | |
41 % SPARCO Copyright 2008, Ewout van den Berg and Michael P. Friedlander | |
42 % http://www.cs.ubc.ca/labs/scl/sparco | |
43 % $Id: exGPSR.m 1040 2008-06-26 20:29:02Z ewout78 $ | |
44 | |
45 fprintf('\n\nExample test of solvers on Sparco Audio problems (401,402).\n\n'); | |
46 | |
47 %% | |
48 % Generate SPARCO problem | |
49 | |
50 global SMALL | |
51 SMALL.Problem = generateProblem(402,'show'); | |
52 %% | |
53 | |
54 %% | |
55 % SMALL Conjugate Gradient test | |
56 | |
57 SMALL.solver.toolbox='SMALL'; | |
58 SMALL.solver.name='SMALL_cgp'; | |
59 | |
60 % In the following string all parameters except matrix, measurement vector | |
61 % and size of solution need to be specified. If you are not sure which | |
62 % parameters are needed for particular solver type "help <Solver name>" in | |
63 % MATLAB command line | |
64 | |
65 SMALL.solver.param='1500, 1e-14'; | |
66 | |
67 SMALL=SMALL_solve(SMALL); | |
68 | |
69 | |
70 SMALL_plot(SMALL); | |
71 SMALL_playAudio(SMALL); | |
72 | |
73 %% | |
74 % SolveOMP from SparseLab test | |
75 | |
76 SMALL.solver.toolbox='SparseLab'; | |
77 SMALL.solver.name='SolveBP'; | |
78 | |
79 % In the following string all parameters except matrix, measurement vector | |
80 % and size of solution need to be specified. If you are not sure which | |
81 % parameters are needed for particular solver type "help <Solver name>" in | |
82 % MATLAB command line | |
83 | |
84 SMALL.solver.param='10'; | |
85 | |
86 SMALL=SMALL_solve(SMALL); | |
87 | |
88 SMALL_plot(SMALL); | |
89 SMALL_playAudio(SMALL); | |
90 %% | |
91 | |
92 | |
93 end % function SMALL_solver_test |