ptolemy.domains.sdf.lib
Class RaisedCosine
java.lang.Object
ptolemy.kernel.util.NamedObj
ptolemy.kernel.InstantiableNamedObj
ptolemy.kernel.Entity
ptolemy.kernel.ComponentEntity
ptolemy.actor.AtomicActor
ptolemy.actor.TypedAtomicActor
ptolemy.domains.sdf.lib.SDFTransformer
ptolemy.domains.sdf.lib.FIR
ptolemy.domains.sdf.lib.RaisedCosine
- All Implemented Interfaces:
- java.io.Serializable, java.lang.Cloneable, Actor, Executable, FiringsRecordable, Initializable, SequenceActor, TypedActor, Changeable, Debuggable, DebugListener, Derivable, Instantiable, ModelErrorHandler, MoMLExportable, Moveable, Nameable
public class RaisedCosine
- extends FIR
This actor implements an FIR filter with
a raised cosine or square-root raised cosine frequency response.
The excess bandwidth is given
by excessBW and the symbol interval (in number of samples)
by interpolation (which by default is 16).
The length of the filter (the number of taps) is given by length.
For the ordinary raised cosine response,
the impulse response of the filter would ideally be
sin(pi n/T) cos(alpha pi n/T)
h(n) = ----------- * -----------------
pi n/T 1-(2 alpha n/T)2
where alpha is excessBW and T is the
interpolation factor.
However, this pulse is centered at zero, and we can only implement causal
filters in the SDF domain in Ptolemy. Hence, the impulse response is
actually
g(n) = h(n - M)
where M = length/2 if length is even, and M
= (length+1)/2 if length is odd.
The impulse response is simply truncated outside this range, so
the impulse response will generally not be symmetric if length is even
because it will have one more sample to the left than to the right of center.
Unless this extra sample is zero, the filter will not have linear phase
if length is even.
For the ordinary raised cosine response, the
distance (in number of samples) from the center
to the first zero crossing is given by symbolInterval.
For the square-root raised cosine response, a cascade of two identical
square-root raised cosine filters would be equivalent to a single
ordinary raised cosine filter.
The impulse response of the square-root raised cosine pulse is given by
4 alpha(cos((1+alpha)pi n/T)+Tsin((1-alpha)pi n/T)/(4n alpha/T))
h(n) = -----------------------------------------------------------------
pi sqrt(T)(1-(4 alpha n/T)2)
This impulse response convolved with itself will, in principle, be equal
to a raised cosine pulse. However, because of the abrupt rectangular
windowing of the pulse, with low excess bandwidth, this ideal is not
closely approximated except for very long filters.
The output sample rate is interpolation times the input.
This is set by default to 16 because in digital communication systems
this pulse is used for the line coding of symbols, and upsampling is necessary.
Typically, the value of interpolation is the same as that of
symbolInterval, at least when the filter is being used
as a transmit pulse shaper.
References
[1]
E. A. Lee and D. G. Messerschmitt,
Digital Communication, Kluwer Academic Publishers, Boston, 1988.
[2]
I. Korn, Digital Communications, Van Nostrand Reinhold, New York, 1985.
- Since:
- Ptolemy II 0.2
- Version:
- $Id: RaisedCosine.java 57040 2010-01-27 20:52:32Z cxh $
- Author:
- Edward A. Lee
- See Also:
- Serialized Form
- Accepted Rating:
- Proposed Rating:
Fields inherited from class ptolemy.domains.sdf.lib.FIR |
_data, _decimationPhaseValue, _decimationValue, _interpolationValue, _mostRecent, _phaseLength, _reinitializeNeeded, _taps, _zero, decimation, decimationPhase, interpolation, taps |
Fields inherited from class ptolemy.kernel.util.NamedObj |
_changeListeners, _changeLock, _changeRequests, _debugging, _debugListeners, _elementName, _isPersistent, _verbose, _workspace, ATTRIBUTES, CLASSNAME, COMPLETE, CONTENTS, DEEP, FULLNAME, LINKS |
Constructor Summary |
RaisedCosine(CompositeEntity container,
java.lang.String name)
Construct an actor with the given container and name. |
Method Summary |
private void |
_initialize()
|
void |
attributeChanged(Attribute attribute)
Reevaluate the filter taps if the attribute is any of the ones
defined locally, and otherwise call the superclass. |
Methods inherited from class ptolemy.actor.AtomicActor |
_actorFiring, _actorFiring, addActorFiringListener, addInitializable, connectionsChanged, createReceivers, declareDelayDependency, getCausalityInterface, getDirector, getExecutiveDirector, getManager, inputPortList, isFireFunctional, isStrict, iterate, newReceiver, outputPortList, postfire, preinitialize, pruneDependencies, recordFiring, removeActorFiringListener, removeDependency, removeInitializable, setContainer, stop, stopFire, terminate, wrapup |
Methods inherited from class ptolemy.kernel.ComponentEntity |
_adjustDeferrals, _checkContainer, _getContainedObject, _propagateExistence, getContainer, instantiate, isAtomic, isOpaque, moveDown, moveToFirst, moveToIndex, moveToLast, moveUp, propagateExistence, setName |
Methods inherited from class ptolemy.kernel.Entity |
_description, _exportMoMLContents, _removePort, _validateSettables, connectedPortList, connectedPorts, containedObjectsIterator, getAttribute, getPort, getPorts, linkedRelationList, linkedRelations, portList, removeAllPorts, setClassDefinition, uniqueName |
Methods inherited from class ptolemy.kernel.util.NamedObj |
_addAttribute, _adjustOverride, _attachText, _cloneFixAttributeFields, _debug, _debug, _debug, _debug, _debug, _getIndentPrefix, _isMoMLSuppressed, _markContentsDerived, _propagateValue, _recordDecoratedAttributes, _removeAttribute, _splitName, _stripNumericSuffix, addChangeListener, addDebugListener, attributeList, attributeList, deepContains, depthInHierarchy, description, description, event, executeChangeRequests, exportMoML, exportMoML, exportMoML, exportMoML, exportMoMLPlain, getAttribute, getAttributes, getChangeListeners, getClassName, getDecoratorAttribute, getDecoratorAttributes, getDerivedLevel, getDerivedList, getDisplayName, getFullName, getModelErrorHandler, getName, getName, getSource, handleModelError, isDeferringChangeRequests, isOverridden, isPersistent, lazyContainedObjectsIterator, message, propagateValue, propagateValues, removeChangeListener, removeDebugListener, requestChange, setClassName, setDeferringChangeRequests, setDerivedLevel, setDisplayName, setModelErrorHandler, setPersistent, setSource, sortContainedObjects, toplevel, toString, validateSettables, workspace |
Methods inherited from class java.lang.Object |
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
excessBW
public Parameter excessBW
- The excess bandwidth. This contains a
DoubleToken, and by default it has value 1.0.
length
public Parameter length
- The length of the pulse. This contains an
IntToken, and by default it has value 64.
root
public Parameter root
- If true, use the square root of the raised cosine instead of the
raised cosine. This contains a
BooleanToken, and by default it has value false.
symbolInterval
public Parameter symbolInterval
- The symbol interval, which is the number of samples to the first
zero crossing on each side of the main lobe. Its value is an
IntToken, and by default it has value 16.
RaisedCosine
public RaisedCosine(CompositeEntity container,
java.lang.String name)
throws NameDuplicationException,
IllegalActionException
- Construct an actor with the given container and name.
- Parameters:
container
- The container.name
- The name of this actor.
- Throws:
IllegalActionException
- If the actor cannot be contained
by the proposed container.
NameDuplicationException
- If the container already has an
actor with this name.
attributeChanged
public void attributeChanged(Attribute attribute)
throws IllegalActionException
- Reevaluate the filter taps if the attribute is any of the ones
defined locally, and otherwise call the superclass.
- Overrides:
attributeChanged
in class FIR
- Parameters:
attribute
- The attribute that changed.
- Throws:
IllegalActionException
- If the parameters are out of range.
_initialize
private void _initialize()
throws IllegalActionException
- Throws:
IllegalActionException