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