⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 gui_cb.m

📁 这是盲信号的代码 都已经通过编译了 做这方面的同仁可以参考一下 我觉得蛮惯用的
💻 M
📖 第 1 页 / 共 3 页
字号:
     %gui_cb Whiten;     g_FastICA_mixedsig=baihua(g_FastICA_mixedsig);   end     set(ht_FastICA_icaStatus,'String','Computing...');      % The possible values for g depend on approach   eval(['g_str = c_FastICA_g' int2str(g_FastICA_approach) '_strV;']);      % We'll contruct a command string which we'll later on evaluate...   % This is where the Fixed point algorithm is used.   command_str = ['g_FastICA_ica_sig = slfilter(g_FastICA_mixedsig);'];      % If the user wants to plot while computing...   % let's at least plot it to the right figure then   if ~strcmp(deblank(c_FastICA_dMod_strV(g_FastICA_displayMo,:)),'off')     handle = findobj('Tag','f_FastICA_ica');  % Check if the window is already     if isempty(handle)                        % open. If not then open it.       figure('Tag', 'f_FastICA_ica', ...	      'Name', '长短滤波算法: Plot ICs', ...	      'NumberTitle', 'off');     else       figure(handle);       clf;		% clear the figure for next plots     end   end      % ... and so let's do it...   eval(command_str);      % Also notice that in this version if there was something wrong in FPICA   % Then the results are [].   if ~isempty(g_FastICA_ica_sig)     % Add the mean back in. %    g_FastICA_ica_sig = g_FastICA_ica_W * g_FastICA_mixedsig;     disp('长短滤波算法.......');     mplot(g_FastICA_ica_sig);     set (ht_FastICA_icaStatus,'String','长短滤波 has Done');   else     gui_cb NullICA;  % set icasig=[] and do what ever needs to be done then   end      if ~(g_FastICA_interrupt)     gui_cb EnableButtons;   end else%   fprintf('Data not loaded yet!\n\n');   msgbox('请先加载混合信号','提示'); end %%*******************************************************    case '最大信噪比'                if ~isempty(g_FastICA_mixedsig)     gui_cb DisableButtons;     g_FastICA_interrupt = 0;   if isempty(g_FastICA_white_sig)     % We need the whitened signal here     %gui_cb Whiten;     g_FastICA_mixedsig=baihua(g_FastICA_mixedsig);   end     set(ht_FastICA_icaStatus,'String','Computing...');      % The possible values for g depend on approach   eval(['g_str = c_FastICA_g' int2str(g_FastICA_approach) '_strV;']);      % We'll contruct a command string which we'll later on evaluate...   % This is where the Fixed point algorithm is used.   command_str = ['g_FastICA_ica_sig = NoMax(g_FastICA_mixedsig);'];      % If the user wants to plot while computing...   % let's at least plot it to the right figure then   if ~strcmp(deblank(c_FastICA_dMod_strV(g_FastICA_displayMo,:)),'off')     handle = findobj('Tag','f_FastICA_ica');  % Check if the window is already     if isempty(handle)                        % open. If not then open it.       figure('Tag', 'f_FastICA_ica', ...	      'Name', '最大信噪比: Plot ICs', ...	      'NumberTitle', 'off');     else       figure(handle);       clf;		% clear the figure for next plots     end   end      % ... and so let's do it...   eval(command_str);      % Also notice that in this version if there was something wrong in FPICA   % Then the results are [].   if ~isempty(g_FastICA_ica_sig)     % Add the mean back in. %    g_FastICA_ica_sig = g_FastICA_ica_W * g_FastICA_mixedsig;     disp('最大信噪比.......');     mplot(g_FastICA_ica_sig);     set (ht_FastICA_icaStatus,'String','最大信噪比 has Done');   else     gui_cb NullICA;  % set icasig=[] and do what ever needs to be done then   end      if ~(g_FastICA_interrupt)     gui_cb EnableButtons;   end else%   fprintf('Data not loaded yet!\n\n');   msgbox('请先加载混合信号','提示');  end %*********************************************************************case '去相关算法'                if ~isempty(g_FastICA_mixedsig)     gui_cb DisableButtons;     g_FastICA_interrupt = 0;   if isempty(g_FastICA_white_sig)     % We need the whitened signal here     %gui_cb Whiten;     g_FastICA_mixedsig=baihua(g_FastICA_mixedsig);   end     set(ht_FastICA_icaStatus,'String','Computing...');      % The possible values for g depend on approach   eval(['g_str = c_FastICA_g' int2str(g_FastICA_approach) '_strV;']);      % We'll contruct a command string which we'll later on evaluate...   % This is where the Fixed point algorithm is used.   command_str = ['g_FastICA_ica_sig = decorrection(g_FastICA_mixedsig);'];      % If the user wants to plot while computing...   % let's at least plot it to the right figure then   if ~strcmp(deblank(c_FastICA_dMod_strV(g_FastICA_displayMo,:)),'off')     handle = findobj('Tag','f_FastICA_ica');  % Check if the window is already     if isempty(handle)                        % open. If not then open it.       figure('Tag', 'f_FastICA_ica', ...	      'Name', '去相关算法: Plot ICs', ...	      'NumberTitle', 'off');     else       figure(handle);       clf;		% clear the figure for next plots     end   end      % ... and so let's do it...   eval(command_str);      % Also notice that in this version if there was something wrong in FPICA   % Then the results are [].   if ~isempty(g_FastICA_ica_sig)     % Add the mean back in. %    g_FastICA_ica_sig = g_FastICA_ica_W * g_FastICA_mixedsig;     disp('去相关算法.......');     mplot(g_FastICA_ica_sig);     set (ht_FastICA_icaStatus,'String','去相关算法 has Done');   else     gui_cb NullICA;  % set icasig=[] and do what ever needs to be done then   end      if ~(g_FastICA_interrupt)     gui_cb EnableButtons;   end else%   fprintf('Data not loaded yet!\n\n');   msgbox('请先加载混合信号','提示');  end %*********************************************************************case '改进开关法'                if ~isempty(g_FastICA_mixedsig)     gui_cb DisableButtons;     g_FastICA_interrupt = 0;   if isempty(g_FastICA_white_sig)     % We need the whitened signal here     %gui_cb Whiten;     g_FastICA_mixedsig=baihua(g_FastICA_mixedsig);   end     set(ht_FastICA_icaStatus,'String','Computing...');      % The possible values for g depend on approach   eval(['g_str = c_FastICA_g' int2str(g_FastICA_approach) '_strV;']);      % We'll contruct a command string which we'll later on evaluate...   % This is where the Fixed point algorithm is used.   command_str = ['g_FastICA_ica_sig = ExInfomax(g_FastICA_mixedsig);'];      % If the user wants to plot while computing...   % let's at least plot it to the right figure then   if ~strcmp(deblank(c_FastICA_dMod_strV(g_FastICA_displayMo,:)),'off')     handle = findobj('Tag','f_FastICA_ica');  % Check if the window is already     if isempty(handle)                        % open. If not then open it.       figure('Tag', 'f_FastICA_ica', ...	      'Name', '改进开关法: Plot ICs', ...	      'NumberTitle', 'off');     else       figure(handle);       clf;		% clear the figure for next plots     end   end      % ... and so let's do it...   eval(command_str);      % Also notice that in this version if there was something wrong in FPICA   % Then the results are [].   if ~isempty(g_FastICA_ica_sig)     % Add the mean back in. %    g_FastICA_ica_sig = g_FastICA_ica_W * g_FastICA_mixedsig;     disp('改进开关法.......');     mplot(g_FastICA_ica_sig);     set (ht_FastICA_icaStatus,'String','改进开关法 has Done');   else     gui_cb NullICA;  % set icasig=[] and do what ever needs to be done then   end      if ~(g_FastICA_interrupt)     gui_cb EnableButtons;   end else%   fprintf('Data not loaded yet!\n\n');   msgbox('请先加载混合信号','提示');  end %********************************************************************* case 'Fast_ICA'   if ~isempty(g_FastICA_mixedsig)     gui_cb DisableButtons;     g_FastICA_interrupt = 0;   if isempty(g_FastICA_white_sig)     % We need the whitened signal here     gui_cb Whiten;   end      set(ht_FastICA_icaStatus,'String','Computing...');      % The possible values for g depend on approach   eval(['g_str = c_FastICA_g' int2str(g_FastICA_approach) '_strV;']);      % We'll contruct a command string which we'll later on evaluate...   % This is where the Fixed point algorithm is used.   command_str = ['[g_FastICA_ica_A,g_FastICA_ica_W]=' ...		  'fpica(g_FastICA_white_sig,' ... 		  'g_FastICA_white_wm,' ... 		  'g_FastICA_white_dwm,' ...		  '''' deblank(c_FastICA_appr_strV(g_FastICA_approach,:)) ...		  ''',' ...		  'g_FastICA_numOfIC,' ...		  '''' deblank(g_str(g_FastICA_g,:)) ''',' ...		  '''' ...		  deblank(c_FastICA_finetune_strV(g_FastICA_finetune,:)) ...		  ''',' ...		  'g_FastICA_a1,' ...		  'g_FastICA_a2,' ...		  'g_FastICA_myy,' ...		  '''' ...		  deblank(c_FastICA_stabili_strV(g_FastICA_stabilization,:)) ...		  ''',' ...		  'g_FastICA_epsilon,' ...		  'g_FastICA_maxNumIte,' ...		  'g_FastICA_maxFinetune,' ...		  '''' deblank(c_FastICA_iSta_strV(g_FastICA_initState,:)) ...		  ''',' ...		  'g_FastICA_initGuess,' ...		  'g_FastICA_sampleSize,' ...		  '''' deblank(c_FastICA_dMod_strV(g_FastICA_displayMo,:)) ...		  ''',' ...		  'g_FastICA_displayIn,' ...		  '''' deblank(c_FastICA_verb_strV(g_FastICA_verbose,:)) ...		  ''');'];      % If the user wants to plot while computing...   % let's at least plot it to the right figure then   if ~strcmp(deblank(c_FastICA_dMod_strV(g_FastICA_displayMo,:)),'off')     handle = findobj('Tag','f_FastICA_ica');  % Check if the window is already     if isempty(handle)                        % open. If not then open it.       figure('Tag', 'f_FastICA_ica', ...	      'Name', 'FastICA: Plot ICs', ...	      'NumberTitle', 'off');     else       figure(handle);       clf;		% clear the figure for next plots     end   end      % ... and so let's do it...   eval(command_str);      % Also notice that in this version if there was something wrong in FPICA   % Then the results are [].   if ~isempty(g_FastICA_ica_W)     % Add the mean back in.     g_FastICA_ica_sig = g_FastICA_ica_W * g_FastICA_mixedsig ...			 + (g_FastICA_ica_W * g_FastICA_mixedmean) ...			 * ones(1,size(g_FastICA_mixedsig, 2));     set (ht_FastICA_icaStatus,'String','Done');   else     gui_cb NullICA;  % set icasig=[] and do what ever needs to be done then   end      if ~(g_FastICA_interrupt)     gui_cb EnableButtons;   end else   fprintf('Data not loaded yet!\n\n');   endend%%%%%%%%%%%%%%%%%%%%%%%%%*********************%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%case 'Interrupt' g_FastICA_interrupt = 1; set(ht_FastICA_icaStatus,'String','Interrupted'); gui_cb EnableButtons;%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%case 'DisableButtons' set(findobj('Tag','b_Transpose'),'Enable','off'); set(findobj('Tag','b_ShowMixed'),'Enable','off'); set(findobj('Tag','b_DoPCA'),'Enable','off'); set(findobj('Tag','b_OrigDim'),'Enable','off'); set(findobj('Tag','b_ShowWhite'),'Enable','off'); set(findobj('Tag','b_advOpt'),'Enable','off'); set(findobj('Tag','b_ShowICASig'),'Enable','off'); set(findobj('Tag','b_LoadData'),'Enable','off'); set(findobj('Tag','b_DoFPICA'),'Enable','off'); set(findobj('Tag','b_SaveData'),'Enable','off'); set(findobj('Tag','b_Quit'),'Enable','off'); set(findobj('Tag','b_Interrupt'),'Visible','on'); drawnow;%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%case 'EnableButtons' set(findobj('Tag','b_Transpose'),'Enable','on'); set(findobj('Tag','b_ShowMixed'),'Enable','on'); set(findobj('Tag','b_DoPCA'),'Enable','on'); set(findobj('Tag','b_OrigDim'),'Enable','on'); set(findobj('Tag','b_ShowWhite'),'Enable','on'); set(findobj('Tag','b_advOpt'),'Enable','on'); set(findobj('Tag','b_ShowICASig'),'Enable','on'); set(findobj('Tag','b_LoadData'),'Enable','on'); set(findobj('Tag','b_DoFPICA'),'Enable','on'); set(findobj('Tag','b_SaveData'),'Enable','on'); set(findobj('Tag','b_Quit'),'Enable','on'); set(findobj('Tag','b_Interrupt'),'Visible','off'); drawnow;%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%case 'SaveData' handle = findobj('Tag','f_FastICASave');  % Check if the window is already if isempty(handle)                        % open. If not then open it.   pos = get(hf_FastICA_MAIN, 'Position');   if ~isempty (pos),     gui_s(pos(1), pos(2));   else     gui_s(0, 0);   end else   figure(handle);                       % window. If it wasn't then end  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%case 'Quit' % We'll close the other dialogs if they are open. Tags = ['f_FastICALoad  '	 'f_FastICAAdvOpt'	 'f_FastICASave  '	 'f_FastICA_mix  '	 'f_FastICA_white'	 'f_FastICA_ica  ']; for i=1:size(Tags,1)   handle = findobj('Tag', deblank(Tags(i,:)));   if ~isempty(handle)     close(handle);   end end % Close this window close(hf_FastICA_MAIN);  % Clear the used global variables. gui_cg; % Use return to avoid reaching the watchoff statement at the end % (There used to be a 'break' statement here, but it resulted in % errors in more recent version of Matlab -- jarmo) return; % ... and we're done.%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%case 'About' gui_help('gui_cb_about');%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%case 'Help' gui_help('gui_cb_help');  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%end    % switchwatchoff (watchonInFigure);

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -