51 Sine sine(SAMPLE_RATE);
53 Buffer input = sine.generate(2.0, 4000.0)
54 + sine.generate(2.0, 8000.0)
55 + sine.generate(2.0, 12000.0);
61 <<
"FFTransform::fft(), FFTransform::ifft() ... " << flush;
66 Buffer ifft = fft.ifft(vec);
68 Buffer diff = input - ifft;
72 if(diff.
getMax() > 0.00005)
75 <<
"fft() - ifft() > 0.00005, max(diff) = "
81 cout <<
Toc() <<
" seconds: SUCCESS" << endl;
98 <<
"Plotting Frequecy Responses of Filters ... " << flush;
103 pylab.
xlim(0, fh * 2);
107 pylab.
xlim(0, fh * 2);
111 pylab.
xlim(0,fh * 2);
115 pylab.
xlim(0,fh * 2);
119 pylab.
xlim(0,fh * 2);
123 pylab.
xlim(0,fh * 2);
127 pylab.
xlim(0,fh * 2);
131 pylab.
xlim(0,fh * 2);
134 cout <<
Toc() <<
" seconds" << endl << flush;
void plot(const Buffer &y, const std::string &fmt="", const std::string &kwargs="")
Plots the Buffer on the current figure.
void xlim(const float64 &xmin, const float64 &xmax)
Sets the limit for the x & y axis.
A class for filtering audio in the frequecy domain.
#define TEST_ERROR_HEADER
void ylim(const float64 &ymin, const float64 &ymax)
A class for filtering audio in the frequecy domain.
void abs()
Modifies the Buffer by making any negative value positive.
A Buffer for storing audio samples.
float64 getMax() const
Returns the maximum sample value in the Buffer.
std::vector< FFTChunk > FFTChunkVector