public class LPCDatagram extends Datagram
Modifier and Type | Field and Description |
---|---|
protected short[] |
quantizedCoeffs |
protected byte[] |
quantizedResidual |
data, duration, NUM_HEADER_BYTES
Constructor and Description |
---|
LPCDatagram(ByteBuffer bb,
int lpcOrder)
Constructor which pops a datagram from a byte buffer.
|
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(RandomAccessFile raf,
int lpcOrder)
Constructor which pops a datagram from a random access file.
|
Modifier and Type | Method and Description |
---|---|
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(DataOutput out)
Write this datagram to a random access file or data output stream.
|
equals, getData, getDuration, setDuration
protected short[] quantizedCoeffs
protected byte[] quantizedResidual
public LPCDatagram(long setDuration, short[] quantizedCoeffs, byte[] quantizedResidual)
setDuration
- the duration, in samples, of the data represented by this datagramquantizedCoeffs
- the quantized LPC coefficientsquantizedResidual
- the quantized residualpublic LPCDatagram(long setDuration, float[] coeffs, short[] residual, float lpcMin, float lpcRange)
setDuration
- the duration, in samples, of the data represented by this datagramcoeffs
- the (unquantized) LPC coefficientsresidual
- the (unquantized) residuallpcMin
- lpcMinlpcRange
- lpcRangepublic LPCDatagram(RandomAccessFile raf, int lpcOrder) throws IOException, EOFException
raf
- the random access file to pop the datagram from.lpcOrder
- lpcOrderIOException
- IOExceptionEOFException
- EOFExceptionpublic LPCDatagram(ByteBuffer bb, int lpcOrder) throws IOException, EOFException
bb
- the byte buffer to pop the datagram from.lpcOrder
- lpcOrderIOException
- IOExceptionEOFException
- EOFExceptionpublic int getLength()
public int lpcOrder()
getQuantizedCoeffs()
,
getCoeffs(float lpcMin, float lpcRange)
public short[] getQuantizedCoeffs()
lpcOrder()
,
getCoeffs(float lpcMin, float lpcRange)
public byte[] getQuantizedResidual()
public float[] getCoeffs(float lpcMin, float lpcRange)
lpcMin
- the lpc minimumlpcRange
- the lpc rangelpcOrder()
,
getQuantizedCoeffs()
public short[] getResidual()
public void write(DataOutput out) throws IOException
write
in class Datagram
out
- outIOException
- IOExceptionpublic boolean equals(Datagram other)
other
- otherCopyright © 2000–2016 DFKI GmbH. All rights reserved.