framed
Class Selection

java.lang.Object
  extended by framed.Selection
All Implemented Interfaces:
FrameSource

public class Selection
extends java.lang.Object
implements FrameSource


Field Summary
static java.lang.String synopsis
           
 
Constructor Summary
Selection(FrameSource source)
          Generate a default feature selection: dimensions 0-11 (standard mfcc)
Selection(FrameSource source, int n)
          Select the first n coefficients
Selection(FrameSource source, int[] indices)
          Apply a selection to the incoming feature frame
 
Method Summary
static Selection create(FrameSource source, java.lang.String formatString)
          Create a Selection object according to the parameter string and attach it to the source.
 int getFrameSize()
          Return the outgoing frame size
static void main(java.lang.String[] args)
          main program; for usage see synopsis
 boolean read(double[] buf)
          Read the next frame and transfer the features to the outgoing buffer according to the indices
 java.lang.String toString()
          Return a String representation of the FrameSource
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

synopsis

public static java.lang.String synopsis
Constructor Detail

Selection

public Selection(FrameSource source)
Generate a default feature selection: dimensions 0-11 (standard mfcc)

Parameters:
source -

Selection

public Selection(FrameSource source,
                 int n)
Select the first n coefficients

Parameters:
source -

Selection

public Selection(FrameSource source,
                 int[] indices)
Apply a selection to the incoming feature frame

Parameters:
source -
indices - a implicit mapping, place the indices of the desired dimensions here
Method Detail

create

public static Selection create(FrameSource source,
                               java.lang.String formatString)
                        throws MalformedParameterStringException
Create a Selection object according to the parameter string and attach it to the source.

Parameters:
source - framesource to read from
formatString - comma separated list of indices or ranges (e.g. "0,1,4-8")
Returns:
ready-to-use Selection
Throws:
MalformedParameterStringException

getFrameSize

public int getFrameSize()
Return the outgoing frame size

Specified by:
getFrameSize in interface FrameSource

main

public static void main(java.lang.String[] args)
                 throws java.io.IOException,
                        MalformedParameterStringException
main program; for usage see synopsis

Parameters:
args -
Throws:
java.io.IOException
IOException, - MalformedParameterStringException
MalformedParameterStringException

read

public boolean read(double[] buf)
             throws java.io.IOException
Read the next frame and transfer the features to the outgoing buffer according to the indices

Specified by:
read in interface FrameSource
Parameters:
buf - buffer to save the frame; implementing objects may depend on a constant dimensionduring subsequent calls
Returns:
true on success, false if the stream terminated before the window was filled
Throws:
java.io.IOException

toString

public java.lang.String toString()
Description copied from interface: FrameSource
Return a String representation of the FrameSource

Specified by:
toString in interface FrameSource
Overrides:
toString in class java.lang.Object