Nsound  0.9.4
FilterBandRejectIIR.h
Go to the documentation of this file.
1 //-----------------------------------------------------------------------------
2 //
3 // $Id: FilterBandRejectIIR.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) 2006 - Present Nick Hilton
11 //
12 // weegreenblobbie_yahoo_com (replace '_' with '@' and '.')
13 //
14 //-----------------------------------------------------------------------------
15 
16 //-----------------------------------------------------------------------------
17 //
18 // This program is free software; you can redistribute it and/or modify
19 // it under the terms of the GNU General Public License as published by
20 // the Free Software Foundation; either version 2 of the License, or
21 // (at your option) any later version.
22 //
23 // This program is distributed in the hope that it will be useful,
24 // but WITHOUT ANY WARRANTY; without even the implied warranty of
25 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
26 // GNU Library General Public License for more details.
27 //
28 // You should have received a copy of the GNU General Public License
29 // along with this program; if not, write to the Free Software
30 // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
31 //
32 //-----------------------------------------------------------------------------
33 #ifndef _NSOUND_FILTER_BAND_REJECT_IIR_H_
34 #define _NSOUND_FILTER_BAND_REJECT_IIR_H_
35 
36 #include <Nsound/Filter.h>
37 
38 #include <set>
39 
40 namespace Nsound
41 {
42 
43 class AudioStream;
44 class Buffer;
45 class FilterLowPassIIR;
46 class FilterHighPassIIR;
47 
48 //-----------------------------------------------------------------------------
50 {
51  public:
52 
54  const float64 & sample_rate,
55  uint32 n_poles,
56  const float64 & frequency_Hz_low,
57  const float64 & frequency_Hz_high,
58  const float64 & percent_ripple = 0.0);
59 
60  virtual ~FilterBandRejectIIR();
61 
62  float64
63  getFrequencyLow() const;
64 
65  float64
66  getFrequencyHigh() const;
67 
69  filter(const AudioStream & x);
70 
72  filter(const AudioStream & x, const float64 & f);
73 
75  filter(const AudioStream & x, const Buffer & frequencies);
76 
78  filter(
79  const AudioStream & x,
80  const float64 & f_low,
81  const float64 & f_high);
82 
84  filter(
85  const AudioStream & x,
86  const Buffer & low_frequencies,
87  const Buffer & high_frequencies);
88 
89  Buffer
90  filter(const Buffer & x);
91 
92  Buffer
93  filter(const Buffer & x, const float64 & f);
94 
95  Buffer
96  filter(const Buffer & x, const Buffer & frequencies);
97 
98  Buffer
99  filter(
100  const Buffer & x,
101  const float64 & f_low,
102  const float64 & f_high);
103 
104  Buffer
105  filter(
106  const Buffer & x,
107  const Buffer & frequencies_Hz_low,
108  const Buffer & frequencies_Hz_high);
109 
110  virtual
111  float64
112  filter(const float64 & x);
113 
114  virtual
115  float64
116  filter(const float64 & x, const float64 & frequency_Hz);
117 
118  virtual
119  float64
120  filter(
121  const float64 & x,
122  const float64 & frequency_Hz_low,
123  const float64 & frequency_Hz_high);
124 
125  void
126  plot(boolean show_fc = true, boolean show_phase = false);
127 
130  void
131  reset();
132 
133  protected:
134 
137 
138  private:
139 
141 
143  operator=(const FilterBandRejectIIR & rhs);
144 
145 }; // class FilterBandRejectIIR
146 
147 } // namespace Nsound
148 
149 // :mode=c++: jEdit modeline
150 #endif
unsigned int uint32
Definition: Nsound.h:153
double float64
Definition: Nsound.h:146
A class for filtering audio in the frequecy domain.
Base class for IIR Filters, defines the interface.
Definition: Filter.h:49
FilterBandRejectIIR(const float64 &sample_rate, uint32 n_poles, const float64 &frequency_Hz_low, const float64 &frequency_Hz_high, const float64 &percent_ripple=0.0)
A class for filtering audio in the frequecy domain.
void plot(boolean show_fc=true, boolean show_phase=false)
AudioStream filter(const AudioStream &x)
A Buffer for storing audio samples.
Definition: Buffer.h:60
FilterBandRejectIIR & operator=(const FilterBandRejectIIR &rhs)