Git Product home page Git Product logo

dltpulsegenerator's Introduction

Support this project and keep always updated about recent software releases, bug fixes and major improvements by following on researchgate or github.

DLTPulseGenerator

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

Introduction

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

How to cite this 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)

DLTPulseGenerator v1.0

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.

DLTPulseGenerator v1.1

This release v1.1 relates to the update paper (v1.1) by Petschke et al. published in SoftwareX (Elsevier, 2018)

Update (v1.1) to DLTPulseGenerator: A library for the simulation of lifetime spectra based on detector-output pulses

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).

DLTPulseGenerator v1.2

This release v1.2 relates to the update paper (v1.2) by Petschke et al. published in SoftwareX (Elsevier, 2018)

Update (v1.2) to DLTPulseGenerator: A library for the simulation of lifetime spectra based on detector-output pulses

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.

DLTPulseGenerator v1.3

This release v1.3 relates to the update paper (v1.3) by Petschke et al. published in SoftwareX (Elsevier, 2019)

Update (v1.3) to DLTPulseGenerator: A library for the simulation of lifetime spectra based on detector-output pulses

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.

Software Applications using DLTPulseGenerator library

DDRS4PALS software written by Danny Petschke

Example using C++

#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.

Example using Python

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.

Requirements:

WinPython meets all requirements.

Generated Pulses

License (BSD-3-Clause)

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:

  1. Redistributions of source code must retain the above copyright notice
    this list of conditions and the following disclaimer.

  2. 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.

  3. 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

dltpulsegenerator's People

Contributors

dpscience avatar

Stargazers

Gábor Mihálcz avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.