Record Class SignalStatistics

java.lang.Object
java.lang.Record
pl.polsl.rtsa.api.dto.SignalStatistics
Record Components:
rmsVoltage - Root Mean Square voltage of the signal (V).
peakToPeak - Peak-to-peak voltage (V).
minVoltage - Minimum voltage in the sample window (V).
maxVoltage - Maximum voltage in the sample window (V).
dcOffset - DC offset (average voltage) (V).
dominantFreq - Detected dominant frequency (Hz).
dominantFreqMag - Magnitude of the dominant frequency component.

public record SignalStatistics(double rmsVoltage, double peakToPeak, double minVoltage, double maxVoltage, double dcOffset, double dominantFreq, double dominantFreqMag) extends Record
Data Transfer Object containing pre-computed signal statistics. Immutable record for thread-safe access.
  • Field Details

    • rmsVoltage

      private final double rmsVoltage
      The field for the rmsVoltage record component.
    • peakToPeak

      private final double peakToPeak
      The field for the peakToPeak record component.
    • minVoltage

      private final double minVoltage
      The field for the minVoltage record component.
    • maxVoltage

      private final double maxVoltage
      The field for the maxVoltage record component.
    • dcOffset

      private final double dcOffset
      The field for the dcOffset record component.
    • dominantFreq

      private final double dominantFreq
      The field for the dominantFreq record component.
    • dominantFreqMag

      private final double dominantFreqMag
      The field for the dominantFreqMag record component.
  • Constructor Details

    • SignalStatistics

      public SignalStatistics(double rmsVoltage, double peakToPeak, double minVoltage, double maxVoltage, double dcOffset, double dominantFreq, double dominantFreqMag)
      Creates an instance of a SignalStatistics record class.
      Parameters:
      rmsVoltage - the value for the rmsVoltage record component
      peakToPeak - the value for the peakToPeak record component
      minVoltage - the value for the minVoltage record component
      maxVoltage - the value for the maxVoltage record component
      dcOffset - the value for the dcOffset record component
      dominantFreq - the value for the dominantFreq record component
      dominantFreqMag - the value for the dominantFreqMag record component
  • Method Details

    • empty

      public static SignalStatistics empty()
      Creates empty/zero statistics.
    • builder

      public static SignalStatistics.Builder builder()
      Builder for constructing SignalStatistics.
    • 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. All components in this record class 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.
    • rmsVoltage

      public double rmsVoltage()
      Returns the value of the rmsVoltage record component.
      Returns:
      the value of the rmsVoltage record component
    • peakToPeak

      public double peakToPeak()
      Returns the value of the peakToPeak record component.
      Returns:
      the value of the peakToPeak record component
    • minVoltage

      public double minVoltage()
      Returns the value of the minVoltage record component.
      Returns:
      the value of the minVoltage record component
    • maxVoltage

      public double maxVoltage()
      Returns the value of the maxVoltage record component.
      Returns:
      the value of the maxVoltage record component
    • dcOffset

      public double dcOffset()
      Returns the value of the dcOffset record component.
      Returns:
      the value of the dcOffset record component
    • dominantFreq

      public double dominantFreq()
      Returns the value of the dominantFreq record component.
      Returns:
      the value of the dominantFreq record component
    • dominantFreqMag

      public double dominantFreqMag()
      Returns the value of the dominantFreqMag record component.
      Returns:
      the value of the dominantFreqMag record component