-
Notifications
You must be signed in to change notification settings - Fork 0
/
audio.h
41 lines (29 loc) · 1.11 KB
/
audio.h
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
40
41
#ifndef AUDIO_H
#define AUDIO_H
/* Library includes. */
#include <arm_math.h>
/* Kernel includes. */
#include "FreeRTOS.h"
#include "task.h"
/* Peripheral includes. */
#include "stm32f4_discovery.h"
#include "stm32f4xx_adc.h"
#include "stm32f4xx_gpio.h"
#include "stm32f4xx_tim.h"
/* User includes. */
#include "debug.h"
/*-----------------------------------------------------------*/
#define ADC_SAMPLES 2048U
#define CFFT_SIZE (ADC_SAMPLES / 2)
#define RFFT_SIZE (CFFT_SIZE / 2)
#define SAMPLING_FREQUENCY 44100U
#define HERTZ_PER_INDEX ((float32_t)SAMPLING_FREQUENCY / ADC_SAMPLES)
/*-----------------------------------------------------------*/
/* Initialize peripherals used in audio processing. */
void vInitAudio( void );
/* Function for performing an FFT. */
void vPerformFFT( float32_t* ufFourierFrequency );
/*-----------------------------------------------------------*/
/* Get debug stats from other file (debug.c) */
extern xDebugStats_t xDebugStats;
#endif