%% program to test the ICA method for BLIND SOURCE DECOMPOSITION

%% First -- to illustrate the problem -- the code that generated the
% MIXED signals is shown. The sources are NOT given


% %% loading the SOURCES
% ch = wavread('chopin');
% pl = wavread('plesu');
% ov = wavread('overtherainbow');
% po = wavread('poet');
% 
% %% Generating the mixing matrix
% A = randn(4);
% A = A / norm(A);
% 
% %% Performing the mixing
% res = [ch pl po ov] * A;
% m1 = res(:,1);
% m2 = res(:,2);
% m3 = res(:,3);
% m4 = res(:,4);
% 
% %% Saving the results
% wavwrite(m1,'m1.wav');
% wavwrite(m2,'m2.wav');
% wavwrite(m3,'m3.wav');
% wavwrite(m4,'m4.wav');


%% The decomposition part


m1 = wavread('m1');
m2 = wavread('m2');
m3 = wavread('m3');
m4 = wavread('m4');

% for testing you can use the following code:
% wavplay(m1,22050,'sync')

% collating the four observations
m = [m1 m2 m3 m4];
% finding the sources
%
% with a less powerful computer there MIGHT be problems when using the
% graphical interface. Use the commands and explore the documentation.
%
% ... ... ...
% ... ...
%