ExampleFeatureComputer Class Reference

This class is only added for documentation, it is not intended to ever be used. More...

#include <feature-common.h>

Collaboration diagram for ExampleFeatureComputer:

Public Types

typedef ExampleFeatureComputerOptions Options
 

Public Member Functions

const FrameExtractionOptionsGetFrameOptions () const
 Returns a reference to the frame-extraction options class, which will be part of our own options class. More...
 
int32 Dim () const
 Returns the feature dimension. More...
 
bool NeedRawLogEnergy () const
 Returns true if this function may inspect the raw log-energy of the signal (before windowing and pre-emphasis); it's safe to always return true, but setting it to false enables an optimization. More...
 
 ExampleFeatureComputer (const ExampleFeatureComputerOptions &opts)
 constructor from options class; it should not store a reference or pointer to the options class but should copy it. More...
 
 ExampleFeatureComputer (const ExampleFeatureComputer &other)
 Copy constructor; all of these classes must have one. More...
 
void Compute (BaseFloat signal_raw_log_energy, BaseFloat vtln_warp, VectorBase< BaseFloat > *signal_frame, VectorBase< BaseFloat > *feature)
 Function that computes one frame of features from one frame of signal. More...
 

Private Member Functions

ExampleFeatureComputeroperator= (const ExampleFeatureComputer &in)
 

Private Attributes

Options opts_
 

Detailed Description

This class is only added for documentation, it is not intended to ever be used.

It documents the interface of the *Computer classes which wrap the low-level feature extraction. The template argument F of OfflineFeatureTpl must follow this interface. This interface is intended for features such as MFCCs and PLPs which can be computed frame by frame.

Definition at line 45 of file feature-common.h.

Member Typedef Documentation

◆ Options

Definition at line 47 of file feature-common.h.

Constructor & Destructor Documentation

◆ ExampleFeatureComputer() [1/2]

ExampleFeatureComputer ( const ExampleFeatureComputerOptions opts)
inlineexplicit

constructor from options class; it should not store a reference or pointer to the options class but should copy it.

Definition at line 65 of file feature-common.h.

65  :
66  opts_(opts) { }

◆ ExampleFeatureComputer() [2/2]

Copy constructor; all of these classes must have one.

Member Function Documentation

◆ Compute()

void Compute ( BaseFloat  signal_raw_log_energy,
BaseFloat  vtln_warp,
VectorBase< BaseFloat > *  signal_frame,
VectorBase< BaseFloat > *  feature 
)

Function that computes one frame of features from one frame of signal.

Parameters
[in]signal_raw_log_energyThe log-energy of the frame of the signal prior to windowing and pre-emphasis, or log(numeric_limits<float>::min()), whichever is greater. Must be ignored by this function if this class returns false from this->NeedRawLogEnergy().
[in]vtln_warpThe VTLN warping factor that the user wants to be applied when computing features for this utterance. Will normally be 1.0, meaning no warping is to be done. The value will be ignored for feature types that don't support VLTN, such as spectrogram features.
[in]signal_frameOne frame of the signal, as extracted using the function ExtractWindow() using the options returned by this->GetFrameOptions(). The function will use the vector as a workspace, which is why it's a non-const pointer.
[out]featurePointer to a vector of size this->Dim(), to which the computed feature will be written.

◆ Dim()

int32 Dim ( ) const

Returns the feature dimension.

◆ GetFrameOptions()

const FrameExtractionOptions& GetFrameOptions ( ) const
inline

Returns a reference to the frame-extraction options class, which will be part of our own options class.

Definition at line 51 of file feature-common.h.

51  {
52  return opts_.frame_opts;
53  }
FrameExtractionOptions frame_opts

◆ NeedRawLogEnergy()

bool NeedRawLogEnergy ( ) const
inline

Returns true if this function may inspect the raw log-energy of the signal (before windowing and pre-emphasis); it's safe to always return true, but setting it to false enables an optimization.

Definition at line 61 of file feature-common.h.

61 { return true; }

◆ operator=()

ExampleFeatureComputer& operator= ( const ExampleFeatureComputer in)
private

Member Data Documentation

◆ opts_

Options opts_
private

Definition at line 100 of file feature-common.h.


The documentation for this class was generated from the following file: