java.lang.Object
java.lang.Record
pl.polsl.rtsa.api.dto.SignalData
- Record Components:
timestamp- When this result was created.timeDomainData- Array of voltage samples in time domain (V).freqDomainData- Array of FFT magnitude values.sampleRate- Sampling rate used to capture this data (Hz).statistics- Pre-computed signal statistics.
public record SignalData(Instant timestamp, double[] timeDomainData, double[] freqDomainData, double sampleRate, SignalStatistics statistics)
extends Record
Data Transfer Object representing a complete signal analysis result.
Immutable record for thread-safe access from UI thread.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final double[]The field for thefreqDomainDatarecord component.private final doubleThe field for thesampleRaterecord component.private final SignalStatisticsThe field for thestatisticsrecord component.private final double[]The field for thetimeDomainDatarecord component.private final InstantThe field for thetimestamprecord component. -
Constructor Summary
ConstructorsConstructorDescriptionSignalData(Instant timestamp, double[] timeDomainData, double[] freqDomainData, double sampleRate, SignalStatistics statistics) Creates an instance of aSignalDatarecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.double[]Returns the value of thefreqDomainDatarecord component.doubleReturns the duration of the time-domain data in seconds.intReturns the number of frequency bins.doubleReturns the frequency resolution of the FFT (Hz per bin).doubleReturns the maximum representable frequency (Nyquist frequency).intReturns the number of samples in the time domain.final inthashCode()Returns a hash code value for this object.doubleReturns the value of thesampleRaterecord component.Returns the value of thestatisticsrecord component.double[]Returns the value of thetimeDomainDatarecord component.Returns the value of thetimestamprecord component.final StringtoString()Returns a string representation of this record class.
-
Field Details
-
timestamp
The field for thetimestamprecord component. -
timeDomainData
private final double[] timeDomainDataThe field for thetimeDomainDatarecord component. -
freqDomainData
private final double[] freqDomainDataThe field for thefreqDomainDatarecord component. -
sampleRate
private final double sampleRateThe field for thesampleRaterecord component. -
statistics
The field for thestatisticsrecord component.
-
-
Constructor Details
-
SignalData
public SignalData(Instant timestamp, double[] timeDomainData, double[] freqDomainData, double sampleRate, SignalStatistics statistics) Creates an instance of aSignalDatarecord class.- Parameters:
timestamp- the value for thetimestamprecord componenttimeDomainData- the value for thetimeDomainDatarecord componentfreqDomainData- the value for thefreqDomainDatarecord componentsampleRate- the value for thesampleRaterecord componentstatistics- the value for thestatisticsrecord component
-
-
Method Details
-
getDurationSeconds
public double getDurationSeconds()Returns the duration of the time-domain data in seconds. -
getFrequencyResolution
public double getFrequencyResolution()Returns the frequency resolution of the FFT (Hz per bin). -
getNyquistFrequency
public double getNyquistFrequency()Returns the maximum representable frequency (Nyquist frequency). -
getSampleCount
public int getSampleCount()Returns the number of samples in the time domain. -
getFrequencyBinCount
public int getFrequencyBinCount()Returns the number of frequency bins. -
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with '=='. -
timestamp
Returns the value of thetimestamprecord component.- Returns:
- the value of the
timestamprecord component
-
timeDomainData
public double[] timeDomainData()Returns the value of thetimeDomainDatarecord component.- Returns:
- the value of the
timeDomainDatarecord component
-
freqDomainData
public double[] freqDomainData()Returns the value of thefreqDomainDatarecord component.- Returns:
- the value of the
freqDomainDatarecord component
-
sampleRate
public double sampleRate()Returns the value of thesampleRaterecord component.- Returns:
- the value of the
sampleRaterecord component
-
statistics
Returns the value of thestatisticsrecord component.- Returns:
- the value of the
statisticsrecord component
-