I'm working with an embedded system that has two acquisition channels and unfortunately, their clock crystals are slightly out of sync. Even though both boards are configured by software to sample at 1kHz, in reality, one of them samples at 996 Hz and the other at 1008 Hz. This was confirmed by an oscilloscope as well.
I want to synchronize these two signals so I can extract the phase lag between them. (both channels are sensing/sampling the same periodic signal with a constant phase difference between the two).
Right now, I'm just using the built-in Python scipy function to upsample both signals to 2kHz and then put them next to each other. It appears to work but I'm just not sure if upsampling like this is valid considering the ratio between the original and upsampled signal is not a whole number (2000/996 and 2000/1008 respectively).
Is there a better way to do this?