How do I calculate the power density spectrum if the measured phase has a constant drift?
Phase drift detrend with power density
-
Moku:Go
Moku:Go Arbitrary Waveform Generator Moku:Go Data Logger Moku:Go Frequency Response Analyzer Moku:Go Logic Analyzer & Pattern Generator Moku:Go Oscilloscope & Voltmeter Moku:Go PID Controller Moku:Go Spectrum Analyzer Moku:Go Waveform Generator Moku:Go Power Supplies Moku:Go Digital Filter Box Moku:Go FIR Filter Builder Moku:Go Lock-in Amplifier
- Moku:Lab
- Moku:Pro
- Python API examples
In some circumstances, it's not possible to synchronize Moku:Lab onboard clock with the frequency synthesizer in the system. The measured phase trace has a constant drift.
This can be fixed by a linear detrend process before the power spectrum density (PSD) calculation. In Python, the detrend can be performed by adding a detrend='constant' option in the scipy.signal.welch function. In MATLAB, a similar process can be done with a first-order detrend function, before the PSD calculation.