edu.nrao.sss.electronics
Class Signal

java.lang.Object
  extended by edu.nrao.sss.electronics.Signal
All Implemented Interfaces:
Cloneable
Direct Known Subclasses:
DigitalSignal

public class Signal
extends Object
implements Cloneable

A frequency signal that holds a current frequency range and the range for which the current is a proxy.

Version Info:

$Revision: 1985 $
$Date: 2009-02-19 15:57:58 -0700 (Thu, 19 Feb 2009) $
$Author: dharland $ (last person to modify)

Since:
2007-10-24
Author:
David M. Harland

Constructor Summary
Signal(Frequency centerFrequency)
          Creates a new signal centered on the given frequency and with an unspecified polarization.
Signal(FrequencyRange originalRange, PolarizationType polarization)
          Creates a new signal with the given frequencies and polarization.
 
Method Summary
 void appendToDevicePath(String id)
          Appends the given text to this signal's device path.
 Signal clone()
          Creates and returns a copy of this signal.
 Signal clone(PolarizationType newPolarization)
          Creates a copy of this signal, changes its polarization to newPolarization, and returns the copy.
 boolean equals(Object o)
          Returns true if o is equal to this signal.
 Frequency getCurrentFrequencyFor(Frequency proxiedFrequency)
          Returns the frequency to which proxiedFrequency has been transformed.
 FrequencyRange getCurrentRange()
          Returns the frequency range covered by this signal.
 String getDevicePath()
          Returns text that represents the devices through which this signal has traveled.
 Frequency getMappingIntercept()
          Returns the y-intercept of the linear mapping function, where the current frequency is the independent variable and the proxied frequency is the dependent variable.
 BigDecimal getMappingSlope()
          Returns the slope of the linear mapping function, where the current frequency is the independent variable and the proxied frequency is the dependent variable.
 String getName()
          Returns the name of the last device in this signal's device path.
 PolarizationType getPolarization()
          Returns the polarization of this signal.
 Frequency getProxiedFrequencyFor(Frequency currentFrequency)
          Returns the frequency represented by the currentFrequency.
 FrequencyRange getProxiedRange()
          Returns the frequency range represented by this signal.
 int hashCode()
          Returns a hash code value for this signal.
 boolean proxiedRangeIsReversed()
          Returns true if the high and low frequencies in the proxied range are mapped to the low and high frequencies, respectively, of the current range.
 String toString()
          Returns a text representation of this signal.
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Signal

public Signal(FrequencyRange originalRange,
              PolarizationType polarization)
Creates a new signal with the given frequencies and polarization.

Parameters:
originalRange - the frequency range of this signal. If this value is null a NullPointerException will be thrown.
polarization - the polarization of this signal. If this value is null it will be converted to PolarizationType.UNSPECIFIED.

Signal

public Signal(Frequency centerFrequency)
Creates a new signal centered on the given frequency and with an unspecified polarization. This constructor is used by devices that produce very narrow band signals, such as local oscillators.

Parameters:
centerFrequency - the central frequency of this signal. If this value is null an NullPointerException will be thrown.
Method Detail

getProxiedRange

public FrequencyRange getProxiedRange()
Returns the frequency range represented by this signal.

The returned range is what the range returned by getCurrentRange() would be if we were to process that range in reverse through whatever transformers this signal has been passed. Note, though, that it does not quite represent the original range of this signal. This is because some transformers, such as filters, cause information about their input signals to be lost.

Example
Suppose a given signal originally occupied the frequency space between 6-12GHz, was filtered to 8-10GHz, and was then mixed down to 0-2GHz. In this example, the proxied range (returned by this method) is 8-10GHz, while the current range (returned by getCurrentRange()), is 0-2GHz.

The returned range is a copy of the one held internally by this signal, so changes made to it after this call will not be reflected herein.

The returned range will never be null.

Returns:
the frequency range represented by this signal.

getCurrentRange

public FrequencyRange getCurrentRange()
Returns the frequency range covered by this signal.

The returned range represents the frequency of this signal now. This may be a set of intermediate frequencies that is a representation of the range of interest (which is returned by getProxiedRange()).

