Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Decode an chunk of samples from the queue
- void decoder::decode2(std::vector<short> &samples)
- {
- decoder::status = state::working;
- // decode
- //std::cout << "[DECODER] Decoding [" << samples.size() << "] samples...\n\n";
- // compile goertzelArray for all DTMF frequencies
- auto goertzelArray = processor::goertzelArray(samples);
- // check if thresholdBroken goes from true to false
- if (true && false)
- {
- // extract indexes (row & column) of most prominent frequencies of previousGoertzel
- auto indexes = decoder::extractIndexes(goertzelArray);
- // convert indexes to DTMF toneID
- auto toneID = decoder::extractToneID(indexes);
- // callback
- if (toneID >= 0)
- {
- callback(toneID);
- }
- }
- decoder::status = state::running;
- }
Add Comment
Please, Sign In to add comment