|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectmarytts.signalproc.process.FrameProvider
marytts.signalproc.process.PitchFrameProvider
public class PitchFrameProvider
| Field Summary | |
|---|---|
protected long |
currPitchmark
|
protected double[] |
cutFrame
|
protected int[] |
periodLengths
|
protected int |
periodsInMemory
|
protected DoubleDataSource |
pitchmarks
|
protected int |
shiftPeriods
|
protected DynamicTwoHalvesWindow |
twoHalvesWindow
|
| Fields inherited from class marytts.signalproc.process.FrameProvider |
|---|
frame, frameLength, frameShift, frameStart, nextFrameStart, processor, samplingRate, signal, totalRead, validSamplesInFrame |
| Constructor Summary | |
|---|---|
PitchFrameProvider(DoubleDataSource signal,
DoubleDataSource pitchmarks,
InlineDataProcessor processor,
int samplingRate)
Create a new PitchFrameProvider providing one period at a time. |
|
PitchFrameProvider(DoubleDataSource signal,
DoubleDataSource pitchmarks,
InlineDataProcessor processor,
int samplingRate,
int framePeriods,
int shiftPeriods)
Create a new PitchFrameProvider with a configurable number of pitch periods per frame and pitch periods to shift by. |
|
| Method Summary | |
|---|---|
double[] |
getCurrentFrame()
|
protected int |
getData(int nPrefilled)
Read data from input signal into current frame. |
int |
getFramePeriods()
The number of periods provided in one frame. |
double[] |
getNextFrame()
Provide the next frame of data. |
int |
getShiftPeriods()
The number of periods by which the analysis window is shifted. |
boolean |
hasMoreData()
Whether or not this frameprovider can provide another frame. |
static void |
main(java.lang.String[] args)
Test this pitch frame provider, by printing information about the pitch frames of an audio file. |
| Methods inherited from class marytts.signalproc.process.FrameProvider |
|---|
getFrameLengthSamples, getFrameLengthTime, getFrameShiftSamples, getFrameShiftTime, getFrameStartSamples, getFrameStartTime, getSamplingRate, resetInternalTimer, stopWhenTouchingEnd, validSamplesInFrame |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected DoubleDataSource pitchmarks
protected int[] periodLengths
protected int shiftPeriods
protected int periodsInMemory
protected long currPitchmark
protected DynamicTwoHalvesWindow twoHalvesWindow
protected double[] cutFrame
| Constructor Detail |
|---|
public PitchFrameProvider(DoubleDataSource signal,
DoubleDataSource pitchmarks,
InlineDataProcessor processor,
int samplingRate)
signal - audio signalpitchmarks - an array of pitchmarks; each pitch mark is in seconds from signal startprocessor - an optional processor to apply to each input frame (e.g., a DynamicWindow)samplingRate - number of samples per second in signal
public PitchFrameProvider(DoubleDataSource signal,
DoubleDataSource pitchmarks,
InlineDataProcessor processor,
int samplingRate,
int framePeriods,
int shiftPeriods)
signal - audio signalpitchmarks - an array of pitchmarks; each pitch mark is in seconds from signal startprocessor - an optional processor to apply to each input frame (e.g., a DynamicWindow)samplingRate - number of samples per second in signalframePeriods - number of periods that each frame should containshiftPeriods - number of periods that frames should be shifted by| Method Detail |
|---|
protected int getData(int nPrefilled)
getData in class FrameProviderframe - the frame to read intonPrefilled - number of valid values at the beginning of frame. These should not be lost or overwritten.
public double[] getNextFrame()
getNextFrame in class FrameProviderpublic double[] getCurrentFrame()
getCurrentFrame in class FrameProviderpublic int getFramePeriods()
public int getShiftPeriods()
public boolean hasMoreData()
hasMoreData in class FrameProvider
public static void main(java.lang.String[] args)
throws java.lang.Exception
args - two args are expected: the name of an audio file, and the name of the corresponding pitch mark file.
java.lang.Exception
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||