#!/usr/local/bin/octave --silent ## Run Jade from the shell as a standalone program on an ascii-formatted data file ## ## Call as : ## $ runjade [] ## ## The data file should be a matrix of numerical values ## Its small dimension is taken to be the number of sensors ## Its large dimension is taken to be the number of samples ## ## An optional argument is the number of requested independent components ## If absent, it defaults to the number of sensors ## ## The resulting components are save in a similarly ## formatted file named _jade.txt ## ## Author: JF Cardoso. Please report bugs at: cardoso enst fr ## if ((nargin==0) | (nargin>2)) printf("Usage: runjade []\n") exit ; endif arg_list = argv (); ## Read data in input_file_name = arg_list{1} ; try X = load("-ascii", input_file_name); catch error("Cannot load file %s", input_file_name); end_try_catch ## Get dimensions [ n_samples n_sensors ] = size(X) ; if (n_samplesn_sensors) error("Jade cannot extract more sources than sensors\n"); endif endif ## Jade finds a separating matrix of size required_number_of_ICs * n_samples printf ("Running jade\n"); B = jadeR( X, required_number_of_ICs ) ; X = B*X ; if data_transposed X = X'; endif output_file_name = sprintf("%s_jade.txt", input_file_name); save("-ascii", output_file_name, "X"); printf("Independent components saved in ascii file %s", output_file_name);