marytts.signalproc.process
Class PhaseVocoder
java.lang.Object
marytts.util.data.BaseDoubleDataSource
marytts.util.data.BufferedDoubleDataSource
marytts.util.data.BlockwiseDoubleDataSource
marytts.signalproc.process.FrameOverlapAddSource
marytts.signalproc.process.PhaseVocoder
- All Implemented Interfaces:
- DoubleDataSource
public class PhaseVocoder
- extends FrameOverlapAddSource
A phase vocoder implementation for time stretching. Phase unwrapping is performed.
- Author:
- Marc Schröder
|
Method Summary |
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(java.lang.String[] args)
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
DEFAULT_FRAMELENGTH
public static final int DEFAULT_FRAMELENGTH
- See Also:
- Constant Field Values
rateChangeFactor
protected double rateChangeFactor
PhaseVocoder
public PhaseVocoder(DoubleDataSource inputSource,
int samplingRate,
double rateChangeFactor)
- Parameters:
inputSource - frameLength - samplingRate - rateChangeFactor - 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.
getInputFrameshift
protected int getInputFrameshift(int outputFrameshift)
- Overrides:
getInputFrameshift in class FrameOverlapAddSource
computeOutputLength
public 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.
From the illustrations in @see{FrameOverlapAddSource}, it can be seen that
for a given frame length f and frame shift s,
the length of a signal can be described as
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.
- Returns:
- the output length
main
public static void main(java.lang.String[] args)
throws java.lang.Exception
- Throws:
java.lang.Exception