Nsound  0.9.4
FilterBandPassVocoder.h
Go to the documentation of this file.
1 //-----------------------------------------------------------------------------
2 //
3 // $Id: FilterBandPassVocoder.h 874 2014-09-08 02:21:29Z weegreenblobbie $
4 //
5 // Nsound is a C++ library and Python module for audio synthesis featuring
6 // dynamic digital filters. Nsound lets you easily shape waveforms and write
7 // to disk or plot them. Nsound aims to be as powerful as Csound but easy to
8 // use.
9 //
10 // Copyright (c) 2009 - Present Nick Hilton
11 //
12 // weegreenblobbie_yahoo_com (replace '_' with '@' and '.')
13 //
14 // This Band Pass Filter is based on the band pass filter found in
15 // Achim Settelmeier's vocoder implementation.
16 //
17 // See http://www.sirlab.de/linux/descr_vocoder.html for more details.
18 //
19 //-----------------------------------------------------------------------------
20 
21 //-----------------------------------------------------------------------------
22 //
23 // This program is free software; you can redistribute it and/or modify
24 // it under the terms of the GNU General Public License as published by
25 // the Free Software Foundation; either version 2 of the License, or
26 // (at your option) any later version.
27 //
28 // This program is distributed in the hope that it will be useful,
29 // but WITHOUT ANY WARRANTY; without even the implied warranty of
30 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
31 // GNU Library General Public License for more details.
32 //
33 // You should have received a copy of the GNU General Public License
34 // along with this program; if not, write to the Free Software
35 // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
36 //
37 //-----------------------------------------------------------------------------
38 #ifndef _NSOUND_FILTER_BAND_PASS_VOCODER_H_
39 #define _NSOUND_FILTER_BAND_PASS_VOCODER_H_
40 
41 #include <Nsound/Filter.h>
42 
43 #include <set>
44 
45 namespace Nsound
46 {
47 
48 class AudioStream;
49 class Buffer;
50 
51 //-----------------------------------------------------------------------------
53 {
54  public:
55 
57  const float64 & sample_rate,
58  const float64 & frequency_low,
59  const float64 & frequency_high);
60 
61  virtual ~FilterBandPassVocoder();
62 
64  filter(const AudioStream & x);
65 
67  filter(const AudioStream & x, const Buffer & frequencies);
68 
70  filter(
71  const AudioStream & x,
72  const Buffer & low_frequencies,
73  const Buffer & high_frequencies);
74 
75  Buffer
76  filter(const Buffer & x);
77 
78  Buffer
79  filter(const Buffer & x, const Buffer & frequencies);
80 
81  Buffer
82  filter(
83  const Buffer & x,
84  const Buffer & frequencies_Hz_low,
85  const Buffer & frequencies_Hz_high);
86 
87  virtual
88  float64
89  filter(const float64 & x);
90 
91  virtual
92  float64
93  filter(const float64 & x, const float64 & frequency_Hz);
94 
95  virtual
96  float64
97  filter(
98  const float64 & x,
99  const float64 & frequency_Hz_low,
100  const float64 & frequency_Hz_high);
101 
102  void
103  plot(boolean show_fc = true, boolean show_phase = false);
104 
107  void
108  reset();
109 
110  protected:
111 
112  void
113  makeKernel(const float64 & f_low, const float64 & f_high);
114 
126 
127  private:
128 
130 
132  operator=(const FilterBandPassVocoder & rhs);
133 
134 }; // class FilterBandPassIIR
135 
136 } // namespace Nsound
137 
138 // :mode=c++: jEdit modeline
139 #endif
FilterBandPassVocoder(const float64 &sample_rate, const float64 &frequency_low, const float64 &frequency_high)
void plot(boolean show_fc=true, boolean show_phase=false)
double float64
Definition: Nsound.h:146
AudioStream filter(const AudioStream &x)
Base class for IIR Filters, defines the interface.
Definition: Filter.h:49
A Buffer for storing audio samples.
Definition: Buffer.h:60
void makeKernel(const float64 &f_low, const float64 &f_high)
FilterBandPassVocoder & operator=(const FilterBandPassVocoder &rhs)