I'm working with Teensy 3.2.

Status
Not open for further replies.

danhsmile043

New member
Hi,
I have some trouble initializing arm_rfft_instance_q15 with function arm_rfft_init_q15.
I'm working with Teensy 3.2.
Sw environment is Audio Library (to read from ADC (pin A2) with AudioRecordQueue) and "arm_math" library for FFT the data red from ADC.

My code is:
Code:

#define FFT_SIZE 1024
arm_rfft_instance_q15 S;
arm_cfft_radix4_instance_q15 *S_CFFT;

void loop() {
...
if(queue1.available() == 32){ // se sono pronti RX_NUM campioni nella coda
int16_t buffer[32];
memcpy(buffer, (int16_t*)queue1.readBuffer(), sizeof(buffer));
queue1.freeBuffer();
byte i = 0;
for(; i < 32; i++) {
buffer /= 1024;
//Serial.println(buffer);
}
Serial.println("B 1");
/* Initialize the RFFT/RIFFT module, intFlag = 0, doBitReverse = 1 */
arm_rfft_init_q15(&S, S_CFFT,FFT_SIZE, 0, 1);
Serial.println("B 2");
}

When I start the sketch, the first iteration of loop blocks after showing "B 1", not showing "B 2". If I print time samples (output from queue1) they are red successfully in the first iteration.
 
Status
Not open for further replies.
Back
Top