-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathdo_matlab_frq_ica_2d.m
69 lines (55 loc) · 1.91 KB
/
do_matlab_frq_ica_2d.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
%%
% Institute for Signal Processing (University of Luebeck, Germany)
% Copyright (c) 2011 by Radoslaw Mazur
%
% Permission to use, copy, modify, and distribute this software without
% fee is hereby granted FOR RESEARCH/EDUCATION PURPOSES only, provided
% that this copyright notice appears in all copies and in all supporting
% documentation, and that the software is not redistributed for any
% fee (except for a nominal shipping charge).
%
% For any other uses of this software, in original or modified form,
% including but not limited to consulting, production or distribution
% in whole or in part, specific prior permission must be obtained
% from the author.
% Signal processing methods and algorithms implemented by this
% software may be claimed by patents owned by others.
%
% The author makes no representation about the suitability of this
% software for any purpose. It is provided "as is" without warranty
% of any kind, either expressed or implied.
% Beware of the bugs.
%
% Revision history
%
% Ver Date Description
% -------------------------------------------------------------------
% 0.5 21-08-2011 basic version
%
function [WW px] = do_matlab_frq_ica_2d(spec1, spec2, iterations, mue)
%%
[fbins, mlen] = size(spec1);
observations = 2;
WW = zeros(observations,observations,fbins);
II = eye(observations);
t = clock;
for ii=1:fbins
%%
if (true)
if mod(ii,100)==1;
elap_time = etime(clock,t);
eta_time = elap_time/ii*(fbins-ii);
fprintf('separating %3.0f%% Time: %4.0fs ETA: %4.0fs \n', ii/fbins*100,elap_time,eta_time)
end
end
X=[spec1(ii,:);spec2(ii,:)];
W = eye(observations);
for n=1:iterations
Y=W*X;
nonlinearF = sign(Y);
d_tmp = (II - nonlinearF * Y'/mlen)*W;
W = W + mue*d_tmp;
end
WW(:,:,ii) = W;
%WW(:,:,ii) = diag(diag(W_raw^-1))*W_raw;
end