I want to use the output of an 125MHz DAC to generate dither on the input of my ADC (Redpitaya). I have many questions but first, the background :
I have to measure with the highest precision the phase between two low frequency sinusoidal signals. During the measurement, the frequency is constant, but can differ from one measurement to the other, from 0.1Hz to 100Hz.
The idea is to filter the analog signal far below fs/2 to reduce the noise after the band of interest (0.1 to 100Hz), then oversample the signal with the high frequency ADC, digital filter the signal with the FPGA and decimate. After that, I already have an algorithm to compute the phase based on the data I will get.
The goal would be to have the closest representation of my sinusoidal signal at the output of the ADC.
The questions :
- Should I put the dither before or after the "hard" filter? If after, I think I have to filter with a lowpass filter with a reasonable attenuation at fs/2?
- What should be the band of the noise?
- Is it ok if the rms value of the noise is 1/2 LSB?
- Do I have to generate only one random number at a time? (I saw the addition of two noise source would improve the quality of the dithering? Even if generated digitaly?)
- Do I have significant improvement if I substract the random number after the AD conversion?
I hope my english is good enough for you to understand my questions ;-)
Thank you very much!
The sinusoidal signals for which you want to measure the phase is contained in same channel or they are acquired through two different channels ?
Let me assume they are same freq and acquired in different channels. then i would take the direct/simplest approach:
1. as you mentioned acquire data at higher sampling rate.
2. apply complex mixing so as to bring the signal into complex IF.
3. compute theta from the sin and cos.
4. repeat the same for the other channel
5. subtract the two values obtained from 3 and 4 to get the phase difference.
hope it helps.
Thank you for your proposition. Yes, both input signals are acquired with a different channel simultaneously.
I never worked with mixing but I Just read the theory on this site. And saw that it consists of shift a band of frequency thanks to the fact that multiplying two signals in the time domain convolute them in the frequency domain.
Perhaps a dummy question : mixing can take place in the discrete time domain ?
What direction would be the shifting ? Is it more accurate than finding the peak in the fft and then compute the arctan of img /real at this position ?
What about reducing the quantisation noise with dither ?
Thanks a lot for the support
Let me try if I can help you with your Qs:
>> Perhaps a dummy question : mixing can take place in the discrete time domain ?
Yes. possible in discrete time domain as well as in (quantized) digital signal. and possible to apply z-domain analysis and other equivalent.
>> What direction would be the shifting ? Is it more accurate than finding the peak in the fft and then compute the arctan of img /real at this position ?
the output of the mixer will have both difference and sum. putting a LP filter give the lower IF. you can think of this as classical heterodyne mixing. computing moving average will give you a low cost LP filter. if your plan is to implement on FPGA, a CIC should be more efficient.
>> What about reducing the quantisation noise with dither ?
here, unlike in ST-FFT, the impact of quantization would manifest differently. So please try the approaches in matlab/octave before writing target code.
if you find the accuracy if not fine, you can also try other efficient and accurate ways. some examples are CZT, ZoomFFT. or Geortzel. since you're looking only one single frequency/very narrow frequency the above will help you focus on your area of interest and scale accuracy without necessarily increase the order of FFT.
Hi Chalil,Many thanks for your suggestions. I even didn't knew about the Chirp Z-tranform, nor about the Geortzel algo nor about the ZoomFFT !
It means I will have to spend time reading litterature on these topics. It sounds promising.
I will take time to build a first implementation using Octave, I will feed it with real data from my board.
Again, I thank you for these advices.
Incredible how accurate can be phase measurement based on the czt. This is even better than with my complex algorithm! Good to know. This is now one of my best friends :)
What is your sample rate ?
What is your ADC's ENOB ?
What is the "signals of interests" level in bits of your ADC ?
How do you extract the phase difference ?
Can be anything from DC to 125MHz (redpitaya default sampling rate but can omit a few values to decrease Fs)
No idea. The RP ADC has 14bit. No more data on this ADC yet. I will search for more info later since it is a private project
Full scale idealy
Frequency interpolation, then Least square algo with a sin as ref for both signals, which gives out all sinusoidal params.
The goal is to get the best results that are possible to get with such a system (RP 14bit 125MSPS)
If you have a 14bit, 125MSPS ADC, then it has way more than 1LSB of noise. It's been a good long while since I've worked on this stuff, but if the noise has a sigma of less than 5LSB I'd be surprised.
On the minus side -- noise.
On the plus side -- it's dither, brought to you by the ADC manufacturer, it's in exactly the right place for your purposes, and it costs you absolutely nothing extra.
So throw away the DAC, and carry on with your plan to oversample and decimate.
Note that even without dithering or noise, just sampling a sine wave in multiple points will "dither" your signal, and sampling across a number of cycles that are not exactly synchronized with some sub-harmonic of your sampling rate will also add effective dither. So you have two reasons for not needing the DAC.
Thank you for this answer, I will then trow away the dither generator and see what is the result.