1#ifndef TTTRLIB_FSCONV_H
2#define TTTRLIB_FSCONV_H
14 #include <immintrin.h>
18 #if (defined(__GNUC__) || defined(__clang__))
19 #include <immintrin.h>
20 #include <avxintrin.h>
46void rescale(
double *fit,
double *decay,
double *scale,
int start,
int stop);
69void rescale_w(
double *fit,
double *decay,
double *w_sq,
double *scale,
int start,
int stop);
93void rescale_w_bg(
double *fit,
double *decay,
double *w_sq,
double bg,
double *scale,
int start,
int stop);
113void fconv(
double *fit,
double *x,
double *lamp,
int numexp,
int start,
int stop,
double dt=0.05);
133void fconv_avx(
double *fit,
double *x,
double *lamp,
int numexp,
int start,
int stop,
double dt=0.05);
157 double *fit,
double *x,
double *lamp,
int numexp,
int start,
int stop,
158 int n_points,
double period,
double dt=0.05
181 double *fit,
double *x,
double *lamp,
int numexp,
int start,
int stop,
182 int n_points,
double period,
double dt=0.05
203void fconv_per_cs(
double *fit,
double *x,
double *lamp,
int numexp,
int stop,
204 int n_points,
double period,
int conv_stop,
double dt);
230void fconv_ref(
double *fit,
double *x,
double *lamp,
int numexp,
int start,
int stop,
double tauref,
double dt=0.05);
245void sconv(
double *fit,
double *p,
double *lamp,
int start,
int stop);
258void shift_lamp(
double *lampsh,
double *lamp,
double ts,
int n_points,
double out_value=0.0);
285 double* model,
int n_model,
286 double* data,
int n_data,
287 double repetition_rate,
288 double instrument_dead_time,
289 double measurement_time,
290 std::string pile_up_model =
"coates",
307 double* lifetime_spectrum,
int n_lifetime_spectrum,
308 double amplitude_threshold
347 double *model,
int n_model,
348 double *time_axis,
int n_time_axis,
349 double *irf,
int n_irf,
350 double *lifetime_spectrum,
int n_lifetime_spectrum,
351 int convolution_start = 0,
352 int convolution_stop = -1,
353 double period = 100.0
389 double *inplace_output,
int n_output,
390 double *time_axis,
int n_time_axis,
391 double *instrument_response_function,
int n_instrument_response_function,
392 double *lifetime_spectrum,
int n_lifetime_spectrum,
393 int convolution_start = 0,
394 int convolution_stop = -1
void fconv(double *fit, double *x, double *lamp, int numexp, int start, int stop, double dt=0.05)
Convolve lifetime spectrum with instrument response (fast convolution, low repetition rate)
void shift_lamp(double *lampsh, double *lamp, double ts, int n_points, double out_value=0.0)
shift instrumnet response function
void discriminate_small_amplitudes(double *lifetime_spectrum, int n_lifetime_spectrum, double amplitude_threshold)
Threshold the amplitudes in the interleaved lifetime spectrum.
void rescale_w_bg(double *fit, double *decay, double *w_sq, double bg, double *scale, int start, int stop)
Scale the model function to the data considering weights and background.
void fconv_per_cs(double *fit, double *x, double *lamp, int numexp, int stop, int n_points, double period, int conv_stop, double dt)
Convolve lifetime spectrum - fast convolution, high repetition rate, with convolution stop.
void fconv_ref(double *fit, double *x, double *lamp, int numexp, int start, int stop, double tauref, double dt=0.05)
Convolve lifetime spectrum - fast convolution with reference compound decay.
void fconv_per_avx(double *fit, double *x, double *lamp, int numexp, int start, int stop, int n_points, double period, double dt=0.05)
Convolve lifetime spectrum with instrument response (fast convolution, high repetition rate),...
void rescale(double *fit, double *decay, double *scale, int start, int stop)
Scale model function to the data (old version)
void add_pile_up_to_model(double *model, int n_model, double *data, int n_data, double repetition_rate, double instrument_dead_time, double measurement_time, std::string pile_up_model="coates", int start=0, int stop=-1)
Add a pile-up distortion to the model function.
void fconv_cs_time_axis(double *inplace_output, int n_output, double *time_axis, int n_time_axis, double *instrument_response_function, int n_instrument_response_function, double *lifetime_spectrum, int n_lifetime_spectrum, int convolution_start=0, int convolution_stop=-1)
Compute the fluorescence decay for a lifetime spectrum and an instrument response function.
void sconv(double *fit, double *p, double *lamp, int start, int stop)
Convolve fluorescence decay curve with irf.
void fconv_per_cs_time_axis(double *model, int n_model, double *time_axis, int n_time_axis, double *irf, int n_irf, double *lifetime_spectrum, int n_lifetime_spectrum, int convolution_start=0, int convolution_stop=-1, double period=100.0)
Compute the fluorescence decay for a lifetime spectrum and an instrument response function considerin...
void fconv_per(double *fit, double *x, double *lamp, int numexp, int start, int stop, int n_points, double period, double dt=0.05)
Convolve lifetime spectrum with instrument response (fast convolution, high repetition rate)
void fconv_avx(double *fit, double *x, double *lamp, int numexp, int start, int stop, double dt=0.05)
Convolve lifetime spectrum with instrument response (fast convolution, AVX optimized for large lifeti...
void rescale_w(double *fit, double *decay, double *w_sq, double *scale, int start, int stop)
Scale model function to the data (with weights)