Support this project and keep always updated about recent software releases, bug fixes and major improvements by following on researchgate or github.
Copyright (c) 2016-2019 Danny Petschke ([email protected]). All rights reserved.
DLTPulseGenerator - A library for the simulation of lifetime spectra based on detector-output pulses
The quantitative analysis of lifetime spectra relevant in both life and materials sciences represents one of the ill-posed (and inverse) problems. Hence, stringent requirements on the hardware specifications and analysis algorithms are required.
DLTPulseGenerator is written in native C++ 11 and provides the simulation of (e.g. positron or fluorescence) lifetime spectra according to the measurement setup, i.e. the kind of detectors (photomultipliers or photodiodes) and the acquisition hardware, which mostly consists of a combination of ADC and FPGA.
The simulation is based on pairs of non-TTL shaped detector output pulses which require the constant fraction (CF) principle for the determination of the exact timing signal.
DLTPulseGenerator library provides the compilation as static or linked library to make it easily accessible from other programming languages such as
- matlab (mex-library) or
- python (ctypes-library).
You should at least cite the following publication:
DLTPulseGenerator: A library for the simulation of lifetime spectra based on detector-output pulses (SoftwareX 2018, Elsevier)
This release v1.0 relates to the original paper by Petschke et al. published in SoftwareX (Elsevier, 2018)
DLTPulseGenerator: A library for the simulation of lifetime spectra based on detector-output pulses
and provides the simulation of lifetime spectra consisting of discrete specific lifetimes based on detector-output pulses modelled by a log-normal distribution function.
This release v1.1 relates to the update paper (v1.1) by Petschke et al. published in SoftwareX (Elsevier, 2018)
and provides the simulation of lifetime spectra consisting of distributed characteristic lifetimes as can be found in porous materials (polymers, glasses) due to their pore-size distributions using positron annihilation lifetime spectroscopy (PALS).
This release v1.2 relates to the update paper (v1.2) by Petschke et al. published in SoftwareX (Elsevier, 2018)
and was modified to allow the simulation of lifetime spectra consisting of non-Gaussian or any-distributed and linearly combined Instrument Response Functions (IRF) for the PDS A/B and MU.
This release v1.3 relates to the update paper (v1.3) by Petschke et al. published in SoftwareX (Elsevier, 2019)
and provides the simulation of realistic hardware influences mainly originating from the parts of the A/D converter such as baseline-offset jitter, random noise, fixed pattern and random aperture jitters on the time axis and the digitization depth.
DDRS4PALS software written by Danny Petschke
#define forever while(true)
#define DDELETE_SAFETY(__ptr__) { if (__ptr__) { delete __ptr__; __ptr__ = nullptr; } }
int main() {
printf("How to easily implement DLTPulseGenerator library?\n\n");
/* 1a. Define structs: */
DLTSetup setup = DLTSetup_DEMO;
DLTPulse pulse = DLTPulse_DEMO;
DLTPHS phs = DLTPHS_DEMO;
DLTSimulationInput simulationInput = DLTSimulationInput_DEMO;
/* 1b. Set trigger-levels for branch A and B: */
const double triggerA_in_mV = 50.0;
const double triggerB_in_mV = 50.0;
/* 2. Initialize DLTPulseGenerator class: */
DLTPulseGenerator *pulseGenerator = new DLTPulseGenerator(simulationInput, phs, setup, pulse, nullptr);
/* 3. Receive pulses: */
DLTPulseF pulseA, pulseB;
forever {
if ( pulseGenerator->emitPulses(&pulseA, &pulseB, triggerA_in_mV, triggerB_in_mV) ) {
/* all algorithms for exact timing determination and lifetime calculation, respectively, have to be placed here! */
/* const double timingA = CFD(pulseA, level);
const double timingB = CFD(pulseB, level);
const double lifetime = calcDifference(timingA, timingB);
-> binning the lifetimes (MCA). */
}
else
break;
}
DDELETE_SAFETY(pulseGenerator)
}
Errors can be handled by inheriting class DLTPulseGenerator using the provided callback function: see DLTPulseGeneratorApp.h/.cpp.
A library wrapper in python (pyDLTPulseGenerator.py) demonstrating the usage of ctypes-library by calling the functions of DLTPulseGenerator.dll (x86/x64) is provided. pyDLTPulseGeneratorApp.py calls functions from the library (wrapper) pyDLTPulseGenerator.py. The generated pulse pairs and the pulse height spectrum are displayed for demonstration purposes.
WinPython meets all requirements.
Copyright (c) 2016-2019 Danny Petschke ([email protected]). All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
-
Redistributions of source code must retain the above copyright notice
this list of conditions and the following disclaimer. -
Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution. -
Neither the name of the copyright holder "Danny Petschke" nor the names of
its contributors may be used to endorse or promote products derived from
this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS
OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
see also BSD-3-Clause License