Example
Suppose a given signal originally occupied the frequency space between 6-12GHz, was filtered to 8-10GHz, and was then mixed down to 0-2GHz. In this example, the proxied spectrum (returned by getProxiedRange()) is 8-10GHz, while the current range (returned by this method) is 0-2GHz.

The returned range is a copy of the one held internally by this signal, so changes made to it after this call will not be reflected herein.

The returned range will never be null.

Returns:
the frequency spectrum covered by this signal.

proxiedRangeIsReversed

public boolean proxiedRangeIsReversed()
Returns true if the high and low frequencies in the proxied range are mapped to the low and high frequencies, respectively, of the current range.

Returns:
true if the high and low frequencies of the proxy are reversed with respect to the current range.

getPolarization

public PolarizationType getPolarization()
Returns the polarization of this signal. The returned value will never be null, but could be unspecified.

Returns:
the polarization of this signal.

getProxiedFrequencyFor

public Frequency getProxiedFrequencyFor(Frequency currentFrequency)
Returns the frequency represented by the currentFrequency.

One of the chief jobs of a signal is to allow the frequency range of interest to be converted to some other intermediate frequency range that is more convenient for the devices that manipulate signals. At some point, though, we want to know what frequency range is represented by this intermediate frequency range. The job of this method is to return a frequency of interest for a given intermediate frequency.

Parameters:
currentFrequency - a frequency within this signal's current range. This is often an intermediate frequency.
Returns:
a frequency of interest for which currentFrequency is a proxy.
Throws:
IllegalArgumentException - if currentFrequency is not in this signal's current range.

getCurrentFrequencyFor

public Frequency getCurrentFrequencyFor(Frequency proxiedFrequency)
Returns the frequency to which proxiedFrequency has been transformed.

Parameters:
proxiedFrequency - a frequency that is represented by this signal.
Returns:
the frequency to which proxiedFrequency has been transformed.
Throws:
IllegalArgumentException - if proxiedFrequency is not in this signal's proxied range.
Since:
2009-02-19
See Also:
getProxiedFrequencyFor(Frequency)

getMappingSlope

public BigDecimal getMappingSlope()
Returns the slope of the linear mapping function, where the current frequency is the independent variable and the proxied frequency is the dependent variable.

Returns:
the slope of the linear function that maps a proxied frequency to a current frequency.

getMappingIntercept

public Frequency getMappingIntercept()
Returns the y-intercept of the linear mapping function, where the current frequency is the independent variable and the proxied frequency is the dependent variable.

Returns:
the y-intercept of the linear function that maps a proxied frequency to a current frequency.

getDevicePath

public String getDevicePath()
Returns text that represents the devices through which this signal has traveled. Each device in the path is separated by a colon (":"). The text between the colons represents the name of a device. It is up to a device to append its name to this signal, so the returned text is not guaranteed to contain all devices through which it has passed.

Returns:
the path of devices through which this signal has passed.

getName

public String getName()
Returns the name of the last device in this signal's device path.

Returns:
the name of the last device in this signal's device path.

appendToDevicePath

public void appendToDevicePath(String id)
Appends the given text to this signal's device path.

Parameters:
id - usually the ID, or name, of a device that is currently processing this signal.

toString

public String toString()
Returns a text representation of this signal.

Overrides:
toString in class Object

clone

public Signal clone()
Creates and returns a copy of this signal.

If anything goes wrong during the cloning procedure, a RuntimeException will be thrown.

Overrides:
clone in class Object

clone

public Signal clone(PolarizationType newPolarization)
Creates a copy of this signal, changes its polarization to newPolarization, and returns the copy.

Parameters:
newPolarization - the polarization for the returned copy of this signal.
Returns:
a copy of this signal, but with newPolarization.

equals

public boolean equals(Object o)
Returns true if o is equal to this signal.

Overrides:
equals in class Object

hashCode

public int hashCode()
Returns a hash code value for this signal.

Overrides:
hashCode in class Object


Copyright © 2009. All Rights Reserved.