AudioRecord
Dependencies: STM32L4xx_HAL_Driver CMSIS_DSP_401
Revision 3:ec7e3c37fe80, committed 2015-11-26
- Comitter:
- EricLew
- Date:
- Thu Nov 26 22:32:56 2015 +0000
- Parent:
- 2:1066910a6cbc
- Commit message:
- FFT is currently not working and commented out
Changed in this revision
audio_record.c | Show annotated file Show diff for this revision Revisions of this file |
diff -r 1066910a6cbc -r ec7e3c37fe80 audio_record.c --- a/audio_record.c Wed Nov 25 17:35:26 2015 +0000 +++ b/audio_record.c Thu Nov 26 22:32:56 2015 +0000 @@ -4,6 +4,9 @@ /* Variable indicating which audio demo is currently running (playback v.s. record) */ Audio_DemoTypeDef AudioDemo = AUDIO_DEMO_NONE; + + + /* Private typedef -----------------------------------------------------------*/ typedef enum { @@ -22,9 +25,9 @@ static uint32_t RecordBuffer1[RECORD_BUFFER_SIZE];//RECORDING BUFFER FOR SAMPLE #1 /* Buffer used to stream the recorded PCM samples towards the audio codec. */ -static uint16_t PlaybackBuffer[RECORD_BUFFER_SIZE*2]; //PLAYBACK BUFFER FOR SAMPLE#0 -static uint16_t PlaybackBuffer1[RECORD_BUFFER_SIZE*2];//PLAYBACK BUFFER FOR SAMPLE#1 - +static uint32_t PlaybackBuffer[2048]; //PLAYBACK BUFFER FOR SAMPLE#0 +static uint32_t PlaybackBuffer1[2048];//PLAYBACK BUFFER FOR SAMPLE#1 + #define NB_SAMPLES_RATE 7 static uint32_t SamplesRates[NB_SAMPLES_RATE] = {BSP_AUDIO_FREQUENCY_48K}; //SAMPLE RATE IS THE SAME @@ -232,16 +235,19 @@ /* Reset AudioRecordExit flag */ AudioRecordExit = 0; - -//COMPARISON ALGORITHM START - -/*arm_cfft_f32 ( const arm_cfft_instance_f32 * S, - float32_t * p1, - uint8_t ifftFlag, - uint8_t bitReverseFlag -) - */ +// uint32_t fftLenReal=4096; +// uint32_t ifftFlagR=0; +// uint32_t bitReverseFlag=0; +// +// arm_rfft_init_q31 (arm_rfft_instance_q31, fftLenReal, ifftFlagR, bitReverseFlag) +// +// +// arm_rfft_q31 ( const arm_rfft_instance_q31 * S, &PlaybackBuffer, +//q31_t * pDst +//) +// + /* Turn off green led */ AudioDemo = AUDIO_DEMO_NONE;