source: src/spectral/phasevoc.h @ 8bfef30

feature/autosinkfeature/cnnfeature/crepefeature/crepe_orgfeature/timestretchfix/ffmpeg5
Last change on this file since 8bfef30 was e302bb4, checked in by Paul Brossier <piem@piem.org>, 6 years ago

[pvoc] add missing aubio_pvoc_get_hop/win

  • Property mode set to 100644
File size: 3.0 KB
RevLine 
[96fb8ad]1/*
[b235c0e]2  Copyright (C) 2003-2013 Paul Brossier <piem@aubio.org>
[96fb8ad]3
[e6a78ea]4  This file is part of aubio.
[96fb8ad]5
[e6a78ea]6  aubio is free software: you can redistribute it and/or modify
7  it under the terms of the GNU General Public License as published by
8  the Free Software Foundation, either version 3 of the License, or
9  (at your option) any later version.
[96fb8ad]10
[e6a78ea]11  aubio is distributed in the hope that it will be useful,
12  but WITHOUT ANY WARRANTY; without even the implied warranty of
13  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14  GNU General Public License for more details.
15
16  You should have received a copy of the GNU General Public License
17  along with aubio.  If not, see <http://www.gnu.org/licenses/>.
[96fb8ad]18
19*/
20
[7011e8a]21/** \file
22
23  Phase vocoder object
24
25  This object implements a phase vocoder. The spectral frames are computed
26  using a HanningZ window and a swapped version of the signal to simplify the
27  phase relationships across frames. The window sizes and overlap are specified
[d95ff38]28  at creation time.
[7011e8a]29
[b8c0685]30  \example spectral/test-phasevoc.c
31
[7011e8a]32*/
[96fb8ad]33
[6f42c16]34#ifndef AUBIO_PHASEVOC_H
35#define AUBIO_PHASEVOC_H
[96fb8ad]36
37#ifdef __cplusplus
38extern "C" {
39#endif
40
41/** phasevocoder object */
42typedef struct _aubio_pvoc_t aubio_pvoc_t;
43
[7011e8a]44/** create phase vocoder object
45
46  \param win_s size of analysis buffer (and length the FFT transform)
47  \param hop_s step size between two consecutive analysis
48
49*/
[d95ff38]50aubio_pvoc_t * new_aubio_pvoc (uint_t win_s, uint_t hop_s);
[7011e8a]51/** delete phase vocoder object
52
53  \param pv phase vocoder object as returned by new_aubio_pvoc
54
55*/
[96fb8ad]56void del_aubio_pvoc(aubio_pvoc_t *pv);
57
[7011e8a]58/** compute spectral frame
[a82cedc]59
[d95ff38]60  This function accepts an input vector of size [hop_s]. The
[7011e8a]61  analysis buffer is rotated and filled with the new data. After windowing of
62  this signal window, the Fourier transform is computed and returned in
63  fftgrain as two vectors, magnitude and phase.
64
65  \param pv phase vocoder object as returned by new_aubio_pvoc
[a82cedc]66  \param in new input signal (hop_s long)
[7011e8a]67  \param fftgrain output spectral frame
68
69*/
[feb694b]70void aubio_pvoc_do(aubio_pvoc_t *pv, const fvec_t *in, cvec_t * fftgrain);
[7011e8a]71/** compute signal from spectral frame
72
73  This function takes an input spectral frame fftgrain of size
[d95ff38]74  [buf_s] and computes its inverse Fourier transform. Overlap-add
[7011e8a]75  synthesis is then computed using the previously synthetised frames, and the
76  output stored in out.
[a82cedc]77
[7011e8a]78  \param pv phase vocoder object as returned by new_aubio_pvoc
79  \param fftgrain input spectral frame
[a82cedc]80  \param out output signal (hop_s long)
[7011e8a]81
82*/
[96fb8ad]83void aubio_pvoc_rdo(aubio_pvoc_t *pv, cvec_t * fftgrain, fvec_t *out);
84
[7011e8a]85/** get window size
86
87  \param pv phase vocoder to get the window size from
88
89*/
[96fb8ad]90uint_t aubio_pvoc_get_win(aubio_pvoc_t* pv);
[e302bb4]91
[7011e8a]92/** get hop size
93
94  \param pv phase vocoder to get the hop size from
95
96*/
[96fb8ad]97uint_t aubio_pvoc_get_hop(aubio_pvoc_t* pv);
98
[82f0effd]99/** set window type
100
101  \param pv phase vocoder to set the window type
102  \param window_type a string representing a window
103
104  \return 0 if successful, non-zero otherwise
105
106 */
107uint_t aubio_pvoc_set_window(aubio_pvoc_t *pv, const char_t *window_type);
108
[96fb8ad]109#ifdef __cplusplus
110}
[a82cedc]111#endif
[96fb8ad]112
[6f42c16]113#endif /* AUBIO_PHASEVOC_H */
Note: See TracBrowser for help on using the repository browser.