The goertzel3.py implementation was written for the Pyboard but could be adapted for other platforms. It includes test tone generation. See code comments for more details.
goertzel3.py