In short I'm recreating a program that reads 3 sinusoidal signals through an ADC performs some manipulations and then reproduces these signals through a DAC. In order to reproduce these signals I need the instantaneous phase of one of these manipulations. So I recreated a charge pump zero crossing pll in software.
I don't understand why you would go to the trouble of working out the analogue loop filter transfer function, convert it to the z domain, when in software when I could just implement a program that reads the amount of samples between zeros, and the instantaneous phase is just.
(current sample#-last zero sample#)/(pi*(number of samples between zeroes))
Now I've obviously missed something, but I don't know what to google to find out what.