Edinburgh Speech Tools  2.1-release
filter.cc
Go to the documentation of this file.
1 /*************************************************************************/
2 /* */
3 /* Centre for Speech Technology Research */
4 /* University of Edinburgh, UK */
5 /* Copyright (c) 1994,1995,1996 */
6 /* All Rights Reserved. */
7 /* */
8 /* Permission is hereby granted, free of charge, to use and distribute */
9 /* this software and its documentation without restriction, including */
10 /* without limitation the rights to use, copy, modify, merge, publish, */
11 /* distribute, sublicense, and/or sell copies of this work, and to */
12 /* permit persons to whom this work is furnished to do so, subject to */
13 /* the following conditions: */
14 /* 1. The code must retain the above copyright notice, this list of */
15 /* conditions and the following disclaimer. */
16 /* 2. Any modifications must be clearly marked as such. */
17 /* 3. Original authors' names are not deleted. */
18 /* 4. The authors' names are not used to endorse or promote products */
19 /* derived from this software without specific prior written */
20 /* permission. */
21 /* */
22 /* THE UNIVERSITY OF EDINBURGH AND THE CONTRIBUTORS TO THIS WORK */
23 /* DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING */
24 /* ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT */
25 /* SHALL THE UNIVERSITY OF EDINBURGH NOR THE CONTRIBUTORS BE LIABLE */
26 /* FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES */
27 /* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN */
28 /* AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, */
29 /* ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF */
30 /* THIS SOFTWARE. */
31 /* */
32 /*************************************************************************/
33 /* Author : Simon King */
34 /* Date : October 1996 */
35 /*-----------------------------------------------------------------------*/
36 /* Filter functions */
37 /* */
38 /*=======================================================================*/
39 #include <cstdlib>
40 #include "EST_math.h"
41 #include "sigpr/EST_filter.h"
42 #include "sigpr/EST_fft.h"
43 #include "EST_wave_aux.h"
44 #include "EST_TBuffer.h"
45 #include "sigpr/EST_Window.h"
46 #include "EST_error.h"
47 
48 using namespace std;
49 
50 // there are multiple possible styles of this because of different
51 // possibilities of where to change the filter coefficients.
52 
54 {
55  int i, j;
56  double s;
57 
58  for (i = 0; i < sig.num_samples(); ++i)
59  {
60  s = 0;
61  for (j = 1; j < a.n(); ++j)
62  s += a(j) * (float)sig.a_safe(i - j);
63 
64  sig.a(i) = (short) s + res.a(i);
65  }
66 }
67 
69 {
70  int i, j;
71  double r;
72 
73  for (i = 0; i < a.n(); ++i)
74  {
75  r = sig.a_no_check(i);
76  for (j = 1; j < a.n(); ++j)
77  r -= a.a_no_check(j) * (float)sig.a_safe(i - j);
78  res.a(i) = (short) r;
79  }
80  for (i = a.n(); i < sig.num_samples(); ++i)
81  {
82  r = sig.a_no_check(i);
83  for (j = 1; j < a.n(); ++j)
84  r -= a.a_no_check(j) * (float)sig.a_no_check(i - j);
85  res.a(i) = (short) r;
86  }
87 }
88 
89 /*void filter(EST_FVector &in, EST_FVector &out, EST_FVector &filter)
90 {
91  double r;
92  for (int i = 0; i < in.length(); ++i)
93  {
94  r = in.a(i);
95  for (int j = 1; j < filter.length(); ++j)
96  r -= filter(j) * in.a(i - j);
97  out[i] = r;
98  }
99 }
100 */
101 
102 void inv_lpc_filter_ola(EST_Wave &in_sig, EST_Track &lpc, EST_Wave &out_sig)
103 {
104 
105  int i, j, k, start, end, size;
106  EST_FVector filter;
107  EST_FVector window_vals;
108  EST_Wave in_sub, out_sub;
109 
110  // copy attributes and size to waveform, fill with zeros.
111  out_sig.resize(in_sig.num_samples(), 1);
112  out_sig.set_sample_rate(in_sig.sample_rate());
113  out_sig.fill(0);
114 
115  for(i = 1; i < lpc.num_frames() - 1; ++i)
116  {
117  start = (int)((float)lpc.t(i - 1) * in_sig.sample_rate());
118  end = (int)((float)lpc.t(i + 1) * in_sig.sample_rate());
119  if (end > out_sig.num_samples())
120  end = out_sig.num_samples();
121  size = end - start;
122 
123  lpc.frame(filter, i);
124 
125  if (size < filter.n())
126  break; // basically a mismatch between lpc and waveform
127 
128  in_sig.sub_wave(in_sub, start, size);
129  out_sub.resize(size);
130 
131  inv_lpc_filter(in_sub, filter, out_sub);
132 
133 
134  int centreIndex = (int)(lpc.t(i) * (float)in_sig.sample_rate());
135 
136  EST_Window::make_window(window_vals, size, "hanning", centreIndex-start);
137 
138  // printf( "%d %d %d (start centre end)\n", start, centreIndex, end );
139 
140  // overlap and add using hanning window on original
141  for (k = 0, j = start; j < end; ++j, ++k){
142  out_sig.a_no_check(j) +=
143  (int)((float)out_sub.a_no_check(k) *
144  window_vals.a_no_check(k));
145  }
146  }
147 }
148 
149 void lpc_filter_1(EST_Track &lpc, EST_Wave & res, EST_Wave &sig)
150 {
151  int i, j, k;
152  int start, end;
153  EST_FVector filter;
154  float s;
155 // int order = lpc.num_channels() - 1;
156 // EST_Wave sig_sub, res_sub;
157 
158  sig.resize(res.num_samples());
159  sig.set_sample_rate(res.sample_rate());
160  sig.fill(0);
161 
162  for (start = 0, i = 0; i < lpc.num_frames() - 1; ++i)
163  {
164  end = int((lpc.t(i) + lpc.t(i + 1)) * (float)res.sample_rate()) / 2;
165  if (end > res.num_samples())
166  end = res.num_samples();
167 
168  lpc.frame(filter, i);
169 // res.sub_wave(res_sub, start, (end - start));
170 // sig.sub_wave(sig_sub, start, (end - start));
171 
172  // this should really be done by the lpc_frame filter function
173  // but it needs access to samples off the start of the frame
174  // in question.
175 
176  if (start < filter.n())
177  for (k = start; k < end; ++k)
178  {
179  for (s = 0,j = 1; j < filter.n(); ++j)
180  s += filter.a_no_check(j) * (float)sig.a_safe(k - j);
181  sig.a_no_check(k) = (short) s + res.a_no_check(k);
182  }
183  else
184  for (k = start; k < end; ++k)
185  {
186  s = 0;
187  for (j = 1; j < filter.n(); ++j)
188  s += filter.a_no_check(j) * (float)sig.a_no_check(k - j);
189  sig.a_no_check(k) = (short) s + res.a_no_check(k);
190  }
191  start = end;
192  }
193 }
194 
195 
196 
198 {
199  // An (unfortunately) faster version of the above. This is about
200  // three time faster than the above. Improvements would need to be
201  // done of signal access to make the above compete.
202  // Note the rescaling of the residual is packaged within here too
203  int i, j, k, m, n;
204  int start, end;
205  float s;
206  int order = lpc.num_channels() - 1;
207  if (order < 0) order = 0; // when lpc as no frames
208  float *buff = walloc(float,res.num_samples()+order);
209  float *filt = walloc(float,order+1);
210  short *residual = res.values().memory();
211 
212  sig.resize(res.num_samples(),1,0); // no reseting of values
213  sig.set_sample_rate(res.sample_rate());
214  for (k=0; k<order; k++)
215  buff[k] = 0;
216  for (start = k, m = 0, i = 0; i < lpc.num_frames() - 1; ++i)
217  {
218  end = int((lpc.t(i) + lpc.t(i + 1)) * (float)res.sample_rate()) / 2;
219  if (end > res.num_samples())
220  end = res.num_samples();
221  for (j=1; j<lpc.num_channels(); j++)
222  filt[j]=lpc.a_no_check(i,j);
223  n = j;
224  for (k = start; k < end; ++k,++m)
225  {
226  s = 0;
227  for (j = 1; j < n; ++j)
228  s += filt[j] * buff[k-j];
229  // The 0.5 should be a parameter
230  // buff[k] = s + (residual[m]*0.5);
231  buff[k] = s + residual[m];
232  }
233  start = end;
234  }
235  short *signal = sig.values().memory();
236  for (j=0,i=order; i < k; j++,i++)
237  signal[j] = (short)buff[i];
238  wfree(buff);
239  wfree(filt);
240 }
241 
242 void post_emphasis(EST_Wave &sig, float a)
243 {
244  double last=0;
245 
246  for (int j = 0; j < sig.num_channels(); ++j)
247  for (int i = 0; i < sig.num_samples(); i++)
248  {
249  sig.a(i, j) = (int)((float)sig.a(i, j) + a * last);
250  last = (float)sig(i, j);
251  // if (absval(sig(i) > maxval)
252  // maxval = absval(fddata[i]);
253  }
254 }
255 
256 void pre_emphasis(EST_Wave &sig, float a)
257 {
258  float x = 0.0;
259  float x_1 = 0.0;
260 
261  for (int j = 0; j < sig.num_channels(); ++j)
262  for (int i = 0; i < sig.num_samples(); i++)
263  {
264  x = sig.a_no_check(i, j);
265  sig.a_no_check(i, j) =
266  sig.a_no_check(i, j) - int(a * x_1);
267  x_1 = x;
268  }
269 }
270 
271 void pre_emphasis(EST_Wave &sig, EST_Wave &out, float a)
272 {
273  out.resize(sig.num_samples(), sig.num_channels());
274 
275  for (int j = 0; j < sig.num_channels(); ++j)
276  {
277  out.a_no_check(0, j) = sig.a_no_check(0, j);
278  for (int i = 1; i < sig.num_samples(); i++)
279  out.a_no_check(i, j) =
280  sig.a_no_check(i, j) - int(a * (float)sig.a_no_check(i-1, j));
281  }
282 }
283 
284 void post_emphasis(EST_Wave &sig, EST_Wave &out, float a)
285 {
286  out.resize(sig.num_samples(), sig.num_channels());
287 
288  for (int j = 0; j < sig.num_channels(); ++j)
289  {
290  out.a_no_check(0, j) = sig.a_no_check(0, j);
291  for (int i = 1; i < sig.num_samples(); i++)
292  out.a_no_check(i, j) =
293  sig.a_no_check(i, j) + int(a * (float)sig.a_no_check(i-1, j));
294  }
295 }
296 
298 { // simple mean smoother of order n
299  int i, j, h, k=1;
300  float *a = new float[c.num_samples()];
301  float sum;
302  h = n/2;
303 
304  for (i = 0; (i < h); ++i)
305  {
306  k = (i * 2) + 1;
307  sum = 0.0;
308  for (j = 0; (j < k) && (k < c.num_samples()); ++j)
309  sum += c.a_no_check(j);
310  a[i] = sum /(float) k;
311  }
312 
313  for (i = h; i < c.num_samples() - h; ++i)
314  {
315  sum = 0.0;
316  for (j = 0; j < n; ++j)
317  sum += c.a_no_check(i - h + j);
318  a[i] = sum /(float) k;
319  }
320 
321  for (; i < c.num_samples(); ++i)
322  {
323  k = ((c.num_samples() - i)* 2) -1;
324  sum = 0.0;
325  for (j = 0; j < k; ++j)
326  sum += c.a_no_check(i - (k/2) + j);
327  a[i] = sum /(float) k;
328  }
329 
330  for (i = 0; i < c.num_samples(); ++i)
331  c.a_no_check(i) = (short)(a[i] + 0.5);
332 
333  delete [] a;
334 }
335 
336 void FIRfilter(EST_Wave &in_sig, const EST_FVector &numerator,
337  int delay_correction)
338 {
339  EST_Wave out_sig;
340 
341  out_sig.resize(in_sig.num_samples());
342  out_sig.set_sample_rate(in_sig.sample_rate());
343  out_sig.set_file_type(in_sig.file_type());
344 
345  FIRfilter(in_sig, out_sig, numerator, delay_correction);
346  in_sig = out_sig;
347 }
348 
349 void FIRfilter(const EST_Wave &in_sig, EST_Wave &out_sig,
350  const EST_FVector &numerator, int delay_correction)
351 {
352  if (delay_correction < 0)
353  EST_error("Can't have negative delay !\n");
354 
355  if (numerator.n() <= 0)
356  EST_error("Can't filter EST_Wave with given filter");
357 
358  int i,j,n=in_sig.num_samples();
359  out_sig.resize(n);
360 
361  // could speed up here with three loops :
362  // 1 for first part (filter overlaps start of wave, one 'if')
363  // 2 for middle part (filter always within wave, no 'if's)
364  // 3 for last part (filter overlaps end of wave, one 'if')
365 
366  // To make this faster do the float conversion once and hold it
367  // in a conventional array. Note this has been checked to be
368  // safe but if you change the code below you'll have to confirm it
369  // remains safe. If access through FVector was fast I'd use them
370  // but this is about twice as fast.
371  float *in = walloc(float,n);
372  for (i=0; i < n; ++i)
373  in[i] = (float)in_sig.a_no_check(i);
374  float *numer = walloc(float,numerator.n());
375  for (i=0; i < numerator.n(); ++i)
376  numer[i] = numerator.a_no_check(i);
377  float *out = walloc(float,n);
378 
379  for (i = 0; i < n; ++i)
380  {
381  out[i] = 0;
382 
383  int jlow=0;
384  int jhigh=numerator.n();
385 
386  if(i+delay_correction >= n)
387  jlow = i + delay_correction - n + 1;
388 
389  if(i+delay_correction - jhigh < 0)
390  jhigh = i + delay_correction;
391 
392  for(j=jlow; j<jhigh; j++)
393  if (((i+delay_correction - j) >= 0) &&
394  ((i+delay_correction - j) < n))
395  out[i] += in[i+delay_correction - j] * numer[j];
396  }
397 
398  for (i=0; i<n; i++)
399  out_sig.a_no_check(i) = (short)out[i];
400  out_sig.set_sample_rate(in_sig.sample_rate());
401  out_sig.set_file_type(in_sig.file_type());
402 
403  wfree(in);
404  wfree(numer);
405  wfree(out);
406 }
407 
408 void FIR_double_filter(EST_Wave &in_sig, EST_Wave &out_sig,
409  const EST_FVector &numerator)
410 {
411  out_sig = in_sig;
412  FIRfilter(out_sig, numerator, 0);
413  reverse(out_sig);
414  FIRfilter(out_sig, numerator, 0);
415  reverse(out_sig);
416 }
417 
418 EST_FVector design_FIR_filter(const EST_FVector &frequency_response,
419  int filter_order)
420 {
421  // frequency_response contains the desired filter reponse,
422  // on a scale 0...sampling frequency
423 
424  // check filter_order is odd
425  if((filter_order & 1) == 0){
426  cerr << "Requested filter order must be odd" << endl;
427  return EST_FVector(0);
428  }
429 
430  // check frequency_response has dimension 2^N
431  int N = fastlog2(frequency_response.n());
432  if(frequency_response.n() != (int)pow(float(2.0),(float)N)){
433  cerr << "Desired frequency response must have dimension 2^N" << endl;
434  return EST_FVector(0);
435  }
436 
437  int i;
438  EST_FVector filt(frequency_response);
439  EST_FVector dummy(frequency_response.n());
440  for(i=0;i<dummy.n();i++)
441  dummy[i] = 0.0;
442 
443  int e=slowIFFT(filt,dummy);
444  if (e != 0)
445  {
446  cerr << "Failed to design filter because FFT failed" << endl;
447  return EST_FVector(0);
448  }
449 
450  EST_FVector reduced_filt(filter_order);
451 
452  int mid = filter_order/2;
453 
454  reduced_filt[mid] = filt(0);
455  for(i=1; i<=mid ;i++)
456  {
457  // Hann window for zero ripple
458  float window = 0.5 + 0.5 * cos(PI*(float)i / (float)mid);
459  reduced_filt[mid+i] = filt(i) * window;
460  reduced_filt[mid-i] = filt(i) * window;
461  }
462 
463  return reduced_filt;
464 }
465 
466 
467 
469  int cutoff_freq, int order,
470  float gain1, float gain2)
471 {
472  // change to bandpass filter .....
473 
474  if (sample_rate <= 0){
475  cerr << "Can't design a FIR filter for a sampling rate of "
476  << sample_rate << endl;
477  return EST_FVector(0);
478  }
479 
480  int i;
481  int N=10; // good minimum size
482 
483  int fft_size = (int)pow(float(2.0), float(N));
484  while(fft_size < order*4){ // rule of thumb !?
485  N++;
486  fft_size = (int)pow(float(2.0), float(N));
487  }
488 
489  // freq response is from 0 to sampling freq and therefore
490  // must be symmetrical about 1/2 sampling freq
491 
492  EST_FVector freq_resp(fft_size);
493  int normalised_cutoff = (fft_size * cutoff_freq)/sample_rate;
494  for(i=0;i<normalised_cutoff;i++){
495  freq_resp[i] = gain1;
496  freq_resp[fft_size-i-1] = gain1;
497  }
498  for(;i<fft_size/2;i++){
499  freq_resp[i] = gain2;
500  freq_resp[fft_size-i-1] = gain2;
501  }
502 
503  return design_FIR_filter(freq_resp, order);
504 }
505 
506 EST_FVector design_lowpass_FIR_filter(int sample_rate, int freq, int order)
507 {
508  return design_high_or_low_pass_FIR_filter(sample_rate,
509  freq, order, 1.0, 0.0);
510 }
511 
512 EST_FVector design_highpass_FIR_filter(int sample_rate, int freq, int order)
513 {
514  return design_high_or_low_pass_FIR_filter(sample_rate,
515  freq, order, 0.0, 1.0);
516 }
517 
518 void FIRlowpass_filter(const EST_Wave &in_sig, EST_Wave &out_sig,
519  int freq, int order)
520 {
522  freq, order);
523  FIRfilter(in_sig, out_sig, filt, filt.n()/2);
524 }
525 
526 void FIRlowpass_filter(EST_Wave &in_sig, int freq, int order)
527 {
529  freq, order);
530  FIRfilter(in_sig, filt, filt.n()/2);
531 }
532 
533 
534 void FIRhighpass_filter(EST_Wave &in_sig, int freq, int order)
535 {
537  freq,order);
538  FIRfilter(in_sig, filt, filt.n()/2);
539 }
540 
541 void FIRhighpass_filter(const EST_Wave &in_sig, EST_Wave &out_sig,
542  int freq, int order)
543 {
545  freq,order);
546  FIRfilter(in_sig, out_sig, filt, filt.n()/2);
547 }
548 
549 void FIRlowpass_double_filter(EST_Wave &in_sig, int freq, int order)
550 {
552  freq, order);
553 
554  FIRfilter(in_sig, filt, filt.n()/2);
555  reverse(in_sig);
556  FIRfilter(in_sig, filt, filt.n()/2);
557  reverse(in_sig);
558 }
559 
560 void FIRlowpass_double_filter(const EST_Wave &in_sig, EST_Wave &out_sig,
561  int freq, int order)
562 {
564  freq, order);
565 
566  FIRfilter(in_sig, out_sig, filt, filt.n()/2);
567  reverse(out_sig);
568  FIRfilter(out_sig, filt, filt.n()/2);
569  reverse(out_sig);
570 }
571 
572 void FIRhighpass_double_filter(const EST_Wave &in_sig, EST_Wave &out_sig,
573  int freq, int order)
574 {
576  freq,order);
577 
578  FIRfilter(in_sig, out_sig, filt, filt.n()/2);
579  reverse(out_sig);
580  FIRfilter(out_sig, filt, filt.n()/2);
581  reverse(out_sig);
582 }
583 
584 void FIRhighpass_double_filter(EST_Wave &in_sig, int freq, int order)
585 {
587  freq,order);
588 
589  FIRfilter(in_sig, filt, filt.n()/2);
590  reverse(in_sig);
591  FIRfilter(in_sig, filt, filt.n()/2);
592  reverse(in_sig);
593 }
A class for storing digital waveforms. The waveform is stored as an array of 16 bit shorts...
Definition: EST_Wave.h:64
float mid(const EST_Item &item)
Definition: EST_item_aux.cc:69
void FIRlowpass_filter(const EST_Wave &in_sig, EST_Wave &out_sig, int freq, int order)
Definition: filter.cc:518
void set_sample_rate(const int n)
Set sampling rate to n
Definition: EST_Wave.h:149
float end(const EST_Item &item)
Definition: EST_item_aux.cc:96
#define walloc(TYPE, SIZE)
Definition: EST_walloc.h:52
EST_FVector design_FIR_filter(const EST_FVector &frequency_response, int filter_order)
Definition: filter.cc:418
void FIRfilter(EST_Wave &in_sig, const EST_FVector &numerator, int delay_correction)
Definition: filter.cc:336
void pre_emphasis(EST_Wave &sig, float a)
Definition: filter.cc:256
EST_FVector design_lowpass_FIR_filter(int sample_rate, int freq, int order)
Definition: filter.cc:506
A vector class for floating point numbers. EST_FVector x should be used instead of float *x wherever ...
Definition: EST_FMatrix.h:119
int fastlog2(int)
Definition: fft.cc:555
int num_channels() const
return number of channels in track
Definition: EST_Track.h:657
void set_file_type(const EST_String t)
Definition: EST_Wave.h:167
INLINE const T & a_no_check(ssize_t n) const
read-only const access operator: without bounds checking
Definition: EST_TVector.h:254
ssize_t num_samples() const
return the number of samples in the waveform
Definition: EST_Wave.h:143
static void make_window(EST_TBuffer< float > &window_vals, int size, const char *name, int window_centre)
Definition: EST_Window.cc:259
float & a_no_check(ssize_t i, int c=0)
Definition: EST_Track.h:420
short & a(ssize_t i, ssize_t channel=0)
Definition: EST_Wave.cc:128
void FIR_double_filter(EST_Wave &in_sig, EST_Wave &out_sig, const EST_FVector &numerator)
Definition: filter.cc:408
void lpc_filter_1(EST_Track &lpc, EST_Wave &res, EST_Wave &sig)
Definition: filter.cc:149
void sub_wave(EST_Wave &sw, int offset=0, ssize_t num=EST_ALL, ssize_t start_c=0, ssize_t nchan=EST_ALL)
Definition: EST_Wave.cc:342
short & a_safe(ssize_t i, ssize_t channel=0)
Definition: EST_Wave.cc:152
EST_String file_type() const
Definition: EST_Wave.h:166
void lpc_filter_fast(EST_Track &lpc, EST_Wave &res, EST_Wave &sig)
Definition: filter.cc:197
float & t(ssize_t i=0)
return time position of frame i
Definition: EST_Track.h:478
void inv_lpc_filter_ola(EST_Wave &in_sig, EST_Track &lpc, EST_Wave &out_sig)
Definition: filter.cc:102
void FIRlowpass_double_filter(EST_Wave &in_sig, int freq, int order)
Definition: filter.cc:549
const EST_SMatrix & values() const
Definition: EST_Wave.h:177
EST_FVector design_high_or_low_pass_FIR_filter(int sample_rate, int cutoff_freq, int order, float gain1, float gain2)
Definition: filter.cc:468
int slowIFFT(EST_FVector &real, EST_FVector &imag)
Basic inverse in-place FFT.
Definition: fft.cc:179
INLINE short & a_no_check(ssize_t i, ssize_t channel=0)
Definition: EST_Wave.h:105
void inv_lpc_filter(EST_Wave &sig, EST_FVector &a, EST_Wave &res)
Definition: filter.cc:68
#define EST_error
Definition: EST_error.h:104
ssize_t num_frames() const
return number of frames in track
Definition: EST_Track.h:651
void FIRhighpass_filter(EST_Wave &in_sig, int freq, int order)
Definition: filter.cc:534
getString int
Definition: EST_item_aux.cc:50
#define PI
Definition: EST_Complex.h:48
void resize(int num_samples, int num_channels=EST_ALL, int set=1)
resize the waveform
Definition: EST_Wave.h:184
int sample_rate() const
return the sampling rate (frequency)
Definition: EST_Wave.h:147
const T * memory() const
Definition: EST_TVector.h:238
float start(const EST_Item &item)
Definition: EST_item_aux.cc:52
void FIRhighpass_double_filter(const EST_Wave &in_sig, EST_Wave &out_sig, int freq, int order)
Definition: filter.cc:572
ssize_t num_channels() const
return the number of channels in the waveform
Definition: EST_Wave.h:145
void simple_mean_smooth(EST_Wave &c, int n)
Definition: filter.cc:297
void post_emphasis(EST_Wave &sig, float a)
Definition: filter.cc:242
void wfree(void *p)
Definition: walloc.c:131
float sum(const EST_FMatrix &a)
sum of elements
Definition: vec_mat_aux.cc:147
INLINE ssize_t n() const
number of items in vector.
Definition: EST_TVector.h:251
void reverse(EST_Wave &sig)
void frame(EST_FVector &fv, int n, int startf=0, int nf=EST_ALL)
Definition: EST_Track.h:210
void fill(short v=0, ssize_t channel=EST_ALL)
Definition: EST_Wave.cc:166
void lpc_filter(EST_Wave &sig, EST_FVector &a, EST_Wave &res)
Definition: filter.cc:53
EST_FVector design_highpass_FIR_filter(int sample_rate, int freq, int order)
Definition: filter.cc:512