xref: /btstack/3rd-party/lc3-google/src/attdet.h (revision 9a19cd786042b1fc78813d984efdd045e84593df)
1*9a19cd78SMatthias Ringwald /******************************************************************************
2*9a19cd78SMatthias Ringwald  *
3*9a19cd78SMatthias Ringwald  *  Copyright 2021 Google, Inc.
4*9a19cd78SMatthias Ringwald  *
5*9a19cd78SMatthias Ringwald  *  Licensed under the Apache License, Version 2.0 (the "License");
6*9a19cd78SMatthias Ringwald  *  you may not use this file except in compliance with the License.
7*9a19cd78SMatthias Ringwald  *  You may obtain a copy of the License at:
8*9a19cd78SMatthias Ringwald  *
9*9a19cd78SMatthias Ringwald  *  http://www.apache.org/licenses/LICENSE-2.0
10*9a19cd78SMatthias Ringwald  *
11*9a19cd78SMatthias Ringwald  *  Unless required by applicable law or agreed to in writing, software
12*9a19cd78SMatthias Ringwald  *  distributed under the License is distributed on an "AS IS" BASIS,
13*9a19cd78SMatthias Ringwald  *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14*9a19cd78SMatthias Ringwald  *  See the License for the specific language governing permissions and
15*9a19cd78SMatthias Ringwald  *  limitations under the License.
16*9a19cd78SMatthias Ringwald  *
17*9a19cd78SMatthias Ringwald  ******************************************************************************/
18*9a19cd78SMatthias Ringwald 
19*9a19cd78SMatthias Ringwald /**
20*9a19cd78SMatthias Ringwald  * LC3 - Time domain attack detector
21*9a19cd78SMatthias Ringwald  *
22*9a19cd78SMatthias Ringwald  * Reference : Low Complexity Communication Codec (LC3)
23*9a19cd78SMatthias Ringwald  *             Bluetooth Specification v1.0
24*9a19cd78SMatthias Ringwald  */
25*9a19cd78SMatthias Ringwald 
26*9a19cd78SMatthias Ringwald #ifndef __LC3_ATTDET_H
27*9a19cd78SMatthias Ringwald #define __LC3_ATTDET_H
28*9a19cd78SMatthias Ringwald 
29*9a19cd78SMatthias Ringwald #include "common.h"
30*9a19cd78SMatthias Ringwald 
31*9a19cd78SMatthias Ringwald 
32*9a19cd78SMatthias Ringwald /**
33*9a19cd78SMatthias Ringwald  * Time domain attack detector
34*9a19cd78SMatthias Ringwald  * dt, sr          Duration and samplerate of the frame
35*9a19cd78SMatthias Ringwald  * nbytes          Size in bytes of the frame
36*9a19cd78SMatthias Ringwald  * attdet          Context of the Attack Detector
37*9a19cd78SMatthias Ringwald  * x               [-6..-1] Previous, [0..ns-1] Current samples
38*9a19cd78SMatthias Ringwald  * return          1: Attack detected  0: Otherwise
39*9a19cd78SMatthias Ringwald  */
40*9a19cd78SMatthias Ringwald bool lc3_attdet_run(enum lc3_dt dt, enum lc3_srate sr,
41*9a19cd78SMatthias Ringwald     int nbytes, lc3_attdet_analysis_t *attdet, const float *x);
42*9a19cd78SMatthias Ringwald 
43*9a19cd78SMatthias Ringwald 
44*9a19cd78SMatthias Ringwald #endif /* __LC3_ATTDET_H */
45