Skip to content

Arduino Library implementation of the Goertzel algorithm (adapted fixes for the SAMD Metro M0)

Notifications You must be signed in to change notification settings

timothycdc/Goertzel-Algorithm

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Goertzel

Arduino Library implementation of the Goertzel algorithm, originally written by jacobrosenthal. Adapted fixes for running on an SAMD Arduino Metro M0

Example

void loop()
{
  goertzel.sample(sensorPin); //Will take n samples
  
  float magnitude = goertzel.detect();  //check them for target_freq
  
  if(magnitude>THRESHOLD) //if you're getting false hits or no hits adjust this
    digitalWrite(led, HIGH); //if found, enable led
  else
    digitalWrite(led, LOW); //if not found, or lost, disable led
    
  Serial.println(magnitude);
}

About

Arduino Library implementation of the Goertzel algorithm (adapted fixes for the SAMD Metro M0)

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C++ 100.0%