61 op.
I(
"frame_order"), op.
present(
"slow_fft"));
65 cout <<
"no scaling\n";
73 op.
set(
"sp_range", 1.0);
76 op.
set(
"sp_wcut", 1.0);
79 op.
set(
"sp_bcut", 0.0);
112 float mag = (float)range / (
float)(bcut - wcut);
117 if (v > range) v = range;
118 if (v < 0.0) v = 0.0;
129 int frame_length = (
int) (length * (
float) sig.
sample_rate() +0.5);
135 if (frame_length > order)
137 EST_warning(
"frame_length reduced to %f (%d samples) to fit order\n",
154 make_window(frame_length, window_vals,-1);
156 for (
int k = 0 ; k < num_frames ; k++)
158 int pos = frame_shift * k;
159 int window_start = pos - frame_length/2;
176 fprintf(stderr,
"FFT Failed for frame %d\n", k);
177 for (
int i = 0; i < order /2; ++i)
A class for storing digital waveforms. The waveform is stored as an array of 16 bit shorts...
static Func * creator(const char *name, bool report_error=false)
Return the creation function for the given window type.
static void window_signal(const EST_Wave &sig, EST_WindowFunc *make_window, int start, int size, EST_TBuffer< float > &frame)
void raw_spectrogram(EST_Track &sp, EST_Wave &sig, float length, float shift, int order, bool slow)
Compute the power-spectrogram.
A vector class for floating point numbers. EST_FVector x should be used instead of float *x wherever ...
int num_channels() const
return number of channels in track
ssize_t num_samples() const
return the number of samples in the waveform
void set(const EST_String &name, int ival)
void resize(ssize_t num_frames, int num_channels, bool preserve=1)
float & a_no_check(ssize_t i, int c=0)
float max(float a, float b)
float min(float a, float b)
int present(const EST_String &name) const
void scale_spectrogram(EST_Track &sp, float range, float wcut, float bcut)
Manipulate the spectrogram to.
ssize_t num_frames() const
return number of frames in track
void EST_WindowFunc(int size, EST_TBuffer< float > &r_window, int window_centre)
Function which creates a window.
void EST_pre_emphasis(EST_Wave &signal, EST_Wave &psignal, float a)
Pre process to emphasise higher frequencies.
void copy_frame_in(int n, const float *buf, int offset=0, int num=EST_ALL)
int sample_rate() const
return the sampling rate (frequency)
void make_spectrogram(EST_Wave &sig, EST_Track &sp, EST_Features &op)
int I(const EST_String &path) const
void empty()
Fill vector with default value.
void fill_time(float t, int start=1)
float F(const EST_String &path) const