Record Class SignalData

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 Details

    • timestamp

      private final Instant timestamp
      The field for the timestamp record component.
    • timeDomainData

      private final double[] timeDomainData
      The field for the timeDomainData record component.
    • freqDomainData

      private final double[] freqDomainData
      The field for the freqDomainData record component.
    • sampleRate

      private final double sampleRate
      The field for the sampleRate record component.
    • statistics

      private final SignalStatistics statistics
      The field for the statistics record component.
  • Constructor Details

    • SignalData

      public SignalData(Instant timestamp, double[] timeDomainData, double[] freqDomainData, double sampleRate, SignalStatistics statistics)
      Creates an instance of a SignalData record class.
      Parameters:
      timestamp - the value for the timestamp record component
      timeDomainData - the value for the timeDomainData record component
      freqDomainData - the value for the freqDomainData record component
      sampleRate - the value for the sampleRate record component
      statistics - the value for the statistics record 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

      public final String 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.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • 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.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      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 with Objects::equals(Object,Object); primitive components are compared with '=='.
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • timestamp

      public Instant timestamp()
      Returns the value of the timestamp record component.
      Returns:
      the value of the timestamp record component
    • timeDomainData

      public double[] timeDomainData()
      Returns the value of the timeDomainData record component.
      Returns:
      the value of the timeDomainData record component
    • freqDomainData

      public double[] freqDomainData()
      Returns the value of the freqDomainData record component.
      Returns:
      the value of the freqDomainData record component
    • sampleRate

      public double sampleRate()
      Returns the value of the sampleRate record component.
      Returns:
      the value of the sampleRate record component
    • statistics

      public SignalStatistics statistics()
      Returns the value of the statistics record component.
      Returns:
      the value of the statistics record component