Class RaisedCosine

  • All Implemented Interfaces:
    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$
    Author:
    Edward A. Lee
    Pt.AcceptedRating:
    Yellow (neuendor)
    Pt.ProposedRating:
    Yellow (neuendor)
    • Field Detail

      • 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.
    • Method Detail

      • 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.