Skip to content

Digital signal processing software aimed at Zero-to-Ultralow field NMR time series data.

Notifications You must be signed in to change notification settings

vlado48/ZULF-DSP

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 

Repository files navigation

ZULF DSP

The aim of this module is to provide well rounded digital signal processing that specifically adressess needs of Zero-to-Ultralow field NMR time signals. Single object constructor call acts as entire DSP pipeline.

Default values provide robust parameters that give decent results in most cases of ZULF NMR data. Methods then provide options for quick visualization and parameter iteration.

Spectrum object stores the data (time and frequency domains) as they were at each postprocessing stage for later investigation.

Dependencies

Project will require:

  • Python 3.6
  • Spectrum 0.8.0 (Library)
  • nmrglue 0.9.0 (Library)
  • Python standard libraries

Setup

Project is not packaged. Use requires the files to either be in current working directory or in any PYTHONPATH folder. Import ZULFDSP module in your code.

The Postprocessing Pipeline

Raw data accessing

Constructor will accept:

  • absolute path to local data file
  • initialized np.array
  • will prompt a dialog to select file manually

Removal of corrupted datapoints

More ofte than no optical magnetometer recuperation period affects first few datapoints which have to be removed. Or a pulse (figure) has been used, rendering first dozens of datapoints useless.

Signal Debasing

Signal can be decomposed into Noise + Signal + Bacground. Bacground comes from magnetometer detecting static magnetic field change (loss of polarization of sample). High order polynomial is fitted using linear regression and substracted from the signal.

Backward Prediction

Corrupted points that were removed create a linear phase shift across the spectra. Using inverted autoregressive coeffecients we create backward predicting model and fill the missing points with spectrally identical signal.

Filtering

Simple filter aimed to reduce the presence of frequencies coming from the power grid (50Hz/60Hz and harmonics)

Zero Padding

To increase freqency resolution of spectra we can artificially increase measurement time by adding zeros at the end. We can see that by having smaller frequency bins, spectra provides additional details:

Apodization

Signal is multiplied by decaying exponential. Apodization serves primarily two purposes:

  • Mitigate artefacts that would result from sudden jump between last point of signal and first zero in zero padding
  • Improve SNR by decreasing amplitude of later part of signal where SNR is lower due to sample's loss of polarization.

SNR of spectra is imroved at the cost of total amplitude

Phase correction

Phase of the spectra usually needs additional correction:

  • Either can be set by a constant value during constructor call
  • Prompt a interactive plot

Methods

Spectrum.plot()

Allows for plotting of selected postprocessing stage, time or frequency domain and given range.

Spectrum.iterate()

Is used to iterate a postprocessing parameter and display the comparison on selected data mode and range. It is possible to iterate over two parameters, showing spectra with all the permutations of the parameters. (Use cautiously). On example we can see what effect on final spectra would have a different amount of starting points removed:

About

Digital signal processing software aimed at Zero-to-Ultralow field NMR time series data.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages