de.dfki.lt.mary.unitselection
Class LPCDatagram

java.lang.Object
  extended by de.dfki.lt.mary.unitselection.Datagram
      extended by de.dfki.lt.mary.unitselection.LPCDatagram

public class LPCDatagram
extends Datagram


Field Summary
protected  short[] quantizedCoeffs
           
protected  byte[] quantizedResidual
           
 
Fields inherited from class de.dfki.lt.mary.unitselection.Datagram
data, duration
 
Constructor Summary
LPCDatagram(long setDuration, float[] coeffs, short[] residual, float lpcMin, float lpcRange)
          Construct an LPC datagram from unquantized data.
LPCDatagram(long setDuration, short[] quantizedCoeffs, byte[] quantizedResidual)
          Construct an LPC datagram from quantized data.
LPCDatagram(java.io.RandomAccessFile raf, int lpcOrder)
          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[] getCoeffs(float lpcMin, float lpcRange)
          Get the LPC coefficients, unquantized using the given lpc min and range values.
 int getLength()
          Get the length, in bytes, of the datagram's data field.
 short[] getQuantizedCoeffs()
          Get the quantized lpc coefficients
 byte[] getQuantizedResidual()
          Get the quantized residual.
 short[] getResidual()
          Get the unquantized residual
 int lpcOrder()
          Get the LPC order, i.e.
 void write(java.io.DataOutput out)
          Write this datagram to a random access file or data output stream.
 
Methods inherited from class de.dfki.lt.mary.unitselection.Datagram
getData, getDuration, setDuration
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

quantizedCoeffs

protected short[] quantizedCoeffs

quantizedResidual

protected byte[] quantizedResidual
Constructor Detail

LPCDatagram

public LPCDatagram(long setDuration,
                   short[] quantizedCoeffs,
                   byte[] quantizedResidual)
Construct an LPC datagram from quantized data.

Parameters:
duration - the duration, in samples, of the data represented by this datagram
quantizedCoeffs - the quantized LPC coefficients
quantizedResidual - the quantized residual

LPCDatagram

public LPCDatagram(long setDuration,
                   float[] coeffs,
                   short[] residual,
                   float lpcMin,
                   float lpcRange)
Construct an LPC datagram from unquantized data.

Parameters:
duration - the duration, in samples, of the data represented by this datagram
coeffs - the (unquantized) LPC coefficients
residual - the (unquantized) residual

LPCDatagram

public LPCDatagram(java.io.RandomAccessFile raf,
                   int lpcOrder)
            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

lpcOrder

public int lpcOrder()
Get the LPC order, i.e. the number of LPC coefficients.

Returns:
the lpc order
See Also:
getQuantizedCoeffs(), #getCoeffs()

getQuantizedCoeffs

public short[] getQuantizedCoeffs()
Get the quantized lpc coefficients

Returns:
an array of shorts, length lpcOrder()
See Also:
lpcOrder(), #getCoeffs()

getQuantizedResidual

public byte[] getQuantizedResidual()
Get the quantized residual.

Returns:
an array of bytes

getCoeffs

public float[] getCoeffs(float lpcMin,
                         float lpcRange)
Get the LPC coefficients, unquantized using the given lpc min and range values.

Parameters:
lpcMin - the lpc minimum
lpcRange - the lpc range
Returns:
an array of floats, length lpcOrder()
See Also:
lpcOrder(), getQuantizedCoeffs()

getResidual

public short[] getResidual()
Get the unquantized residual

Returns:
an array of shorts

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