Coder Social home page Coder Social logo

Comments (15)

billsheh avatar billsheh commented on August 21, 2024 1

from dtmfdetection.

bert2 avatar bert2 commented on August 21, 2024 1

If you provide the parameter name explicitly, other optional parameters can be skipped:

var dtmfs = audioFile.DtmfChanges(config: Config.Default.WithThreshold(42));

from dtmfdetection.

bert2 avatar bert2 commented on August 21, 2024

Could you provide the audio file in question?

from dtmfdetection.

billsheh avatar billsheh commented on August 21, 2024

from dtmfdetection.

bert2 avatar bert2 commented on August 21, 2024

Hi @billsheh, unfortunately the audio file you attached to the mail didn't make its way into GitHub. I think you'll have to upload it somewhere and post the link here.

from dtmfdetection.

billsheh avatar billsheh commented on August 21, 2024

from dtmfdetection.

bert2 avatar bert2 commented on August 21, 2024

That's odd. The file seems normal.
Not sure when I will have the time to investigate this. In the meantime you can try lowering the detection threshold. I was able to detect all four tones with a threshold of 25 (default is 30).

from dtmfdetection.

bert2 avatar bert2 commented on August 21, 2024

Disabling the normalization also helps, but I wouldn't recommend it.

Let me know when you need further assistance with the detector configuration.

from dtmfdetection.

billsheh avatar billsheh commented on August 21, 2024

from dtmfdetection.

bert2 avatar bert2 commented on August 21, 2024

You could make it work with net472, but I'm using a couple netstandard2.1 features. So it can't be done without changing the source and recompiling.

You can try one of the older versions before the 1.0.0 rewrite (e.g 0.9.2), because those still use net47.

A word of warning: back then this library had a shitty interface. You can't even change the detector config without using reflection, because I made its property setters private. I must have had a serious episode of braindeadness or something. Anyway here is the README for 0.9.2.

from dtmfdetection.

billsheh avatar billsheh commented on August 21, 2024

from dtmfdetection.

billsheh avatar billsheh commented on August 21, 2024

from dtmfdetection.

bert2 avatar bert2 commented on August 21, 2024

Hey Bill, thanks to Git it's all still here. You just have to checkout the right commit:

PS> git clone http://github.com/bert2/DtmfDetection
PS> cd DtmfDetection
PS> git checkout 0827801   # checkout last commit of 0.9.2

It's a VS 2017 solution though.

If you have a specific question, feel free to ask it here.

from dtmfdetection.

bert2 avatar bert2 commented on August 21, 2024

The problem is actually the Goertzel response normalization. For each DTMF tone in the sample file the high frequency is about twice as strong as the low frequency. For the first two tones (phone keys 5 and 6) the high frequency is even a little bit stronger (factor ~2.2).

The normalization simply accumulates the total signal energy including both the high and low frequencies of a DTMF tone. When one of the two is much stronger than the other then the lower one will be suppressed by the higher.

The workaround for now is to disable the normalization. For a fix I'll have to find a way to exclude the frequencies that are part of a DTMF tone from the total signal energy. If this even makes sense, I'm not sure yet.

from dtmfdetection.

moving-digital avatar moving-digital commented on August 21, 2024

Hello @bert2

Jumping back in almost two years later. Is there a way to adjust the detection threshold when reading a wav/mp3 file?

As per your example in the readme, the below code is working

using var audioFile = new AudioFileReader("/home/dtmf-not-perfect-example.wav");
var dtmfs = audioFile.DtmfChanges();

I found that the following entry point takes an optional Config argument (defaulting to Config.Default):

List<DtmfChange> float[].DtmfChanges(int, int, Config?)

But in the above case, is it possible to use DtmfChanges in order to modify the config without having the pass the first two int?

from dtmfdetection.

Related Issues (18)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.