Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AnalyzeFFT256 is not completely ready for usage with BLOCK_SAMPLE=64 #379

Open
CorBer opened this issue Jan 24, 2021 · 1 comment
Open

Comments

@CorBer
Copy link

CorBer commented Jan 24, 2021

Description

In the analyze_fft256 library some code seems to be missing to make this library work also with audio_block_samples of 64. The outputflag is NOT set and thus the routine never reports "available".

Steps To Reproduce Problem

Change #define AUDIO_BLOCK_SAMPLES to 64 in audioStream.h
Any program that uses an AudioAnalyzeFFT256 will never get an FFT.available() report as the routine never sets the outputflag to TRUE.

Proposed changes

Minor changes are necessary in analyze_FFT256.cpp library to solve this:

line114 count = 2; <<<<<<<<<<<<<<<<< THIS SHOULD BE ZERO !!
const uint32_t *p = (uint32_t *)buffer;
for (int i=0; i < 128; i++) {
uint32_t tmp = *p++;
int16_t v1 = tmp & 0xFFFF;
int16_t v2 = tmp >> 16;
output[i] = sqrt_uint32_approx(v1 * v1 + v2 * v2);
}
outputflag=true; <<<<<<<<<<<<<<<<< THIS NEEDS TO BE ADDED

@CorBer
Copy link
Author

CorBer commented Jan 24, 2021

Additionally line 109 of analyzeFFT256.cpp also has a mistake.
This now reads: copy_to_fft_buffer(buffer+256, prevblocks[1]->data);
but it should be copy_to_fft_buffer(buffer+256, prevblocks[0]->data);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant