nqrduck.helpers.signalprocessing#

Helper used for signal processing.

Classes

SignalProcessing()

This class provides various signal processing methods that can then be used by nqrduck modules.

class nqrduck.helpers.signalprocessing.SignalProcessing#

This class provides various signal processing methods that can then be used by nqrduck modules.

classmethod apodization(tdx: array, tdy: array, apodization_function: Expr) array#

This method calculates the apodization of the time domain data.

Parameters:
  • tdx (np.array) – Time domain x data in seconds.

  • tdy (np.array) – Time domain magnitude y data.

  • apodization_function (sympy.Expr) – Apodization function.

Returns:

Time domain magnitude y data with apodization.

Return type:

np.array

classmethod baseline_correction(fdx: array, fdy: array, order: int) array#

This method calculates the baseline correction of the frequency domain data.

Parameters:
  • fdx (np.array) – Frequency domain x data in MHz.

  • fdy (np.array) – Frequency domain magnitude y data.

  • order (int) – Order of the polynomial used for baseline correction.

Returns:

Frequency domain magnitude y data with baseline correction.

Return type:

np.array

classmethod fft(tdx: array, tdy: array, freq_shift: float = 0, zero_padding=1000) tuple[array, array]#

This method calculates the FFT of the time domain data.

Parameters:
  • tdx (np.array) – Time domain x data in seconds.

  • tdy (np.array) – Time domain magnitude y data.

  • freq_shift (float) – Frequency shift in MHz - this can be useful if the spectrometer has it’s frequency data in the IF band.

  • zero_padding (float) – Zero padding to be used in the FFT.

Returns:

Frequency domain x data in MHz. np.array: Frequency domain magnitude y data.

Return type:

np.array

classmethod peak_picking(fdx: array, fdy: array, threshold: float = 0.05) tuple[array, array]#

This method calculates the peak picking of the frequency domain data.

Parameters:
  • fdx (np.array) – Frequency domain x data in MHz.

  • fdy (np.array) – Frequency domain magnitude y data.

  • threshold (float) – Threshold for peak picking.

Returns:

x,y data of the peaks.

Return type:

list