SphinxBase 5prealpha
yin.h
Go to the documentation of this file.
1/* -*- c-basic-offset: 4; indent-tabs-mode: nil -*- */
2/*
3 * Copyright (c) 2008 Beyond Access, Inc. All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 *
9 * 1. Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer.
11 *
12 * 2. Redistributions in binary form must reproduce the above copyright
13 * notice, this list of conditions and the following disclaimer in
14 * the documentation and/or other materials provided with the
15 * distribution.
16 *
17 * THIS SOFTWARE IS PROVIDED BY BEYOND ACCESS, INC. ``AS IS'' AND ANY
18 * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
19 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
20 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BEYOND ACCESS, INC. NOR
21 * ITS EMPLOYEES BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
22 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
23 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
24 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
25 * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
26 * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
27 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28 */
29
42#ifndef __YIN_H__
43#define __YIN_H__
44
45#ifdef __cplusplus
46extern "C"
47#endif
48#if 0
49} /* Fool Emacs. */
50#endif
51
52/* Win32/WinCE DLL gunk */
53#include <sphinxbase/sphinxbase_export.h>
55
59typedef struct yin_s yin_t;
60
64SPHINXBASE_EXPORT
65yin_t *yin_init(int frame_size, float search_threshold,
66 float search_range, int smooth_window);
67
71SPHINXBASE_EXPORT
72void yin_free(yin_t *pe);
73
77SPHINXBASE_EXPORT
78void yin_start(yin_t *pe);
79
83SPHINXBASE_EXPORT
84void yin_end(yin_t *pe);
85
93SPHINXBASE_EXPORT
94void yin_write(yin_t *pe, int16 const *frame);
95
109SPHINXBASE_EXPORT
110int yin_read(yin_t *pe, uint16 *out_period, uint16 *out_bestdiff);
111
112#ifdef __cplusplus
113}
114#endif
115
116#endif /* __YIN_H__ */
Basic type definitions used in Sphinx.
Definition yin.c:51
uint16 search_range
Range around best local estimate to search, in Q15.
Definition yin.c:54
uint16 search_threshold
Size of analysis frame.
Definition yin.c:53
SPHINXBASE_EXPORT int yin_read(yin_t *pe, uint16 *out_period, uint16 *out_bestdiff)
Read a raw estimated pitch value from the pitch estimator.
Definition yin.c:222
SPHINXBASE_EXPORT void yin_end(yin_t *pe)
Mark the end of an utterance.
Definition yin.c:166
SPHINXBASE_EXPORT yin_t * yin_init(int frame_size, float search_threshold, float search_range, int smooth_window)
Initialize moving-window pitch estimation.
Definition yin.c:131
SPHINXBASE_EXPORT void yin_start(yin_t *pe)
Start processing an utterance.
Definition yin.c:158
SPHINXBASE_EXPORT void yin_write(yin_t *pe, int16 const *frame)
Feed a frame of data to the pitch estimator.
Definition yin.c:195
SPHINXBASE_EXPORT void yin_free(yin_t *pe)
Free a moving-window pitch estimator.
Definition yin.c:150