Nsound
0.9.4
Main Page
Namespaces
Classes
Files
File List
File Members
Nsound
Vocoder.h
Go to the documentation of this file.
1
//-----------------------------------------------------------------------------
2
//
3
// $Id: Vocoder.h 874 2014-09-08 02:21:29Z weegreenblobbie $
4
//
5
// Copyright (c) 2008 to Present Nick Hilton
6
//
7
// weegreenblobbie_yahoo_com (replace '_' with '@' and '.')
8
//
9
//-----------------------------------------------------------------------------
10
11
//-----------------------------------------------------------------------------
12
//
13
// This program is free software; you can redistribute it and/or modify
14
// it under the terms of the GNU General Public License as published by
15
// the Free Software Foundation; either version 2 of the License, or
16
// (at your option) any later version.
17
//
18
// This program is distributed in the hope that it will be useful,
19
// but WITHOUT ANY WARRANTY; without even the implied warranty of
20
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21
// GNU Library General Public License for more details.
22
//
23
// You should have received a copy of the GNU General Public License
24
// along with this program; if not, write to the Free Software
25
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
26
//
27
//-----------------------------------------------------------------------------
28
#ifndef _NSOUND_VOCODER_H_
29
#define _NSOUND_VOCODER_H_
30
31
#include <
Nsound/Buffer.h
>
32
33
#include <vector>
34
35
namespace
Nsound
36
{
37
38
class
AudioStream;
39
class
Buffer;
40
class
Filter;
41
class
FilterMovingAverage;
42
43
//-----------------------------------------------------------------------------
44
class
Vocoder
45
{
46
public
:
47
49
//
55
Vocoder
(
56
const
float64
& sample_rate,
57
const
float64
& window_length,
58
const
uint32
& n_bands,
59
const
float64
& freq_max = 4000.0,
60
const
bool
use_mel_scale =
true
,
61
const
bool
plot_filter_bank =
false
);
62
63
virtual
~Vocoder
();
64
65
Buffer
66
filter
(
const
Buffer
& voice,
const
Buffer
& carrier);
67
68
float64
69
filter
(
const
float64
& voice,
const
float64
& carrier);
70
71
float64
72
getSampleRate
()
const
{
return
sample_rate_
; };
73
74
void
75
reset
();
76
77
protected
:
78
79
float64
sample_rate_
;
80
uint32
window_size_
;
81
uint32
n_bands_
;
82
float64
freq_max_
;
83
84
typedef
std::vector< Filter * >
FilterVector
;
85
86
FilterVector
filters_input_
;
87
FilterVector
filters_output_
;
88
FilterVector
moving_average_
;
89
90
};
91
92
}
// namespace
93
94
// :mode=c++: jEdit modeline
95
#endif
Nsound::uint32
unsigned int uint32
Definition:
Nsound.h:153
Nsound::Vocoder::n_bands_
uint32 n_bands_
Definition:
Vocoder.h:81
Nsound::float64
double float64
Definition:
Nsound.h:146
Nsound::Vocoder::FilterVector
std::vector< Filter * > FilterVector
Definition:
Vocoder.h:84
Nsound::Vocoder::getSampleRate
float64 getSampleRate() const
Definition:
Vocoder.h:72
Nsound::Vocoder::window_size_
uint32 window_size_
Definition:
Vocoder.h:80
Nsound::Vocoder
Definition:
Vocoder.h:44
Nsound::Vocoder::~Vocoder
virtual ~Vocoder()
Definition:
Vocoder.cc:212
Nsound::Vocoder::reset
void reset()
Definition:
Vocoder.cc:286
Nsound::Vocoder::filters_input_
FilterVector filters_input_
Definition:
Vocoder.h:86
Nsound::Vocoder::filters_output_
FilterVector filters_output_
Definition:
Vocoder.h:87
Nsound::Vocoder::freq_max_
float64 freq_max_
Definition:
Vocoder.h:82
Nsound::Vocoder::sample_rate_
float64 sample_rate_
Definition:
Vocoder.h:79
Nsound::Buffer
A Buffer for storing audio samples.
Definition:
Buffer.h:60
Nsound::Vocoder::moving_average_
FilterVector moving_average_
Definition:
Vocoder.h:88
Buffer.h
Nsound::Vocoder::Vocoder
Vocoder(const float64 &sample_rate, const float64 &window_length, const uint32 &n_bands, const float64 &freq_max=4000.0, const bool use_mel_scale=true, const bool plot_filter_bank=false)
Default Constructor.
Definition:
Vocoder.cc:69
Nsound::Vocoder::filter
Buffer filter(const Buffer &voice, const Buffer &carrier)
Definition:
Vocoder.cc:234
Generated on Sun Aug 23 2015 11:51:50 for Nsound by
1.8.6