Mercurial > hg > smallbox
diff 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 |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/examples/SMALL_solver_test_Audio.m Thu Nov 05 16:36:01 2009 +0000 @@ -0,0 +1,93 @@ +function SMALL_solver_test_Audio +% Example test of solvers on Sparco audio source separation problems +% +% The main purpose of this example is to show how to use SMALL structure +% to solve SPARCO audio source3 separation problems (401-402) and to +% compare results from different solvers. +% To generate SMALL.Problem part of structure you can use generateProblem +% function from Sparco toolbox giving the problem number and any +% additional parameters you might want to change. Alternatively, you can +% might want to consult sparco documentation to write a problem by +% yourself. There are four fields the must be specified in SMALL.Problem +% - A, b, sizeA and reconstruct. +% +% To generate SMALL.solver part of the structure you must specify three +% fields: +% +% SMALL.solver.toolbox - string with toolbox name is needed because +% different toolboxes are calling solver +% functions in different ways. +% SMALL.solver.name - its string representing solver name (e.g. +% SolveBP) +% SMALL.solver.param - string that contains optional parameters for +% particular solver (all parameters you want to +% specify except A, b and size of solution) +% +% Every call to SMALL_solve function will generate following output: +% +% SMALL.solver.solution - contains solution vector x +% SMALL.solver.reconstructed - vector containing signal reconstructed +% from the solution +% SMALL.solver.time - time that solver spent to find the solution +% +% SMALL_plot function plots the SMALL.solver.solution and reconstructed +% sources against original audio sources. +% SMALL_playAudio function plays audio sources of original and +% reconstructed signal as well as mixed signal. +% +% +% Ivan Damnjanovic 2009% +% +% SPARCO Copyright 2008, Ewout van den Berg and Michael P. Friedlander +% http://www.cs.ubc.ca/labs/scl/sparco +% $Id: exGPSR.m 1040 2008-06-26 20:29:02Z ewout78 $ + +fprintf('\n\nExample test of solvers on Sparco Audio problems (401,402).\n\n'); + +%% +% Generate SPARCO problem + +global SMALL +SMALL.Problem = generateProblem(402,'show'); +%% + +%% +% SMALL Conjugate Gradient test + +SMALL.solver.toolbox='SMALL'; +SMALL.solver.name='SMALL_cgp'; + +% In the following string all parameters except matrix, measurement vector +% and size of solution need to be specified. If you are not sure which +% parameters are needed for particular solver type "help <Solver name>" in +% MATLAB command line + +SMALL.solver.param='1500, 1e-14'; + +SMALL=SMALL_solve(SMALL); + + +SMALL_plot(SMALL); +SMALL_playAudio(SMALL); + +%% +% SolveOMP from SparseLab test + +SMALL.solver.toolbox='SparseLab'; +SMALL.solver.name='SolveBP'; + +% In the following string all parameters except matrix, measurement vector +% and size of solution need to be specified. If you are not sure which +% parameters are needed for particular solver type "help <Solver name>" in +% MATLAB command line + +SMALL.solver.param='10'; + +SMALL=SMALL_solve(SMALL); + +SMALL_plot(SMALL); +SMALL_playAudio(SMALL); +%% + + +end % function SMALL_solver_test