energy_statistics.h 581 B

12345678910111213141516171819202122232425
  1. /*
  2. * Copyright (c) 2019 Actions Semiconductor Co., Ltd
  3. *
  4. * SPDX-License-Identifier: Apache-2.0
  5. */
  6. /**
  7. * @file energy statistics interface
  8. */
  9. #include <stdint.h>
  10. #ifndef __ENERGY_STATISTICS_H__
  11. #define __ENERGY_STATISTICS_H__
  12. /* structure to set energy filter param */
  13. typedef struct {
  14. uint8_t enable;
  15. uint16_t threshold;
  16. /* attack time(ms) after energy below threshold */
  17. uint16_t attack_time;
  18. /* release time(ms) after energy above threshold */
  19. uint16_t release_time;
  20. }energy_filter_t;
  21. uint32_t energy_statistics(const short *pcm_data, uint32_t samples_cnt);
  22. #endif