35 using namespace Nsound;
43 int main(
int argc,
char ** argv)
52 input = sin.
generate(5.0, frequency_sweep);
54 input >>
"filters_input.wav";
56 Buffer low_freqs = 200.0 * sin.
generate(5.0, 1.0) + frequency_sweep;
58 Buffer high_freqs = 200.0 + low_freqs;
61 <<
"testing FilterLowPassFIR ... " << flush;
69 cout <<
Toc() <<
" seconds"
72 output >>
"filters_fir_low_pass.wav";
75 <<
"testing FilterLowPassIIR ... " << flush;
83 cout <<
Toc() <<
" seconds"
86 output >>
"filters_iir_low_pass.wav";
89 <<
"testing FilterLowPassFIR dynamic filtering... " << flush;
93 output = f1.
filter(input, low_freqs);
95 cout <<
Toc() <<
" seconds"
98 output >>
"filters_fir_low_pass_dynamic.wav";
101 <<
"testing FilterLowPassIIR dynamic filtering... " << flush;
105 output = f2.
filter(input, low_freqs);
107 cout <<
Toc() <<
" seconds"
110 output >>
"filters_iir_low_pass_dynamic.wav";
113 <<
"testing FilterHighPassFIR ... " << flush;
118 output = f3.
filter(input);
120 cout <<
Toc() <<
" seconds"
123 output >>
"filters_fir_high_pass.wav";
126 <<
"testing FilterHighPassIIR ... " << flush;
131 output = f4.
filter(input);
133 cout <<
Toc() <<
" seconds"
136 output >>
"filters_iir_high_pass.wav";
139 <<
"testing FilterHighPassFIR dynamic filtering... " << flush;
142 output = f3.
filter(input, high_freqs);
144 cout <<
Toc() <<
" seconds"
147 output >>
"filters_fir_high_pass_dynamic.wav";
150 <<
"testing FilterHighPassIIR dynamic filtering... " << flush;
153 output = f4.
filter(input, high_freqs);
155 cout <<
Toc() <<
" seconds"
158 output >>
"filters_iir_high_pass_dynamic.wav";
161 <<
"testing FilterBandRejectFIR ... " << flush;
166 output = f5.
filter(input);
168 cout <<
Toc() <<
" seconds"
171 output >>
"filters_fir_band_reject.wav";
174 <<
"testing FilterBandRejectIIR ... " << flush;
179 output = f6.
filter(input);
181 cout <<
Toc() <<
" seconds"
184 output >>
"filters_iir_band_reject.wav";
187 <<
"testing FilterBandRejectFIR dynamic filtering... " << flush;
191 output = f5.
filter(input, low_freqs, high_freqs);
193 cout <<
Toc() <<
" seconds"
196 output >>
"filters_fir_band_reject_dynamic.wav";
199 <<
"testing FilterBandRejectIIR dynamic filtering... " << flush;
203 output = f6.
filter(input, low_freqs, high_freqs);
205 cout <<
Toc() <<
" seconds"
208 output >>
"filters_iir_band_reject_dynamic.wav";
211 <<
"testing FilterBandPassFIR ... " << flush;
216 output = f7.
filter(input);
218 cout <<
Toc() <<
" seconds"
221 output >>
"filters_fir_band_pass.wav";
224 <<
"testing FilterBandPassIIR ... " << flush;
229 output = f8.
filter(input);
231 cout <<
Toc() <<
" seconds"
234 output >>
"filters_iir_band_pass.wav";
237 <<
"testing FilterBandPassFIR dynamic filtering... " << flush;
240 output = f7.
filter(input, low_freqs, high_freqs);
242 cout <<
Toc() <<
" seconds"
245 output >>
"filters_fir_band_pass_dynamic.wav";
248 <<
"testing FilterBandPassIIR dynamic filtering... " << flush;
251 output = f8.
filter(input, low_freqs, high_freqs);
253 cout <<
Toc() <<
" seconds"
256 output >>
"filters_iir_band_pass_dynamic.wav";
AudioStream filter(const AudioStream &x)
AudioStream filter(const AudioStream &x)
int main(int argc, char **argv)
AudioStream filter(const AudioStream &x)
A class for filtering audio in the frequecy domain.
virtual float64 generate(const float64 &frequency)
This is a real-time method for the wavetable oscillator.
A class for filtering audio in the frequecy domain.
AudioStream filter(const AudioStream &x)
A Buffer for storing audio samples.
AudioStream filter(const AudioStream &x)
static const char * THIS_FILE
AudioStream filter(const AudioStream &x)
AudioStream filter(const AudioStream &x)
Buffer drawLine(const float64 &duration, const float64 &litude_start, const float64 &litude_finish) const
This method draws a linear line beteween 2 points.
AudioStream filter(const AudioStream &x)