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

question: how about using a Goertzel filter? #9

Open
aguaviva opened this issue Jan 13, 2021 · 4 comments
Open

question: how about using a Goertzel filter? #9

aguaviva opened this issue Jan 13, 2021 · 4 comments
Labels
enhancement New feature or request

Comments

@aguaviva
Copy link

I was wondering, did you try using a Goertzel filter? That allows you to compute the power of a single frequency, that is what is used to detect the DTMF tones. This would spare you having to compute the FFT.

@ggerganov
Copy link
Owner

This is definitely something to explore. I remember doing some experiments with it in the past, but not sure why I gave up on it. It looks like very well suited for this approach.

@ggerganov ggerganov added the enhancement New feature or request label Jan 13, 2021
@ggerganov
Copy link
Owner

So I started some experiments using the Goertzel algorithm in the experiment/goertzel branch and I think I now remember what was the problem with this approach. The Goertzel algorithm is only more efficient than FFT if you want to observe less than log(N) frequencies. In ggwave with current default Tx protocols we use 96 frequencies for the audible protocols and another 96 frequencies for the ultrasound protocols. N is 1024 so log(N) is 10. This means there will be no computational gain if the Goertzel algorithm is used instead of FFT.

For DTMF the number of frequencies is just 8 so there is some benefit using this approach. Also, it saves some memory so I guess it is the preferred method in applications with limited memory.

However, for ggwave I don't think there will be any positive effect unless I am missing something.

@aguaviva
Copy link
Author

aguaviva commented Feb 9, 2021

Sounds good! I didn't know you were using so many frequencies!

@ggerganov
Copy link
Owner

In ggwave v0.2.0 we now have Dual-Tone protocols that use just 32 frequencies, so Goertzel might be back on the table. Moreover, I think it would be nice to add support for vanilla DTMF, so I guess I'll keep this issue open to remind me about this and provide updates in the future.

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

No branches or pull requests

2 participants