42 using namespace Nsound;
49 #define THIS_FILE "FilterParametricEqualizer_UnitTest.cc"
84 static const std::string titles[3] =
86 "Testing Peaking filter ...",
87 "Testing Low Shelf filter ...",
88 "Testing High Shelf filter ..."
91 static const std::string types[3] =
98 static const std::string gold_filenames[3] =
100 "gold/FilterParametricEqualizer_out_peaking.wav",
101 "gold/FilterParametricEqualizer_out_low.wav",
102 "gold/FilterParametricEqualizer_out_high.wav"
117 noise <<
"gold/Filter_noise.wav";
118 noise <<
"gold/Filter_noise.wav";
120 for(
int i = 0; i < 3; ++i)
124 data = filters[i]->
filter(noise, freqs);
129 gold =
Buffer(gold_filenames[i]);
137 <<
"Output did not match gold file!"
140 diff.
plot(
"data - gold");
Implementation of Zoelzer's parametric equalizer filters, with some modifications by the author...
static void show()
Acutally draw the plots to the screen.
void FilterParametricEqualizer_UnitTest()
void plot(const std::string &title="Buffer") const
Requires matplotlib. Creates a plot of this Buffer.
#define TEST_ERROR_HEADER
AudioStream filter(const AudioStream &x)
static void setIEEEFloat(boolean flag)
void abs()
Modifies the Buffer by making any negative value positive.
A Buffer for storing audio samples.
static void setDefaultSampleSize(uint32 size)
Buffer drawLine(const float64 &duration, const float64 &litude_start, const float64 &litude_finish) const
This method draws a linear line beteween 2 points.
float64 getMax() const
Returns the maximum sample value in the Buffer.