Class ModemMetricsImpl

java.lang.Object
org.refcodes.codec.ModemMetricsImpl
All Implemented Interfaces:
ChannelSelectorAccessor, FrequencyThresholdAccessor, ModemMetrics, ModemModeAccessor, ModulationFormatAccessor, SampleRateAccessor

public class ModemMetricsImpl extends Object implements ModemMetrics
The Class ModemMetricsImpl.
  • Constructor Details

    • ModemMetricsImpl

      public ModemMetricsImpl(SampleRate aSampleRate, ModulationFormat aModulationFormat, ChannelSelector aChannelSelector, ModemMode aModemModem, FrequencyThreshold aFrequencyThreshold)
      Instantiates a new modem metrics impl.
      Parameters:
      aSampleRate - the sample rate
      aModulationFormat - the modulation format
      aChannelSelector - the channel selector
      aModemModem - the modem modem
      aFrequencyThreshold - the frequency threshold
  • Method Details

    • getSampleRate

      public SampleRate getSampleRate()
      Retrieves the sample rate from the sample rate property.
      Specified by:
      getSampleRate in interface SampleRateAccessor
      Returns:
      The sample rate stored by the sample rate property.
    • getModulationFormat

      public ModulationFormat getModulationFormat()
      Retrieves the modulation format from the pulse-code modulation format property.
      Specified by:
      getModulationFormat in interface ModulationFormatAccessor
      Returns:
      The modulation format stored by the pulse-code modulation format property.
    • getChannelSelector

      public ChannelSelector getChannelSelector()
      Retrieves the channel selector from the channel selector property.
      Specified by:
      getChannelSelector in interface ChannelSelectorAccessor
      Returns:
      The channel selector stored by the channel selector property.
    • getModemMode

      public ModemMode getModemMode()
      Retrieves the Modem-Mode from the Modem-Mode property.
      Specified by:
      getModemMode in interface ModemModeAccessor
      Returns:
      The Modem-Mode stored by the Modem-Mode property.
    • getFrequencyThreshold

      public FrequencyThreshold getFrequencyThreshold()
      Retrieves the frequency threshold from the frequency threshold property.
      Specified by:
      getFrequencyThreshold in interface FrequencyThresholdAccessor
      Returns:
      The frequency threshold stored by the frequency threshold property.
    • toHigherFrequencyUpperThreshold

      public int toHigherFrequencyUpperThreshold()
      Calculates the upper threshold for the higher frequency.
      Specified by:
      toHigherFrequencyUpperThreshold in interface ModemMetrics
      Returns:
      The according threshold.
    • toLowerFrequencyUpperThreshold

      public int toLowerFrequencyUpperThreshold()
      Calculates the upper threshold for the lower frequency.
      Specified by:
      toLowerFrequencyUpperThreshold in interface ModemMetrics
      Returns:
      The according threshold.
    • toSamplesPerBit

      public int toSamplesPerBit()
      Calculates the samples per bit.
      Specified by:
      toSamplesPerBit in interface ModemMetrics
      Returns:
      The according number of samples.