46 static void short_set(
EST_Wave &to,
int ch,
51 to.
a_no_check(i,ch) = irint(from(i)/maxval*10000);
62 for(
int i=0; i<num_samples; i++)
64 fpdata[i] = signal.
a(i) - a*last;
66 if (absval(fpdata[i]) > maxval)
67 maxval = absval(fpdata[i]);
72 short_set(psignal, 0, fpdata, maxval);
83 for(
int i=0; i<num_samples; i++)
85 fddata[i] = signal.
a(i) + a*last;
87 if (absval(fddata[i]) > maxval)
88 maxval = absval(fddata[i]);
93 short_set(dsignal, 0, fddata, maxval);
A class for storing digital waveforms. The waveform is stored as an array of 16 bit shorts...
void set_sample_rate(const int n)
Set sampling rate to n
void EST_pre_emphasis(EST_Wave &signal, EST_Wave &psignal, float a)
Pre process to emphasise higher frequencies.
ssize_t num_samples() const
return the number of samples in the waveform
short & a(ssize_t i, ssize_t channel=0)
INLINE short & a_no_check(ssize_t i, ssize_t channel=0)
void resize(int num_samples, int num_channels=EST_ALL, int set=1)
resize the waveform
int sample_rate() const
return the sampling rate (frequency)
void EST_post_deemphasis(EST_Wave &signal, EST_Wave &dsignal, float a)
Post process to get the original back (eg after resynthesis).