www.pudn.com > ica_v0.04.rar > ica.c


/*
  ica.c

  Time-stamp: 

  Contains the actual ICA algorithm. It relies on the util.c
  routines for low level routines.

  Programmer: Peter Stepien
              pstepien@sedal.usyd.edu.au
              CEL, School of Electrical & Information Engineering
              The University of Sydney
              SYDNEY NSW 2006 Australia

              COPYRIGHT 1997-2001
*/

/* System headers */
#include 
#include 
#include 
#include 
#include 

/* Local headers */
#include "ica.h"

/*
  Does the calculation for the mean value of the input
  signals. It uses all the data and by the end of the input
  data, it is a true value for the mean.
*/

void
ica_update_mean(FLOAT_TYPE *x_mean, FLOAT_TYPE *inputs,
		int num_channels, int iteration)
{
  int i;

  for (i=0;i */

  for (i=0;i*w */

  for (i=0;i 0)
  {
    for (i=0;i= block_size)
      {
	block_ptr = 0;
      }

      /* Loop through all data in the block */
      if (iteration < block_size)
      {
	for (i=0;i= block_size)
	  {
	    temp_block_ptr = 0;
	  }
	}
      }

      /* Calculate out change in w - no point doing */

#ifdef NEVER_DEFINED
      rms_delta_w = 0.0;
      for (i=0;i= 10*60)
      {
	printf("Checkpoint save of w at pass % d iteration %d\n",
	       pass+1,iteration);
	do_output_w();
	last_time = this_time;
      }
    }

    /* Go through the block at the end */

    for (i=0;i= block_size)
      {
	block_ptr = 0;
      }
      temp_block_ptr = block_ptr;
      for (j=i;j= block_size)
	{
	  temp_block_ptr = 0;
	}
      }
    }

#ifdef DEBUG
    if (pass == 0)
    {
      printf("DEBUG: number of time points = %d\n", iteration);
      for (i=0;i