modulepackage
0.1.0
Repository: https://github.com/cycoresystems/goertzel.git
Documentation: pkg.go.dev
# README
goertzel - Golang goertzel tone detection library
This library provides tools for tone detection using the goertzel algorithm. All data is expected to be in 16-bit signed linear format, and there may be hidden assumptions. It was built to service telephony-oriented functionality.
Most users will simply make use of the high-level DetectTone function. However, lower-level block-wise control is available by directly manipulating the Target detector.
Contributing
Contributions welcomed. Changes with tests and descriptive commit messages will get priority handling.
# Functions
DetectTone waits for the given tone to be found, returning with `true` when it is.
DetectToneAbsence waits for the given frequency to go away for the requested amount of time.
NewTarget creates a Goertzel processor tuned to the given frequency.
# Constants
BlockSizeDTMF is the optimum block size for DTMF detection.
BlockSizeNorthAmerica is the optimum block size for North America progress tones: 350 440 480 620 850 1400 1800 Hz.
BlockSizeSouthAmerica is the optimum block size for Costa Rica and Brazil: 425Hz.
BlockSizeUKDisconnect is the optimum block size for UK disconnect tone: 400Hz.
RateTelephony is the standard telephony rate of 8kHz.
ToneThreshold is the standard threshold for tone detection.
# Variables
BlockBufferSize is the number of blocks to buffer for slow readers, when sending BlockSummaries from Targets.
ContactIDFrequencies is the list of signaling frequencies used in SIA ContactID.
DTMFFrequencies is the list of frequencies used by standard North American DTMF.
NATelephonyFrequencies is the list of common frequencies used in the North American telephony space.
# Structs
BlockSummary describes the result of a single block of processing for a Target frequency.
Target is a target frequency detector.