edu.cmu.emulator.util
Class Units

java.lang.Object
  extended by edu.cmu.emulator.util.Units

public class Units
extends Object

Units provides utility functions related to units and conversions between them. In particular, it provides coversion between linear domain and log-domain(dB) for both field and power quantities.

Version:
1.0
Author:
Eric Anderson

Field Summary
protected static double ln10
           
 
Constructor Summary
Units()
           
 
Method Summary
static double fromDb_field(double dB_ratio)
          Coverts a ratio in dB to the linear domain for field-type quantities.
static double fromDb_pow(double dB_ratio)
          Coverts dB ratio to the linear domain for power-type quantities.
protected static double log10(double lin_val)
           
static double toDb_field(double lin_ratio)
          Coverts linear ratio to dB for field-type quantities.
static double toDb_pow(double lin_ratio)
          Coverts linear ratio to dB for power-type quantities.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ln10

protected static final double ln10
Constructor Detail

Units

public Units()
Method Detail

log10

protected static double log10(double lin_val)

toDb_pow

public static double toDb_pow(double lin_ratio)
Coverts linear ratio to dB for power-type quantities. Recall that dB for a power quantity is defined as 10 Log_10 (Q_1/Q_0)

Parameters:
lin_ratio - Ratio in linear domain
Returns:
Ratio in dB

fromDb_pow

public static double fromDb_pow(double dB_ratio)
Coverts dB ratio to the linear domain for power-type quantities. Recall that dB for a power quantity is defined as 10 Log_10 (Q_1/Q_0)

Parameters:
dB_ratio - Ratio in dB
Returns:
Linear ratio

toDb_field

public static double toDb_field(double lin_ratio)
Coverts linear ratio to dB for field-type quantities. Recall that dB for a field quantity is defined as 10 Log_10 (Q_1^2/Q_0^2) = 20 Log_10 (Q_1 / Q_0)

Parameters:
lin_ratio - Ratio in linear domain
Returns:
Ratio in dB

fromDb_field

public static double fromDb_field(double dB_ratio)
Coverts a ratio in dB to the linear domain for field-type quantities. Recall that dB for a field quantity is defined as 10 Log_10 (Q_1^2/Q_0^2) = 20 Log_10 (Q_1 / Q_0)

Parameters:
dB_ratio - Ratio in linear domain
Returns:
Ratio in dB


Copyright © 2013. All Rights Reserved.