0

`int chan_clean(int offset,int correlation_width,float
threshold,float *rho2,
float *rp_signal,float *ip_signal,
int nenv_chan,float **rp_env,float **ip_env,
float *rp_clean,float *ip_clean,complex *A,complex *B,
float modx2sum,complex *R,complex *work,integer lwork,integer *ipivot)`

- Note: The data type
`integer`is defined in`f2c.h`.

`offset:`Input. The offset to the beginning of the section of the Fourier transform over which correlations are being searched for.`correlation_width:`Input. The width of the section of the Fourier transform over which correlations are being searched for.`threshold:`Input. The threshold for determining whether a correlation is statistically significant.`rp_signal:`Input.`rp_signal[0..length-1]`contains the real parts of the Fourier transform of the signal.`ip_signal:`Input.`rp_signal[0..length-1]`contains the imaginary parts of the Fourier transform of the signal.`nenv_chan:`Input. The number of environmental channels under consideration.`rp_env:`Input.`rp_env[0.. nenv_chan-1][0..length-1]`contains the real parts of the Fourier transform of the nenv_chan environmental channels.`ip_env:`Input.`ip_env[0.. nenv_chan-1][0..length-1]`contains the imaginary parts of the Fourier transform of the nenv_chan environmental channels.`rp_clean:`Output.`rp_clean[0..length-1]`contains the real parts of the Fourier transform of the signal cleaned by removing those contributions that have been assigned by the method to environmental influences.`ip_clean:`Output.`ip_clean[0..length-1]`contains the imaginary parts of the Fourier transform of the signal cleaned by removing those contributions that have been assigned by the method to environmental influences.`A:`Input.`A[0.. -1]`is a working array that is calculated by`calc_rho()`and used by the*clapack*routine`chesv()`called by`clean_chan()`. The elements of the array are structure of type`complex`(see note above). Memory allocation should be performed in the calling routine.`B:`Input.`B[0.. -1]`is a working array that is calculated by`calc_rho()`used by the*clapack*routine`chesv()`called by`clean_chan()`. The elements of the array are structure of type`complex`(see note above). Memory allocation should be performed in the calling routine.`modx2sum:`Input. A float that is calculated by`calc_rho`used by`clean_chan`.`R:`Input.`R[0.. -1]`is a working array used by the*clapack*routine`chesv()`called by`clean_chan()`. The elements of the array are structure of type`complex`(see note above). Memory allocation should be performed in the calling routine.`work:`Input.`work[0..-1]`is a working array used by the*clapack*routine`chesv()`called by`clean_chan()`. The elements of the array are structure of type`complex`(see note above). Memory allocation should be performed in the calling routine.`lwork:`Input. The size of the array`work`.`ipivot:`Input.`ipivot[0.. -1]`is a working array used by the*clapack*routine`chesv()`called by`clean_chan()`. The elements of the array are structure of type`integer`. Memory allocation should be performed in the calling routine.

- Author: Bruce Allen (ballen@dirac.phys.uwm.edu), Wensheng Hua (hua@bondi.phys.uwm.edu) and Adrian Ottewill (ottewill@relativity.ucd.ie).
- Comments:
`clean_chan()`currently uses*clapack*routines to perform the required matrix manipulations. While this it is highly desirable to have such optimised routines when considering a large number of environmental channels it would also be useful to have a replacement for the*clapack*routine`chesv()`constructed from Numerical Recipes routines for when*clapack*is not available.