summaryrefslogtreecommitdiff
path: root/cras/src/dsp/dcblock.h
blob: b7234704b9d2b0461ec8e758768e49d54c4153d1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
/* Copyright (c) 2013 The Chromium OS Authors. All rights reserved.
 * Use of this source code is governed by a BSD-style license that can be
 * found in the LICENSE file.
 */

#ifndef DCBLOCK_H_
#define DCBLOCK_H_

#ifdef __cplusplus
extern "C" {
#endif

/* A DC blocking filter. */

struct dcblock;

/*
 * Create a DC blocking filter.
 *
 * Transfer fn: (1 - z^-1) / (1 - R * z^-1)
 */
struct dcblock *dcblock_new(float R);

/* Free a DC blocking filter. */
void dcblock_free(struct dcblock *dcblock);

/* Process a buffer of audio data through the filter.
 * Args:
 *    dcblock - The filter we want to use.
 *    data - The array of audio samples.
 *    count - The number of elements in the data array to process.
 */
void dcblock_process(struct dcblock *dcblock, float *data, int count);

#ifdef __cplusplus
} /* extern "C" */
#endif

#endif /* DCBLOCK_H_ */