Default Constructor.
sample_rate: the sample rate window_length: the length of a window to average for the voice envelope n_bands: the number of band pass filters to use freq_max: the maximum frequency, band pass filters divide up the frequency range from 0 to freq_max
116 freq_centers << (i + 1) * band_width;
120 freq_centers -= band_width / 2.0;
125 for(
uint32 i = 0; i < freq_centers.getLength(); ++i)
127 freq_centers[i] =
mel_to_f(freq_centers[i]);
137 float64 freq = freq_centers[i];
145 f_lo = (freq + freq_centers[i - 1]) / 2.0;
152 f_hi = (freq + freq_centers[i + 1]) / 2.0;
200 pylab.
ylim(-40.0, 10.0);
201 pylab.
xlabel(
"Frequency (Hz)");
202 pylab.
ylabel(
"Filter Frequency Response (dB)");
void xlabel(const std::string &label, const std::string &kwargs="")
Add a label x axis.
void grid(boolean flag)
Sets the grid state.
#define M_ASSERT_VALUE(a, op, value)
void plot(const Buffer &y, const std::string &fmt="", const std::string &kwargs="")
Plots the Buffer on the current figure.
void figure(const std::string &kwargs="") const
Creates a new figure window to plot in.
static float64 mel_to_f(float64 m)
void xlim(const float64 &xmin, const float64 &xmax)
Sets the limit for the x & y axis.
void ylim(const float64 &ymin, const float64 &ymax)
FilterVector filters_input_
void hold(boolean flag)
Sets the hold state.
FilterVector filters_output_
static float64 f_to_mel(float64 f)
void ylabel(const std::string &label, const std::string &kwargs="")
Add a label y axis.
A Buffer for storing audio samples.
FilterVector moving_average_