Octave/MATLAB code for Global signal extraction
example.m
: example script file
It makes plots of mixing coefficients and extracted signal.
How to use
Download example.m, getA.m and extg.m
From MATLAB or Octave,
>> example
getA.m
: function file to estimate the mixing vector a from data matrix X.
Usage: [ea esnr eainit] = getA(X,threshold,maxiter)
outputs -
ea: estimated a (ea.^2 is estimated power)
esnr: estimated SNR
eainit: estimated a before ALS
inputs -
X: n-by-T data matrix, n:channel, T:sample size
threshold: Threshold of the alternating least square (default=10^(-6))
maxiter: Maximum number of iteration in ALS. (default=1000)
extg.m
: function file to extract the global signal from mixing coefficients a and data matrix X.
Usage: [eg w] = extg(a,X)
Outputs -
eg: estimated global signal g
w: estimated optimal weight
Inputs -
a: mixing coefficients, n-by-1 vector, n:# of channel
X: n-by-T data matrix, T:sample size
ALS_mex.c
: MEX file to calculate ALS faster. This is an option for getA.m.
How to install
Compile mex file
--MATLAB--
>> mex ALS_mex.c
--Octave 2.9.9-- from propmt,
% mkoctfile --mex ALS_mex.c
Modify getA.m, line 63.
if 1
-->
if 0
GNU Octave
is freely redistributable software.
MATLAB is a registered trademark of The MathWorks, Inc.
LABSP
,
Brain Science Institute
,
RIKEN
Contact:
Last modified: Thu Mar 29 14:43:05 JST 2007