|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object edu.nrao.sss.electronics.SignalSampler
public class SignalSampler
A device that samples a signal to create a DigitalSignal
.
Version Info:
$Revision: 1269 $ |
$Date: 2008-05-05 14:39:39 -0600 (Mon, 05 May 2008) $ |
$Author: dharland $ (last person to modify) |
Constructor Summary | |
---|---|
SignalSampler(String deviceName,
int numberOfBitsPerSample,
Frequency samplesPerSecond)
Creates a new sampler that produces signals with the given properties. |
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 . |
SignalPipe |
getInputPipe()
Returns the input pipe of this device. |
Signal |
getMostRecentInput()
Returns a copy of the input signal most recently processed by this device. |
DigitalSignal |
getMostRecentOutput()
Returns a copy of the output signal most recently produced by this device. |
String |
getName()
Returns the name of this device. |
SignalPipe |
getOutputPipe()
Returns the output pipe of this device. |
Signal |
getSignal()
Returns a copy of the signal produced by the most recent execution of this device. |
DigitalSignal |
sample(Signal input)
Creates and returns a new signal that is the result of applying this sampler to the given input signal. |
void |
setName(String newName)
Sets the name of this device. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public SignalSampler(String deviceName, int numberOfBitsPerSample, Frequency samplesPerSecond)
deviceName
- an optional name for this sampler. If this value is null
a default name will be used in its place.numberOfBitsPerSample
- the number of bits in one sample of a digital signal produced by
this device.samplesPerSecond
- the number of samples of a signal taken per second by this device.Method Detail |
---|
public void setName(String newName)
If newName
is null or the empty string
(""), the request to change the name will be
denied and the current name will remain in place.
newName
- an optional name for this sampler.public String getName()
public SignalPipe getInputPipe()
mySampler.getInputPipe().connectInputTo(mySource);
public SignalPipe getOutputPipe()
mySampler.getOutputPipe().connectOutputTo(myProcessor);
public Signal getMostRecentInput()
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.
public DigitalSignal getMostRecentOutput()
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.
public void eraseSignalMemory()
getMostRecentInput()
,
getMostRecentOutput()
,
getSignal()
public Signal getSignal()
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.
The returned signal may be safely cast to a DigitalSignal
.
getSignal
in interface SignalSource
public void execute()
getMostRecentInput()
and getMostRecentOutput()
methods.
execute
in interface SignalProcessor
public void executeUpTo(SignalProcessor firstUnexecutedDevice)
SignalProcessor
firstUnexecutedDevice
.
See SignalProcessor.execute()
for more information about the linking
of processors.
executeUpTo
in interface SignalProcessor
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()
.public void executeFromStartOfChainUpTo(SignalProcessor firstUnexecutedDevice)
SignalProcessor
firstUnexecutedDevice
.
executeFromStartOfChainUpTo
in interface SignalProcessor
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.public DigitalSignal sample(Signal input)
This sampler alters the analog signal in the same way that a mixer connected to a local oscillator that is tuned to a frequency equal to that of the sampling frequency of this mixer would.
Note that the input
signal and this sampler are
not affected by calls to this method. In other words this sampler
will not remember the input signal sent in or the output
signal produced. This is in contrast to a call to the
execute()
methods.
input
- the signal to be sampled.
input
.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |