Listing 2 The expression for deconvolution in the discrete domain

void deconvolve_wave(const long int sequence_len,
                  const double *convolving_func,
                  const double *convolved,
                  double *h)
{
   auto double temp_wave_point_value,
             temp_wave1_recip
                          = 1.0 / convolving_func[1];
   auto long int   k,
                i;

   for (k = 0; k < sequence_len; k++)
   {
       temp_wave_point_value = 0.0;
       for (   i = 1;
              i < k;
              i++)
       {
           temp_wave_point_value += h[i]
              * (convolving_func[k + 1 - i]);
       }
       h[k] = temp_wave1_recip
          * (convolved[k] - temp_wave_point_value);
   }
   return;
}

/* End of File */