edu.nrao.sss.electronics
Class SignalFilter

java.lang.Object
  extended by edu.nrao.sss.electronics.SignalFilter
All Implemented Interfaces:
SignalProcessor, SignalSource

public class SignalFilter
extends Object
implements SignalProcessor, SignalSource

A filter that operates on the current frequencies of signals. Filters can only narrow the range of frequencies of the signals that pass through them. Filters perform no other transformations. When a filter narrows the current frequency range of a signal, it also narrows the proxied range in a consistent manner.

Version Info:

$Revision: 1241 $
$Date: 2008-04-25 14:37:37 -0600 (Fri, 25 Apr 2008) $
$Author: dharland $ (last person to modify)

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

Method Summary
 void eraseSignalMemory()
          Erases this device's memory of its most recent execution.
 void execute()
          Runs this device on the signal received from its input pipe and then executes the processor connected to its output pipe, if any.
 void executeFromStartOfChainUpTo(SignalProcessor firstUnexecutedDevice)
          Retreats upstream from this processor to the source of the stream and executes that device(s), telling it to stop execution at firstUnexecutedDevice.
 void executeUpTo(SignalProcessor firstUnexecutedDevice)
          Executes this device and all downstream devices up to, but not including, the firstUnexecutedDevice.
 Signal filter(Signal input)
          Creates and returns a new signal that is the result of applying this filter to the given input signal.
 SignalPipe getInputPipe()
          Returns the input pipe of this device.
 Signal getMostRecentInput()
          Returns a copy of the input signal most recently processed by this device.
 Signal getMostRecentOutput()
          Returns a copy of the output signal most recently produced by this device.
 SignalPipe getOutputPipe()
          Returns the output pipe of this device.
 FrequencyRange getPassBand()
          Returns the range of frequencies that may pass through this filter.
 Signal getSignal()
          Returns a copy of the signal produced by the most recent execution of this device.
static SignalFilter make(String deviceName, FrequencyRange passingRange)
          Creates and returns a new filter that blocks all frequencies outside the given range.
static SignalFilter make(String deviceName, String minFreqGHz, String maxFreqGHz)
          Creates and returns a new filter that blocks all frequencies outside the given range.
static SignalFilter makeHighPass(String deviceName, String minFreqGHz)
          Creates and returns a new filter that blocks all frequencies below minFreqGHz.
static SignalFilter makeLowPass(String deviceName, String maxFreqGHz)
          Creates and returns a new filter that blocks all frequencies above maxFreqGHz.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

makeHighPass

public static SignalFilter makeHighPass(String deviceName,
                                        String minFreqGHz)
Creates and returns a new filter that blocks all frequencies below minFreqGHz.

Parameters:
deviceName - an optional name for this filter. If this value is null a default name will be used in its place.
minFreqGHz - the lowest frequency, in gigahertz, that may pass through this filter.
Returns:
a new high pass filter.

makeLowPass

public static SignalFilter makeLowPass(String deviceName,
                                       String maxFreqGHz)
Creates and returns a new filter that blocks all frequencies above maxFreqGHz.

Parameters:
deviceName - an optional name for this filter. If this value is null a default name will be used in its place.
maxFreqGHz - the highest frequency, in gigahertz, that may pass through this filter.
Returns:
a new low pass filter.

make

public static SignalFilter make(String deviceName,
                                String minFreqGHz,
                                String maxFreqGHz)
Creates and returns a new filter that blocks all frequencies outside the given range.

Parameters:
deviceName - an optional name for this filter. If this value is null a default name will be used in its place.
minFreqGHz - the lowest frequency, in gigahertz, that may pass through this filter.
maxFreqGHz - the highest frequency, in gigahertz, that may pass through this filter.
Returns:
a new filter.

make

public static SignalFilter make(String deviceName,
                                FrequencyRange passingRange)
Creates and returns a new filter that blocks all frequencies outside the given range.

Parameters:
deviceName - an optional name for this filter. If this value is null a default name will be used in its place.
passingRange - the range of frequencies that may pass through this filter. The endpoints of this range may both pass through this filter.
Returns:
a new filter.

getPassBand

public FrequencyRange getPassBand()
Returns the range of frequencies that may pass through this filter.

Returns:
the range of frequencies that may pass through this filter.

getInputPipe

public SignalPipe getInputPipe()
Returns the input pipe of this device. A typical usage pattern for this method is:
 myFilter.getInputPipe().connectInputTo(mySource);

Returns:
the input pipe of this device.

getOutputPipe

public SignalPipe getOutputPipe()
Returns the output pipe of this device. A typical usage pattern for this method is:
 myFilter.getOutputPipe().connectOutputTo(myProcessor);

Returns:
the output pipe of this device.

getMostRecentInput

public Signal getMostRecentInput()
Returns a copy of the input signal most recently processed by this device. If this processor has never been executed, or if the input signal it processed most recently was null, the returned value will be null.

Returns:
the input signal most recently sent into this filter.

getMostRecentOutput

public Signal getMostRecentOutput()
Returns a copy of the output signal most recently produced by this device. If this processor has never been executed, or if the input signal it processed most recently was null, the returned value will be null.

Returns:
the output signal most recently produced by this filter.

eraseSignalMemory

public void eraseSignalMemory()
Erases this device's memory of its most recent execution.

See Also:
getMostRecentInput(), getMostRecentOutput(), getSignal()

getSignal

public Signal getSignal()
Returns a copy of the signal produced by the most recent execution of this device. If this device has never been run, or if the input signal it processed most recently was null, the returned value will be null.

Specified by:
getSignal in interface SignalSource
Returns:
the signal provided by this device.

execute

public void execute()
Runs this device on the signal received from its input pipe and then executes the processor connected to its output pipe, if any. Both the input signal and the output produced by filtering it are remembered by this filter and are available via the getMostRecentInput() and getMostRecentOutput() methods.

Specified by:
execute in interface SignalProcessor

executeUpTo

public void executeUpTo(SignalProcessor firstUnexecutedDevice)
Description copied from interface: SignalProcessor
Executes this device and all downstream devices up to, but not including, the firstUnexecutedDevice. See SignalProcessor.execute() for more information about the linking of processors.

Specified by:
executeUpTo in interface SignalProcessor
Parameters:
firstUnexecutedDevice - the first device downstream that is not to be executed. If all downstream devices should be executed you may use a null value here or call SignalProcessor.execute().

executeFromStartOfChainUpTo

public void executeFromStartOfChainUpTo(SignalProcessor firstUnexecutedDevice)
Description copied from interface: SignalProcessor
Retreats upstream from this processor to the source of the stream and executes that device(s), telling it to stop execution at firstUnexecutedDevice.

Specified by:
executeFromStartOfChainUpTo in interface SignalProcessor
Parameters:
firstUnexecutedDevice - the first device in a chain of processors that is not to be executed. If all devices should be executed you may use a null value here. The first unexecuted device should be downstream of this device.

filter

public Signal filter(Signal input)
Creates and returns a new signal that is the result of applying this filter to the given input signal.

Note that the input signal and this filter are not affected by calls to this method. In other words this filter will not remember the input signal sent in or the output signal produced. This is in contrast to a call to the execute() methods.

Parameters:
input - the signal to be filtered.
Returns:
a new signal that is the result of applying this filter to input.


Copyright © 2009. All Rights Reserved.