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

Help in the file DTMFUtil.java #2

Open
VibhavChaddha opened this issue Dec 22, 2016 · 10 comments
Open

Help in the file DTMFUtil.java #2

VibhavChaddha opened this issue Dec 22, 2016 · 10 comments

Comments

@VibhavChaddha
Copy link

VibhavChaddha commented Dec 22, 2016

There is a lot of code to grasp quickly and then to understand the flow of the code. I looked into the 'DTMFDecoder.java' file, but when I was running it, there was no output. It said "The DTMF tones found in the given file are: ", that's it. Although I have not looked deeper into it, but I think the 'sequence' variable is not getting any value.
Thanks.

@tino1b2be
Copy link
Owner

Hey there. DTMFUtil.java has no "main method" (by main method I assume you are referring to the actual main method that is used to run a java program). I just updated the readme with examples of how to use the decoder. You can check out DTMFDecoder.java which is a small program that actually uses the decoder. There are other programs and tests inside /cmdprograms.

@tino1b2be
Copy link
Owner

Ohh. maybe the audio file you are decoding doesnt have any DTMF tones in it? Try testing with one of the audio files I have in this folder

Disclaimer: When I wrote this program I had very limited knowledge about signal detection techniques (2nd year electrical engineering) so maybe that's why it's failing to detect but I did make sure it could detect DTMF tones as specified by the ITU-T Q.24

@tino1b2be
Copy link
Owner

Thank you 👍 💃 :D ... Yeah I'm sorry about the code bloat there. If you study the code more I'm sure you can modify it for your purpose.

I also had the same problems with the Goertzel algorithm. It wasn't very good when there was a lot of noise. The FFT from apache commons math library is actually WAY better than the first order goertzel algorithm i implemented because it's optimised and therefore much faster (Refer to my report on page 14).

I'm not sure how much experience you have with DSP but you can try implement a window function and/or a matched filter (or some other sort of correlation if you know the exact frequency(s) you are looking for) to improve detection performance when there's a lot of noise.

Check out this small program it can give you a head start for working with FFT.

@tino1b2be
Copy link
Owner

If I may ask, how did you come across this repo and what what are you using it for? (is it a varisty project? personal use? etc...)

@VibhavChaddha
Copy link
Author

Hi.
There was some issue with my internet yesterday and therefore I accidentally deleted my comments.
I was searching for some libraries which I can use for my project and I found your repo.
I am actually using it for my personal use right now, but maybe in future, it will help me in some way or the other, as knowledge never goes waste. :)
Thanks a lot for taking your valuable time to help me out with my issues. I really appreciate it and I am definitely going to look at your FFT code for reference.
Hopefully, I will be in touch with you. Cheerio.

@VibhavChaddha
Copy link
Author

My yesterdays' comment. ;)

Your code is brilliantly choreographed and quite easy to understand. But just because of the length of the code I tend to forget few things, like 'where was I before this part'.
I will have to make a hell lot of changes in your code to fulfil my purpose. I have got a few understanding of this code, though. Good for me.

What I exactly wanted is that "I have a wave file with two frequencies, and whenever I find the first frequency in the file I will write that in a binary array as '0' and I will write the second frequency in the same file as '1'. For example, if my wave file is 10 seconds long and for the first 5 seconds it contains the first frequency and next 5 seconds it contains second frequency, then my array should be '0000011111' ".
I want to achieve it using FFT, as what I have read in past few weeks, Goertzel will not work perfectly if there is some noise.

@VibhavChaddha
Copy link
Author

Hi, tino1b2be.

In your code TryFFTSpectrum the power that you are printing, what exactly is that? Is that the peak in the amplitude when the specified frequency is found? And is there any guarantee of it being always constant (or just a slight change) for a particular frequency?

@tino1b2be
Copy link
Owner

Let me check it out I last used it over a yer ago... I'll modify if necessary.

@VibhavChaddha
Copy link
Author

Sure. Thanks.

@VibhavChaddha
Copy link
Author

VibhavChaddha commented Jan 2, 2017

Hi, tino1b2be. Wish you a very Happy New Year.
I saw that you have made some amendments into 'TryFFTSpectrum.java' file. Still, I have the above-mentioned query that, "the power that you are printing, what exactly is that? Is that the peak in the amplitude when the specified frequency is found?". Can you please help me out with it?

P.S. - I want to check for frequencies between 16000 to 20000.
Thanks.

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

2 participants