I have a simple program that captures audio from an audio device. I have configured a nominal sample rate of 48000Hz and a buffer size of 1 millisecond. The audio sub system should execute my capture code with approximately 1000Hz.
My assumption is that the audio clock (LRCLK) is not running at exactly 48000Hz. Using this 1kHz-callback from the audio system I want to approximate the actual sampling frequency relativ to another clock. Currently I use the system clock of my workstation as a reference. I plan to use a network clock.
For my very first experiment I used a simple moving average with a period of 1000 but there is still very much jitter. Sometimes the average jumps by 2Hz which seems much to me.
What is the proper way to go here?