I used Schmidtt trigger process to track frequency of beat measurement. This is a first step for digital PLL.
==Intro==:
we are trying to do offline PLL digitally, so we can avoid extra frequency noise from the LO used in PLL. The first step is to track down frequency of the beat measured by the PD.
==the code==:
I use Schmidtt trigger algorithm to covert analog signal to digital (the plot below show (-1,1) instead of (0,1) for easier comparison with the analog signal). The data below is taken from beat measurement with +/- 5000 count. The level is set to +/- 0.2 from amplitude of +/-1. Then I record how long the digital signal stay at 1, or 0 before the signal flip, then use that time to calculate the frequency of half cycle and plot it in the below figure.

Plot: Above, measured signal from daq (blue) and digitized signal via Schmidtt trigger (Green). Below, frequency of beat as obtained by the calculation from the digitized signal. Note the different time span between the two plots.
==next==
I have not FFT the frequency drift in time series yet because I just realize that the way I collect the frequency drift vs time might be a problem. The time step for frequency drift would be varied from point to point depending on the current drift frequency. For example,sat at 1Hz, the signal crosses zero twice per second, and twenty times per second at 10Hz. This means the data density (point per time) between the two frequencies are different, see the below zoomed picture. And it might cause a problem when I do FFT with varied dt size. To fix this, I 'll try to assign constant frequency to fill in the space. Once the problem is fixed, I can just FFT the signal. I'll think about using PLL code as well and compare the two methods.

plot2: zoom in of the first figure.
Quote: |
Quote: |
This is overdoing it. Please just post the existing beat data somewhere and I can show you how to do it easily with a few lines of matlab code. Then you can go back to your usual noise hunting.
|
Here is the demodulated beat signal, with 32kHz sampling rate, 120 second time strecth. I used SR560 to amplify the demod signal so that pk-pk value is ~10 000 counts. The data is store in demod.data with a signal column .
|
|