SDDSlib
|
Perform convolution, deconvolution, and correlation operations using the SDDS library. More...
Go to the source code of this file.
Macros | |
#define | USAGE "Usage: sddsconvolve <signal-file> <response-file> <output>\n\ -signalColumns=<indepColumn>,<dataName>\n\ -responseColumns=<indepColumn>,<dataName> [-reuse]\n\ -outputColumns=<indepColumn>,<dataName> [-majorOrder=row|column]\n\ [{-deconvolve [{-noiseFraction=<value> | -wienerFilter=<value>}] | -correlate}]\n\n\Description:\n\ Performs discrete Fourier convolution, deconvolution, or correlation between signal and response files.\n\ Assumes uniform spacing of points in both input files and that both files contain the same number of data points.\n\\n\Mathematical Operations:\n\ - Convolution: O = S * R\n\ - Deconvolution: O = S / R\n\ - Correlation: O = S * Conj(R)\n\\n\Options:\n\ -signalColumns=<indepColumn>,<dataName> Specify the independent column and data name for the signal file.\n\ -responseColumns=<indepColumn>,<dataName> Specify the independent column and data name for the response file.\n\ -outputColumns=<indepColumn>,<dataName> Specify the independent column and data name for the output file.\n\ -reuse Reuse the first page of the response file for each page of the signal file.\n\ -majorOrder=row|column Set data ordering in the output file.\n\ -deconvolve Perform deconvolution instead of convolution.\n\ -noiseFraction=<value> Specify noise fraction to prevent divide-by-zero.\n\ -wienerFilter=<value> Apply a Wiener filter with the specified fraction.\n\ -correlate Perform correlation instead of convolution.\n\ -pipe Use standard input/output in place of file arguments.\n\\n\Program Information:\n\ Michael Borland (" __DATE__ " " __TIME__ ", SVN revision: " SVN_VERSION ")\n" |
#define | MODE_CONVOLVE 1 |
#define | MODE_DECONVOLVE 2 |
#define | MODE_CORRELATE 3 |
Functions | |
void | complex_multiply (double *r0, double *i0, double r1, double i1, double r2, double i2) |
Multiplies two complex numbers. | |
void | complex_divide (double *r0, double *i0, double r1, double i1, double r2, double i2, double threshold) |
Divides two complex numbers. | |
void | wrap_around_order (double *response1, double *t, double *response, int64_t nres, int64_t nsig) |
int | main (int argc, char **argv) |
Variables | |
char * | option [N_OPTIONS] |
Perform convolution, deconvolution, and correlation operations using the SDDS library.
This program is designed to handle discrete Fourier convolution, deconvolution, and correlation between signal and response files. It assumes that the input files have uniform spacing of points and an equal number of data points.
Features include:
The program also supports options for Wiener filtering and noise handling during deconvolution.
@usage sddsconvolve <signal-file> <response-file> <output>
Options:
-signalColumns=<indepColumn>,<dataName>
: Specify the independent column and data name for the signal file.-responseColumns=<indepColumn>,<dataName>
: Specify the independent column and data name for the response file.-outputColumns=<indepColumn>,<dataName>
: Specify the independent column and data name for the output file.-reuse
: Reuse the first page of the response file for each page of the signal file.-majorOrder=row|column
: Set data ordering in the output file.-deconvolve
: Perform deconvolution instead of convolution.-noiseFraction=<value>
: Specify noise fraction to prevent divide-by-zero.-wienerFilter=<value>
: Apply a Wiener filter with the specified fraction.-correlate
: Perform correlation instead of convolution.-pipe
: Use standard input/output in place of file arguments.Definition in file sddsconvolve.c.
#define MODE_CONVOLVE 1 |
Definition at line 112 of file sddsconvolve.c.
#define MODE_CORRELATE 3 |
Definition at line 114 of file sddsconvolve.c.
#define MODE_DECONVOLVE 2 |
Definition at line 113 of file sddsconvolve.c.
#define USAGE "Usage: sddsconvolve <signal-file> <response-file> <output>\n\ -signalColumns=<indepColumn>,<dataName>\n\ -responseColumns=<indepColumn>,<dataName> [-reuse]\n\ -outputColumns=<indepColumn>,<dataName> [-majorOrder=row|column]\n\ [{-deconvolve [{-noiseFraction=<value> | -wienerFilter=<value>}] | -correlate}]\n\n\Description:\n\ Performs discrete Fourier convolution, deconvolution, or correlation between signal and response files.\n\ Assumes uniform spacing of points in both input files and that both files contain the same number of data points.\n\\n\Mathematical Operations:\n\ - Convolution: O = S * R\n\ - Deconvolution: O = S / R\n\ - Correlation: O = S * Conj(R)\n\\n\Options:\n\ -signalColumns=<indepColumn>,<dataName> Specify the independent column and data name for the signal file.\n\ -responseColumns=<indepColumn>,<dataName> Specify the independent column and data name for the response file.\n\ -outputColumns=<indepColumn>,<dataName> Specify the independent column and data name for the output file.\n\ -reuse Reuse the first page of the response file for each page of the signal file.\n\ -majorOrder=row|column Set data ordering in the output file.\n\ -deconvolve Perform deconvolution instead of convolution.\n\ -noiseFraction=<value> Specify noise fraction to prevent divide-by-zero.\n\ -wienerFilter=<value> Apply a Wiener filter with the specified fraction.\n\ -correlate Perform correlation instead of convolution.\n\ -pipe Use standard input/output in place of file arguments.\n\\n\Program Information:\n\ Michael Borland (" __DATE__ " " __TIME__ ", SVN revision: " SVN_VERSION ")\n" |
Definition at line 79 of file sddsconvolve.c.
enum option_type |
Definition at line 50 of file sddsconvolve.c.
void complex_divide | ( | double * | r0, |
double * | i0, | ||
double | r1, | ||
double | i1, | ||
double | r2, | ||
double | i2, | ||
double | threshold ) |
Divides two complex numbers.
r0 | Pointer to store the real part of the result. |
i0 | Pointer to store the imaginary part of the result. |
r1 | Real part of the numerator complex number. |
i1 | Imaginary part of the numerator complex number. |
r2 | Real part of the denominator complex number. |
i2 | Imaginary part of the denominator complex number. |
threshold | The threshold to prevent division by very small numbers. |
Definition at line 105 of file complex.cc.
void complex_multiply | ( | double * | r0, |
double * | i0, | ||
double | r1, | ||
double | i1, | ||
double | r2, | ||
double | i2 ) |
Multiplies two complex numbers.
r0 | Pointer to store the real part of the result. |
i0 | Pointer to store the imaginary part of the result. |
r1 | Real part of the first complex number. |
i1 | Imaginary part of the first complex number. |
r2 | Real part of the second complex number. |
i2 | Imaginary part of the second complex number. |
Definition at line 81 of file complex.cc.
int main | ( | int | argc, |
char ** | argv ) |
Definition at line 116 of file sddsconvolve.c.
void wrap_around_order | ( | double * | response1, |
double * | t, | ||
double * | response, | ||
int64_t | nres, | ||
int64_t | nsig ) |
Definition at line 457 of file sddsconvolve.c.
char* option[N_OPTIONS] |
Definition at line 65 of file sddsconvolve.c.