yin.h
Go to the documentation of this file.
/* -*- c-basic-offset: 4; indent-tabs-mode: nil -*- */
/*
* Copyright (c) 2008 Beyond Access, Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
*
* THIS SOFTWARE IS PROVIDED BY BEYOND ACCESS, INC. ``AS IS'' AND ANY
* EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BEYOND ACCESS, INC. NOR
* ITS EMPLOYEES BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef __YIN_H__
#define __YIN_H__
#ifdef __cplusplus
extern "C"
#endif
#if 0
} /* Fool Emacs. */
#endif
/* Win32/WinCE DLL gunk */
#include <sphinxbase/sphinxbase_export.h>
#include <sphinxbase/prim_type.h>
typedef struct yin_s yin_t;
SPHINXBASE_EXPORT
yin_t *yin_init(int frame_size, float search_threshold,
float search_range, int smooth_window);
SPHINXBASE_EXPORT
void yin_free(yin_t *pe);
SPHINXBASE_EXPORT
void yin_start(yin_t *pe);
SPHINXBASE_EXPORT
void yin_end(yin_t *pe);
SPHINXBASE_EXPORT
void yin_write(yin_t *pe, int16 const *frame);
SPHINXBASE_EXPORT
int yin_read(yin_t *pe, uint16 *out_period, uint16 *out_bestdiff);
#ifdef __cplusplus
}
#endif
#endif /* __YIN_H__ */
prim_type.h
Basic type definitions used in Sphinx.
yin_s
Definition yin.c:51
yin_s::search_range
uint16 search_range
Range around best local estimate to search, in Q15.
Definition yin.c:54
yin_s::search_threshold
uint16 search_threshold
Size of analysis frame.
Definition yin.c:53
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.
Definition yin.c:222
yin_t
struct yin_s yin_t
Frame-based moving-window pitch estimator.
Definition yin.h:59
yin_end
SPHINXBASE_EXPORT void yin_end(yin_t *pe)
Mark the end of an utterance.
Definition yin.c:166
yin_init
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
yin_start
SPHINXBASE_EXPORT void yin_start(yin_t *pe)
Start processing an utterance.
Definition yin.c:158
yin_write
SPHINXBASE_EXPORT void yin_write(yin_t *pe, int16 const *frame)
Feed a frame of data to the pitch estimator.
Definition yin.c:195
yin_free
SPHINXBASE_EXPORT void yin_free(yin_t *pe)
Free a moving-window pitch estimator.
Definition yin.c:150