function [A, W] = fpica(X, whiteningMatrix, dewhiteningMatrix, approach, ...
numOfIC, g, finetune, a1, a2, myy, stabilization, ...
epsilon, maxNumIterations, maxFinetune, initState, ...
guess, sampleSize, displayMode, displayInterval, ...
s_verbose);
%FPICA - Fixed point ICA. Main algorithm of FASTICA.
% ICA算法的顶点运算主程序。
% [A, W] = fpica(whitesig, whiteningMatrix, dewhiteningMatrix, approach,
% numOfIC, g, finetune, a1, a2, mu, stabilization, epsilon,
% maxNumIterations, maxFinetune, initState, guess, sampleSize,
% displayMode, displayInterval, verbose);
%
% Perform independent component analysis using Hyvarinen's fixed point
% algorithm. Outputs an estimate of the mixing matrix A and its inverse W.
% 使用Hyvarinen顶点算法进行ICA运算,输出A为混合矩阵,W为解混矩阵。
% whitesig 白化过程 :the whitened data as row vectors
% whiteningMatrix :can be obtained with function whitenv
% dewhiteningMatrix :can be obtained with function whitenv
% 这两个矩阵均可以通过whitenv这个函数来获取。
% approach [ 'symm' | 'defl' ] :the approach used (deflation or symmetric)
% numOfIC [ 0 - Dim of whitesig ] :number of independent components estimated
% g [ 'pow3' | 'tanh' | :the nonlinearity used
% 'gaus' | 'skew' ]
% finetune [same as g + 'off'] :the nonlinearity used in finetuning.
% a1 :parameter for tuning 'tanh'
% a2 :parameter for tuning 'gaus'
% mu :step size in stabilized algorithm
% stabilization [ 'on' | 'off' ] :if mu < 1 then automatically on
% epsilon :stopping criterion
% maxNumIterations :maximum number of iterations
% maxFinetune :maximum number of iteretions for finetuning
% initState [ 'rand' | 'guess' ] :initial guess or random initial state. See below
% guess :initial guess for A. Ignored if initState = 'rand'
% sampleSize [ 0 - 1 ] :percentage of the samples used in one iteration
% displayMode [ 'signals' | 'basis' | :plot running estimate
% 'filters' | 'off' ]
% displayInterval :number of iterations we take between plots
% verbose [ 'on' | 'off' ] :report progress in text format
%
% EXAMPLE
% [E, D] = pcamat(vectors);
% [nv, wm, dwm] = whitenv(vectors, E, D);
% [A, W] = fpica(nv, wm, dwm);
%
%
% This function is needed by FASTICA and FASTICAG
%
% See also FASTICA, FASTICAG, WHITENV, PCAMAT
% @(#)$Id: fpica.m,v 1.7 2005/06/16 12:52:55 jarmo Exp $
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Global variable for stopping the ICA calculations from the GUI
global g_FastICA_interrupt;
if isempty(g_FastICA_interrupt)
clear global g_FastICA_interrupt;
interruptible = 0;
else
interruptible = 1;
end
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Default values
if nargin < 3, error('Not enough arguments!'); end
[vectorSize, numSamples] = size(X);
if nargin < 20, s_verbose = 'on'; end
if nargin < 19, displayInterval = 1; end
if nargin < 18, displayMode = 'on'; end
if nargin < 17, sampleSize = 1; end
if nargin < 16, guess = 1; end
if nargin < 15, initState = 'rand'; end
if nargin < 14, maxFinetune = 100; end
if nargin < 13, maxNumIterations = 1000; end
if nargin < 12, epsilon = 0.0001; end
if nargin < 11, stabilization = 'on'; end
if nargin < 10, myy = 1; end
if nargin < 9, a2 = 1; end
if nargin < 8, a1 = 1; end
if nargin < 7, finetune = 'off'; end
if nargin < 6, g = 'pow3'; end
if nargin < 5, numOfIC = vectorSize; end % vectorSize = Dim
if nargin < 4, approach = 'defl'; end
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Checking the data
if ~isreal(X)
error('Input has an imaginary part.');
end
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Checking the value for verbose
switch lower(s_verbose)
case 'on'
b_verbose = 1;
case 'off'
b_verbose = 0;
otherwise
error(sprintf('Illegal value [ %s ] for parameter: ''verbose''\n', s_verbose));
end
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Checking the value for approach
switch lower(approach)
case 'symm'
approachMode = 1;
case 'defl'
approachMode = 2;
otherwise
error(sprintf('Illegal value [ %s ] for parameter: ''approach''\n', approach));
end
if b_verbose, fprintf('Used approach [ %s ].\n', approach); end
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Checking the value for numOfIC
if vectorSize < numOfIC
error('Must have numOfIC <= Dimension!');
end
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Checking the sampleSize
if sampleSize > 1
sampleSize = 1;
if b_verbose
fprintf('Warning: Setting ''sampleSize'' to 1.\n');
end
elseif sampleSize < 1
if (sampleSize * numSamples) < 1000
sampleSize = min(1000/numSamples, 1);
if b_verbose
fprintf('Warning: Setting ''sampleSize'' to %0.3f (%d samples).\n', ...
sampleSize, floor(sampleSize * numSamples));
end
end
end
if b_verbose
if b_verbose & (sampleSize < 1)
fprintf('Using about %0.0f%% of the samples in random order in every step.\n',sampleSize*100);
end
end
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Checking the value for nonlinearity.
switch lower(g)
case 'pow3'
gOrig = 10;
case 'tanh'
gOrig = 20;
case {'gaus', 'gauss'}
gOrig = 30;
case 'skew'
gOrig = 40;
otherwise
error(sprintf('Illegal value [ %s ] for parameter: ''g''\n', g));
end
if sampleSize ~= 1
gOrig = gOrig + 2;
end
if myy ~= 1
gOrig = gOrig + 1;
end
if b_verbose,
fprintf('Used nonlinearity [ %s ].\n', g);
end
finetuningEnabled = 1;
switch lower(finetune)
case 'pow3'
gFine = 10 + 1;
case 'tanh'
gFine = 20 + 1;
case {'gaus', 'gauss'}
gFine = 30 + 1;
case 'skew'
gFine = 40 + 1;
case 'off'
if myy ~= 1
gFine = gOrig;
else
gFine = gOrig + 1;
end
finetuningEnabled = 0;
otherwise
error(sprintf('Illegal value [ %s ] for parameter: ''finetune''\n', ...
finetune));
end
if b_verbose & finetuningEnabled
fprintf('Finetuning enabled (nonlinearity: [ %s ]).\n', finetune);
end
switch lower(stabilization)
case 'on'
stabilizationEnabled = 1;
case 'off'
if myy ~= 1
stabilizationEnabled = 1;
else
stabilizationEnabled = 0;
end
otherwise
error(sprintf('Illegal value [ %s ] for parameter: ''stabilization''\n', ...
stabilization));
end
if b_verbose & stabilizationEnabled
fprintf('Using stabilized algorithm.\n');
end
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Some other parameters
myyOrig = myy;
% When we start fine-tuning we'll set myy = myyK * myy
myyK = 0.01;
% How many times do we try for convergence until we give up.
failureLimit = 5;
usedNlinearity = gOrig;
stroke = 0;
notFine = 1;
long = 0;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Checking the value for initial state.
switch lower(initState)
case 'rand'
initialStateMode = 0;
case 'guess'
if size(guess,1) ~= size(whiteningMatrix,2)
initialStateMode = 0;
if b_verbose
fprintf('Warning: size of initial guess is incorrect. Using random initial guess.\n');
end
else
initialStateMode = 1;
if size(guess,2) < numOfIC
if b_verbose
fprintf('Warning: initial guess only for first %d components. Using random initial guess for others.\n', size(guess,2));
end
guess(:, size(guess, 2) + 1:numOfIC) = ...
rand(vectorSize,numOfIC-size(guess,2
没有合适的资源?快使用搜索试试~ 我知道了~
FastICA+gui_图像去噪GUI_快速ICA_
共29个文件
m:19个
m~:4个
readme_ica:1个
1.该资源内容由用户上传,如若侵权请联系客服进行举报
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
版权申诉
5星 · 超过95%的资源 4 下载量 175 浏览量
2021-10-04
10:43:14
上传
评论 2
收藏 84KB ZIP 举报
温馨提示
快速ICA算法进行图像去噪处理,包括.m文件和GUI界面
资源推荐
资源详情
资源评论
收起资源包目录
FastICA+gui.zip (29个子文件)
FastICA+gui
README_ICA 2KB
gui_cb.m 19KB
gui_sc.m 2KB
gui_help.m 14KB
fasticag.m 19KB
pcamat.m 12KB
gui_s.m 5KB
gui_advc.m 7KB
remmean.m 528B
remmean.m~ 461B
README_ICA~ 2KB
demosig.m~ 839B
fastica.m 18KB
test.mat 25KB
Contents.m 1KB
fpica.m 26KB
fpica.m~ 26KB
whitenv.m 3KB
CVS
Root 21B
Repository 8B
Entries 794B
icaplot.m 13KB
gui_cg.m 3KB
gui_adv.m 13KB
gui_lc.m 4KB
dispsig.m 402B
demosig.m 859B
fastica.m~ 18KB
gui_l.m 5KB
共 29 条
- 1
资源评论
- wwwangyutonga2021-12-02用户下载后在一定时间内未进行评价,系统默认好评。
- MidoriZ_2022-07-06果断支持这个资源,资源解决了当前遇到的问题,给了新的灵感,感谢分享~
- Lucio9592022-11-19资源简直太好了,完美解决了当下遇到的难题,这样的资源很难不支持~
程籽籽
- 粉丝: 68
- 资源: 4722
下载权益
C知道特权
VIP文章
课程特权
开通VIP
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功