function [out, w, b] = bsep( mix, ep, p, h, m);

if nargin == 4
        m = 0;
end

'Randperm'
% make permuted timeindex
i = randperm( cols( mix)); 

'pre-whitening'
% prewhiten data (ensures zero-mean and secord-order independence)
[wmix, v, mn] = prewhite( mix(:,i));

% make initial weights and bias
w = diag(ones( 1, rows( mix)), 0);
b = zeros( 1, rows( mix));

'find unmixing matrix'
% find unmixing matrix
[w, b] = sepcore( wmix, w, b, ep, p, h, m);

'unmix'
% separate
out = w * mix;


%*********************************************************************
