public class NaiveVocoder extends FrameOverlapAddSource
Modifier and Type | Field and Description |
---|---|
static int |
DEFAULT_FRAMELENGTH |
protected double |
rateChangeFactor |
DEFAULT_WINDOWTYPE, frameProvider, memory, outputWindow, processor
blockSize
buf, dataProcessor, DEFAULT_BUFFERSIZE, readPos, writePos
dataLength, inputSource
NOT_SPECIFIED
Constructor and Description |
---|
NaiveVocoder(DoubleDataSource inputSource,
int samplingRate,
double rateChangeFactor) |
Modifier and Type | Method and Description |
---|---|
int |
computeOutputLength(int inputLengthInSamples)
Based on the given rate change factor, compute the exact length change factor for a given signal length, based on the
current frame length and input/output frame shifts.
|
protected int |
getInputFrameshift(int outputFrameshift) |
static void |
main(String[] args) |
getBlockSize, getNextFrame, hasMoreData, initialise, prepareBlock, readBlock
readIntoBuffer
available, bufferSpaceLeft, compact, currentlyInBuffer, getData, increaseBufferSize
getAllData, getData, getData, getDataLength
public static final int DEFAULT_FRAMELENGTH
protected double rateChangeFactor
public NaiveVocoder(DoubleDataSource inputSource, int samplingRate, double rateChangeFactor)
inputSource
- input sourcesamplingRate
- sampling raterateChangeFactor
- the factor by which to speed up or slow down the source. Values greater than one will speed up, values smaller
than one will slow down the original.protected int getInputFrameshift(int outputFrameshift)
getInputFrameshift
in class FrameOverlapAddSource
public int computeOutputLength(int inputLengthInSamples)
l(n) = f + n*s - delta
.
f is fixed; s is si for input frameshift, so for output frameshift. For a given input length, one can compute n and rest
and thus compute the output length.inputLengthInSamples
- inputLengthInSamplesCopyright © 2000–2016 DFKI GmbH. All rights reserved.