home *** CD-ROM | disk | FTP | other *** search
/ The C Users' Group Library 1994 August / wc-cdrom-cusersgrouplibrary-1994-08.iso / listings / v_11_06 / 1106040b < prev    next >
Text File  |  1993-04-11  |  732b  |  27 lines

  1. void deconvolve_wave(const long int sequence_len,
  2.                      const double *convolving_func,
  3.                      const double *convolved, 
  4.                      double *h)
  5. {
  6.     auto double temp_wave_point_value,
  7.                 temp_wave1_recip 
  8.                 = 1.0 / convolving_func[1];
  9.     auto long int   k,
  10.                     i;
  11.     
  12.     for (k = 0; k < sequence_len; k++)
  13.     {
  14.         temp_wave_point_value = 0.0;
  15.         for (   i = 1; 
  16.                 i < k; 
  17.                 i++)
  18.         {
  19.             temp_wave_point_value += h[i]
  20.                 * (convolving_func[k + 1 - i]);
  21.         }
  22.         h[k] = temp_wave1_recip
  23.             * (convolved[k] - temp_wave_point_value);
  24.     }
  25.     return;
  26. }
  27.