SphinxBase  5prealpha
yin.h File Reference

Implementation of pitch estimation. More...

#include <sphinxbase/sphinxbase_export.h>
#include <sphinxbase/prim_type.h>

Go to the source code of this file.

Typedefs

typedef struct yin_s yin_t
 Frame-based moving-window pitch estimator.
 

Functions

SPHINXBASE_EXPORT yin_tyin_init (int frame_size, float search_threshold, float search_range, int smooth_window)
 Initialize moving-window pitch estimation.
 
SPHINXBASE_EXPORT void yin_free (yin_t *pe)
 Free a moving-window pitch estimator.
 
SPHINXBASE_EXPORT void yin_start (yin_t *pe)
 Start processing an utterance.
 
SPHINXBASE_EXPORT void yin_end (yin_t *pe)
 Mark the end of an utterance.
 
SPHINXBASE_EXPORT void yin_write (yin_t *pe, int16 const *frame)
 Feed a frame of data to the pitch estimator. More...
 
SPHINXBASE_EXPORT int yin_read (yin_t *pe, uint16 *out_period, uint16 *out_bestdiff)
 Read a raw estimated pitch value from the pitch estimator. More...
 

Detailed Description

Implementation of pitch estimation.

Author
David Huggins-Daines dhugg.nosp@m.ins@.nosp@m.cs.cm.nosp@m.u.ed.nosp@m.u

This implements part of the YIN algorithm:

"YIN, a fundamental frequency estimator for speech and music". Alain de Cheveigné and Hideki Kawahara. Journal of the Acoustical Society of America, 111 (4), April 2002.

Definition in file yin.h.

Function Documentation

◆ yin_read()

SPHINXBASE_EXPORT int yin_read ( yin_t pe,
uint16 *  out_period,
uint16 *  out_bestdiff 
)

Read a raw estimated pitch value from the pitch estimator.

Parameters
pePitch estimator.
out_periodOutput: an estimate of the period (not the pitch) of the signal in samples.
out_bestdiffOutput: the minimum normalized difference value associated with *out_pitch, in Q15 format (i.e. scaled by 32768). This can be interpreted as one minus the probability of voicing.
Returns
Non-zero if enough data was avaliable to return a pitch estimate, zero otherwise.

Definition at line 222 of file yin.c.

References yin_s::diff_window, yin_s::endut, yin_s::nfr, yin_s::period_window, yin_s::search_range, yin_s::wcur, yin_s::wsize, and yin_s::wstart.

◆ yin_write()

SPHINXBASE_EXPORT void yin_write ( yin_t pe,
int16 const *  frame 
)

Feed a frame of data to the pitch estimator.

Parameters
pePitch estimator.
frameFrame of frame_size (see yin_init()) samples of audio data.

Definition at line 195 of file yin.c.

References yin_s::wsize, and yin_s::wstart.