marytts.unitselection.data
Class MCepDatagram

java.lang.Object
  extended by marytts.unitselection.data.Datagram
      extended by marytts.unitselection.data.MCepDatagram

public class MCepDatagram
extends Datagram


Field Summary
protected  float[] coeffs
           
 
Fields inherited from class marytts.unitselection.data.Datagram
data, duration
 
Constructor Summary
MCepDatagram(long setDuration, float[] coeffs)
          Construct a MCep datagram from a float vector.
MCepDatagram(java.io.RandomAccessFile raf, int order)
          Constructor which pops a datagram from a random access file.
 
Method Summary
 boolean equals(Datagram other)
          Tests if this datagram is equal to another datagram.
 float getCoeff(int i)
          Get a particular Mel-Cepstrum coefficient.
 float[] getCoeffs()
          Get the array of Mel-Cepstrum coefficients.
 double[] getCoeffsAsDouble()
          Get the array of Mel-Cepstrum coefficients.
 int getLength()
          Get the length, in bytes, of the datagram's data field.
 int order()
          Get the order, i.e. the number of MEl-Cepstrum coefficients.
 void write(java.io.DataOutput out)
          Write this datagram to a random access file or data output stream.
 
Methods inherited from class marytts.unitselection.data.Datagram
getData, getDuration, setDuration
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

coeffs

protected float[] coeffs
Constructor Detail

MCepDatagram

public MCepDatagram(long setDuration,
                    float[] coeffs)
Construct a MCep datagram from a float vector.

Parameters:
duration - the duration, in samples, of the data represented by this datagram
coeffs - the array of Mel-Cepstrum coefficients.

MCepDatagram

public MCepDatagram(java.io.RandomAccessFile raf,
                    int order)
             throws java.io.IOException,
                    java.io.EOFException
Constructor which pops a datagram from a random access file.

Parameters:
raf - the random access file to pop the datagram from.
Throws:
java.io.IOException
java.io.EOFException
Method Detail

getLength

public int getLength()
Get the length, in bytes, of the datagram's data field.

Overrides:
getLength in class Datagram

order

public int order()
Get the order, i.e. the number of MEl-Cepstrum coefficients.

Returns:
the order
See Also:
getCoeffs()

getCoeffs

public float[] getCoeffs()
Get the array of Mel-Cepstrum coefficients.


getCoeffsAsDouble

public double[] getCoeffsAsDouble()
Get the array of Mel-Cepstrum coefficients.


getCoeff

public float getCoeff(int i)
Get a particular Mel-Cepstrum coefficient.


write

public void write(java.io.DataOutput out)
           throws java.io.IOException
Write this datagram to a random access file or data output stream.

Overrides:
write in class Datagram
Throws:
java.io.IOException

equals

public boolean equals(Datagram other)
Tests if this datagram is equal to another datagram.

Overrides:
equals in class Datagram