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

Report DFT progress #179

Open
xkzl opened this issue May 21, 2023 · 2 comments
Open

Report DFT progress #179

xkzl opened this issue May 21, 2023 · 2 comments

Comments

@xkzl
Copy link

xkzl commented May 21, 2023

Hello,

I would like to make a progress bar when computing large Fourier transform. This would be a great feature..
Knowing the total number of Fourier coefficients to compute and the typical FFT flow graphs.. Is there any possibility to use a signal handler to report the computational progress of the calculation ?

Cheers,
Marco

@xkzl xkzl changed the title DFT in progress signal Report DFT progress May 21, 2023
@dancazarin
Copy link
Member

Hello Marco,
I think it's not possible without modifying KFR sources.
Progress callback is not implemented because most of FFT sizes typical for audio take micro- or milliseconds.
But for larger data this would be very reasonable and good to have.
Internally KFR do calculations in 'stages' or passes. Each pass can report when it starts end finishes.
This won't give maximum accuracy but at least it's what is relatively easy to implement.
Could you try to add simple printf before every call to stages[...]->execute here and check if the frequency of printing is enough for your use case:
https://github.com/kfrlib/kfr/blob/master/include/kfr/dft/fft.hpp#L243
If it turns out not to be enough, then precise progress reporting will be much harder to implement without affecting performance in highly optimized pass functions (but still possible).

@xkzl
Copy link
Author

xkzl commented May 23, 2023

Hi Dan,

I am going to give it a try. It is exactly what I need I think.
Thank you for pointing me out the location.

Cheers, M.

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

2 participants