mirror of
https://github.com/nqrduck/nqrduck-spectrometer.git
synced 2025-01-02 21:58:08 +00:00
Added frequency domain data to measurement class.
This commit is contained in:
parent
abe47cf64f
commit
0ea47d16be
1 changed files with 28 additions and 0 deletions
|
@ -1,13 +1,23 @@
|
|||
from nqrduck.helpers.signalprocessing import SignalProcessing as sp
|
||||
|
||||
class Measurement():
|
||||
"""This class defines how measurement data should look.
|
||||
It includes pulse parameters necessary for further signal processing.
|
||||
Every spectrometer should adhere to this data structure in order to be compatible with the rest of the nqrduck.
|
||||
|
||||
Attributes:
|
||||
tdx (np.array): Time axis for the x axis of the measurement data.
|
||||
tdy (np.array): Time axis for the y axis of the measurement data.
|
||||
target_frequency (float): Target frequency of the measurement.
|
||||
xf (np.array): Frequency axis for the x axis of the measurement data.
|
||||
yf (np.array): Frequency axis for the y axis of the measurement data.
|
||||
"""
|
||||
|
||||
def __init__(self, tdx, tdy, target_frequency) -> None:
|
||||
self.tdx = tdx
|
||||
self.tdy = tdy
|
||||
self.target_frequency = target_frequency
|
||||
self.fdx, self.fdy = sp.fft(tdx, tdy)
|
||||
|
||||
# Measurement data
|
||||
@property
|
||||
|
@ -28,6 +38,24 @@ class Measurement():
|
|||
def tdy(self, value):
|
||||
self._tdy = value
|
||||
|
||||
@property
|
||||
def fdx(self):
|
||||
"""Frequency axis for the x axis of the measurement data."""
|
||||
return self._fdx
|
||||
|
||||
@fdx.setter
|
||||
def fdx(self, value):
|
||||
self._fdx = value
|
||||
|
||||
@property
|
||||
def fdy(self):
|
||||
"""Frequency axis for the y axis of the measurement data."""
|
||||
return self._fdy
|
||||
|
||||
@fdy.setter
|
||||
def fdy(self, value):
|
||||
self._fdy = value
|
||||
|
||||
# Pulse parameters
|
||||
@property
|
||||
def target_frequency(self):
|
||||
|
|
Loading…
Reference in a new issue