<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> <title>SphinxBase: src/libsphinxbase/fe/yin.c File Reference</title> <link href="tabs.css" rel="stylesheet" type="text/css"/> <link href="navtree.css" rel="stylesheet" type="text/css"/> <script type="text/javascript" src="jquery.js"></script> <script type="text/javascript" src="navtree.js"></script> <script type="text/javascript" src="resize.js"></script> <script type="text/javascript"> $(document).ready(initResizable); </script> <link href="doxygen.css" rel="stylesheet" type="text/css"/> </head> <body> <!-- Generated by Doxygen 1.7.3 --> <div id="top"> <div id="titlearea"> <table cellspacing="0" cellpadding="0"> <tbody> <tr style="height: 56px;"> <td style="padding-left: 0.5em;"> <div id="projectname">SphinxBase <span id="projectnumber">0.6</span></div> </td> </tr> </tbody> </table> </div> <div id="navrow1" class="tabs"> <ul class="tablist"> <li><a href="index.html"><span>Main Page</span></a></li> <li><a href="pages.html"><span>Related Pages</span></a></li> <li><a href="annotated.html"><span>Data Structures</span></a></li> <li class="current"><a href="files.html"><span>Files</span></a></li> </ul> </div> <div id="navrow2" class="tabs2"> <ul class="tablist"> <li><a href="files.html"><span>File List</span></a></li> <li><a href="globals.html"><span>Globals</span></a></li> </ul> </div> </div> <div id="side-nav" class="ui-resizable side-nav-resizable"> <div id="nav-tree"> <div id="nav-tree-contents"> </div> </div> <div id="splitbar" style="-moz-user-select:none;" class="ui-resizable-handle"> </div> </div> <script type="text/javascript"> initNavTree('yin_8c.html',''); </script> <div id="doc-content"> <div class="header"> <div class="summary"> <a href="#nested-classes">Data Structures</a> | <a href="#func-members">Functions</a> </div> <div class="headertitle"> <h1>src/libsphinxbase/fe/yin.c File Reference</h1> </div> </div> <div class="contents"> <p>Implementation of pitch extraction. <a href="#_details">More...</a></p> <div class="textblock"><code>#include "sphinxbase/prim_type.h"</code><br/> <code>#include "sphinxbase/ckd_alloc.h"</code><br/> <code>#include "sphinxbase/fixpoint.h"</code><br/> <code>#include "sphinxbase/yin.h"</code><br/> <code>#include <stdio.h></code><br/> </div> <p><a href="yin_8c_source.html">Go to the source code of this file.</a></p> <table class="memberdecls"> <tr><td colspan="2"><h2><a name="nested-classes"></a> Data Structures</h2></td></tr> <tr><td class="memItemLeft" align="right" valign="top">struct  </td><td class="memItemRight" valign="bottom"><a class="el" href="structyin__s.html">yin_s</a></td></tr> <tr><td colspan="2"><h2><a name="func-members"></a> Functions</h2></td></tr> <tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="adeaf7df902787daf9fa9d7453798c01e"></a><!-- doxytag: member="yin.c::yin_init" ref="adeaf7df902787daf9fa9d7453798c01e" args="(int frame_size, float search_threshold, float search_range, int smooth_window)" --> <a class="el" href="structyin__s.html">yin_t</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="yin_8c.html#adeaf7df902787daf9fa9d7453798c01e">yin_init</a> (int frame_size, float search_threshold, float search_range, int smooth_window)</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Initialize moving-window pitch estimation. <br/></td></tr> <tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a98f2ed13316b8ab9bf93feb4b6d3e7bd"></a><!-- doxytag: member="yin.c::yin_free" ref="a98f2ed13316b8ab9bf93feb4b6d3e7bd" args="(yin_t *pe)" --> void </td><td class="memItemRight" valign="bottom"><a class="el" href="yin_8c.html#a98f2ed13316b8ab9bf93feb4b6d3e7bd">yin_free</a> (<a class="el" href="structyin__s.html">yin_t</a> *pe)</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Free a moving-window pitch estimator. <br/></td></tr> <tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="aedb765d2c9f8f9d96f90b4971ed0f649"></a><!-- doxytag: member="yin.c::yin_start" ref="aedb765d2c9f8f9d96f90b4971ed0f649" args="(yin_t *pe)" --> void </td><td class="memItemRight" valign="bottom"><a class="el" href="yin_8c.html#aedb765d2c9f8f9d96f90b4971ed0f649">yin_start</a> (<a class="el" href="structyin__s.html">yin_t</a> *pe)</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Start processing an utterance. <br/></td></tr> <tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="abfe51d8b596f85941831b2727e49c181"></a><!-- doxytag: member="yin.c::yin_end" ref="abfe51d8b596f85941831b2727e49c181" args="(yin_t *pe)" --> void </td><td class="memItemRight" valign="bottom"><a class="el" href="yin_8c.html#abfe51d8b596f85941831b2727e49c181">yin_end</a> (<a class="el" href="structyin__s.html">yin_t</a> *pe)</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Mark the end of an utterance. <br/></td></tr> <tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a3befedc0027bb60c5c4b571a6a5c2e03"></a><!-- doxytag: member="yin.c::thresholded_search" ref="a3befedc0027bb60c5c4b571a6a5c2e03" args="(int32 *diff_window, fixed32 threshold, int start, int end)" --> int </td><td class="memItemRight" valign="bottom"><b>thresholded_search</b> (int32 *diff_window, fixed32 threshold, int start, int end)</td></tr> <tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="yin_8c.html#ae272b1d9ce8ad45f69eb8b5f98f305b6">yin_write</a> (<a class="el" href="structyin__s.html">yin_t</a> *pe, int16 const *frame)</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Feed a frame of data to the pitch estimator. <a href="#ae272b1d9ce8ad45f69eb8b5f98f305b6"></a><br/></td></tr> <tr><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="yin_8c.html#a5d4ceba1aed1fcc8e10f6408a271b294">yin_read</a> (<a class="el" href="structyin__s.html">yin_t</a> *pe, uint16 *out_period, uint16 *out_bestdiff)</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Read a raw estimated pitch value from the pitch estimator. <a href="#a5d4ceba1aed1fcc8e10f6408a271b294"></a><br/></td></tr> </table> <hr/><a name="_details"></a><h2>Detailed Description</h2> <div class="textblock"><p>Implementation of pitch extraction. </p> <dl class="author"><dt><b>Author:</b></dt><dd>David Huggins-Daines <<a href="mailto:dhuggins@cs.cmu.edu">dhuggins@cs.cmu.edu</a>> </dd></dl> <p>Definition in file <a class="el" href="yin_8c_source.html">yin.c</a>.</p> </div><hr/><h2>Function Documentation</h2> <a class="anchor" id="a5d4ceba1aed1fcc8e10f6408a271b294"></a><!-- doxytag: member="yin.c::yin_read" ref="a5d4ceba1aed1fcc8e10f6408a271b294" args="(yin_t *pe, uint16 *out_period, uint16 *out_bestdiff)" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">int yin_read </td> <td>(</td> <td class="paramtype"><a class="el" href="structyin__s.html">yin_t</a> * </td> <td class="paramname"><em>pe</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">uint16 * </td> <td class="paramname"><em>out_period</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">uint16 * </td> <td class="paramname"><em>out_bestdiff</em> </td> </tr> <tr> <td></td> <td>)</td> <td></td><td></td> </tr> </table> </div> <div class="memdoc"> <p>Read a raw estimated pitch value from the pitch estimator. </p> <dl><dt><b>Parameters:</b></dt><dd> <table class="params"> <tr><td class="paramname">pe</td><td>Pitch estimator. </td></tr> <tr><td class="paramname">out_period</td><td>Output: an estimate of the period (*not* the pitch) of the signal in samples. </td></tr> <tr><td class="paramname">out_bestdiff</td><td>Output: the minimum normalized difference value associated with <code>*out_pitch</code>, in Q15 format (i.e. scaled by 32768). This can be interpreted as one minus the probability of voicing. </td></tr> </table> </dd> </dl> <dl class="return"><dt><b>Returns:</b></dt><dd>Non-zero if enough data was avaliable to return a pitch estimate, zero otherwise. </dd></dl> <p>Definition at line <a class="el" href="yin_8c_source.html#l00221">221</a> of file <a class="el" href="yin_8c_source.html">yin.c</a>.</p> <p>References <a class="el" href="yin_8c_source.html#l00061">yin_s::diff_window</a>, <a class="el" href="yin_8c_source.html#l00059">yin_s::endut</a>, <a class="el" href="yin_8c_source.html#l00054">yin_s::nfr</a>, <a class="el" href="yin_8c_source.html#l00062">yin_s::period_window</a>, <a class="el" href="yin_8c_source.html#l00053">yin_s::search_range</a>, <a class="el" href="yin_8c_source.html#l00052">yin_s::search_threshold</a>, <a class="el" href="yin_8c_source.html#l00058">yin_s::wcur</a>, <a class="el" href="yin_8c_source.html#l00056">yin_s::wsize</a>, and <a class="el" href="yin_8c_source.html#l00057">yin_s::wstart</a>.</p> </div> </div> <a class="anchor" id="ae272b1d9ce8ad45f69eb8b5f98f305b6"></a><!-- doxytag: member="yin.c::yin_write" ref="ae272b1d9ce8ad45f69eb8b5f98f305b6" args="(yin_t *pe, int16 const *frame)" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">void yin_write </td> <td>(</td> <td class="paramtype"><a class="el" href="structyin__s.html">yin_t</a> * </td> <td class="paramname"><em>pe</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">int16 const * </td> <td class="paramname"><em>frame</em> </td> </tr> <tr> <td></td> <td>)</td> <td></td><td></td> </tr> </table> </div> <div class="memdoc"> <p>Feed a frame of data to the pitch estimator. </p> <dl><dt><b>Parameters:</b></dt><dd> <table class="params"> <tr><td class="paramname">pe</td><td>Pitch estimator. </td></tr> <tr><td class="paramname">frame</td><td>Frame of <code>frame_size</code> (see <a class="el" href="yin_8h.html#afc3a955f8d2215ed3d660737643c4f32" title="Initialize moving-window pitch estimation.">yin_init()</a>) samples of audio data. </td></tr> </table> </dd> </dl> <p>Definition at line <a class="el" href="yin_8c_source.html#l00194">194</a> of file <a class="el" href="yin_8c_source.html">yin.c</a>.</p> <p>References <a class="el" href="yin_8c_source.html#l00061">yin_s::diff_window</a>, <a class="el" href="yin_8c_source.html#l00054">yin_s::nfr</a>, <a class="el" href="yin_8c_source.html#l00062">yin_s::period_window</a>, <a class="el" href="yin_8c_source.html#l00052">yin_s::search_threshold</a>, <a class="el" href="yin_8c_source.html#l00056">yin_s::wsize</a>, and <a class="el" href="yin_8c_source.html#l00057">yin_s::wstart</a>.</p> </div> </div> </div> </div> <div id="nav-path" class="navpath"> <ul> <li class="navelem"><a class="el" href="yin_8c.html">yin.c</a> </li> <li class="footer">Generated on Tue Apr 19 2011 for SphinxBase by  <a href="http://www.doxygen.org/index.html"> <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.3 </li> </ul> </div> </body> </html>