icadata.m

来自「image separation using neural net」· M 代码 · 共 45 行

M
45
字号
function [X, A, S] = icadata(type, varargin)
% ICADATA Gets data for independent component analysis.
%
% [X, A, S] = icadata(type, args)
%   where type is one of
% 'signals'     create a set of mixed signals
% 'ECG'         load X from foetal_ecg.dat
%
% X is the mixed signal set
% A is the mixing matrix
% S is the set of source signals
%
% The fetal data are from
%         Dirk Callaerts,
%         "Signal Separation Methods based on Singular Value Decomposition 
%         and their Application to the Real-Time Extraction of the
%         Fetal Electrocardiogram from Cutaneous Recordings",
%         Ph.D. Thesis, K.U.Leuven - E.E. Dept., Dec. 1989.


%
% David Gleich
% CS 152 - Neural Networks
% 12 December 2003
%

if (strcmpi(type, 'signals'))
    % mixing matrix
	A = 2*rand(4) - 1;
	
	tt = 0:.0002:1-0.0002;
	S = zeros(4,length(tt));
	S(1,:) = sin(7*tt*2*pi).*sin(5*tt*2*pi);
	S(2,:) = sin(15*tt*2*pi);
	S(3,:) = 0.1*pulstran(tt, 0:1/11:1-0.0002, 'rectpuls', 0.02);
	S(4,:) = 10*randn(1,length(tt));
	
	X = A*S;
elseif (strcmpi(type, 'ecg'))
    X = load('foetal_ecg.dat');
    X = X(:, 2:end)';
end;


⌨️ 快捷键说明

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