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

cplx2real function can only be used with fft4r initialized, and the example creates confusion (DSP-147) #94

Open
alexbarcelo opened this issue Sep 24, 2024 · 3 comments

Comments

@alexbarcelo
Copy link

dsps_cplx2real_fc32(x1, N >> 1);

I was trying to follow the example with a codebase that uses not fft4r but only fft2r functions (which are showcased in this example, I understand). I was getting segfault errors and after gazillion checks in the documentation I realized that cplx2real documentation says that fft4r needs to be initialized. In the example may be ok because it is showcasing both, but in a regular scenario it is not ok.

Assuming that this is indeed the problem (my code started working once I changed to cplx2reC_fc32 function, but I have not validated the numerical aspect, so I may have more bugs, and I may have misunderstood the documentation once again), the example should use the proper function to showcase properly which functions to use in which scenarios.

@github-actions github-actions bot changed the title cplx2real function can only be used with fft4r initialized, and the example creates confusion cplx2real function can only be used with fft4r initialized, and the example creates confusion (DSP-147) Sep 24, 2024
@dmitry1945
Copy link
Collaborator

Hi @alexbarcelo

The dsps_cplx2real_fc32 need initialization for FFT4R. You have to call dsps_fft2r_init_fc32 and dsps_fft4r_init_fc32.
Did you call dsps_fft4r_init_fc32?

@alexbarcelo
Copy link
Author

Of course everything is due to my ignorance and incompetence. I was assuming that cplx2real and cplx2reC were "similar". Maybe they are not?

I assumed that the example showcases two different "flows": the fft2r_* way and the fft4r_* way. But from your comment, when using dsps_fft2r mehods I need to do the init also for fft4r. Is this the case for dsps_cplx2real_sc16_ansi? Documentation does not mention 4r in that, there is no 4r init, so I was confused.

@dmitry1945
Copy link
Collaborator

dmitry1945 commented Sep 25, 2024

@alexbarcelo
The cplx2real use a table and additional memory, that's why we have moved the cplx2real to the fft4r init function.
I will check the functions later.

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

No branches or pull requests

3 participants