Home | History | Annotate | Download | only in dsp
      1 /* Copyright (c) 2013 The Chromium OS Authors. All rights reserved.
      2  * Use of this source code is governed by a BSD-style license that can be
      3  * found in the LICENSE file.
      4  */
      5 
      6 #ifndef DCBLOCK_H_
      7 #define DCBLOCK_H_
      8 
      9 #ifdef __cplusplus
     10 extern "C" {
     11 #endif
     12 
     13 /* A DC blocking filter. */
     14 
     15 struct dcblock;
     16 
     17 /*
     18  * Create a DC blocking filter.
     19  *
     20  * Transfer fn: (1 - z^-1) / (1 - R * z^-1)
     21  */
     22 struct dcblock *dcblock_new(float R);
     23 
     24 /* Free a DC blocking filter. */
     25 void dcblock_free(struct dcblock *dcblock);
     26 
     27 /* Process a buffer of audio data through the filter.
     28  * Args:
     29  *    dcblock - The filter we want to use.
     30  *    data - The array of audio samples.
     31  *    count - The number of elements in the data array to process.
     32  */
     33 void dcblock_process(struct dcblock *dcblock, float *data, int count);
     34 
     35 #ifdef __cplusplus
     36 } /* extern "C" */
     37 #endif
     38 
     39 #endif /* DCBLOCK_H_ */
     40