# Using Cross Corelation to lower influence of ADC for DAC measurements

Look at the Zurich Industrie paper
which explains how the correlation integral is done in the time domain.

attached is the equation.

We see that to do the correlation in time we slide
one signal with respect to the other.

If you reverse the phase of the signal, you will not
change anything, you will always have to slide the signals.

Phase slide to calcul correlation time function

In fact, what is done is the Fourier transform
of the correlation in time which gives "by chance"
the denoised FFT.

Last edited:
Flipped polarity in on channel (of the common noise, not the payload signal)
How would it be possible to invert only the common mode noise? The input doesn't know what is noise and what is signal.

But correlated means identical phases for the frequency component in question. Flipped polarity in on channel (of the common noise, not the payload signal) is not the same identical and should cancel out, actually it should be the best case for cancelling.

Could anyone with better math skills verify this?
Correlation is a time function ,it is for that you can do FFT .
You tell identical phase = correlated , Yes = 1 , it is one point off correlation function(max correlation)
But to calcul cross correlation function you shift one input by the other , so , we

Last edited:
Just realized that the screen shot I posted was comparing cross-correlated vector average to a non-vector average, which likely explains the larger (relative) noise floor reduction.

I used 48k signal, 128k FFT size, and Chebyshev 200 window. A -170dB visual floor in an FFT isn't the noise floor of the device. You need to sum up the noise contribution from all the FFT bins to measure the actual noise level. This DAC, as previously measured, has about a -130dB noise floor (unweighted) and a THD+N of -127dB at 1kHz/0dBFS.
How time is your signal , it is possible for you to put *.wav for i can compare in my side ??
If is not too big
Thank

How time is your signal , it is possible for you to put *.wav for i can compare in my side ??
If is not too big
Thank

I didn't have the recording from yesterday, but this should be similar: https://we.tl/t-KzWymSK46j

How would it be possible to invert only the common mode noise? The input doesn't know what is noise and what is signal.
It not inverted, rather the payload signal is inverted in one channel. But for processing we invert one channel again so now the signal is in-phase and the common noise is out of phase.
I'm using that feature already with REWs pseudo-balanced option and a splitter with one channel inverted. It reduces even order distortion and any common mode noise on everthing downstream of the splitter by averaging it out.

What I mean is when we go back to @NTK 's analysis in post #57 then the out-of phase noise part (of what was common noise of the ADC originally) would mean its corresponding x1+jy1 and x2+jy2 error terms are no longer independent, rather x2 := -x1 and y2 := -y1 (complex error term "rotated" by 180deg == multiplied with -1).

Key point is this statement in the analysis:
"The error of the magnitude square due to the noise is a(x1+x2) + b(y1+y2) + x1x2 + y1y2."

Which would yield a new error of a(x1-x1) + b(y1-y2) -x1^2 -y1^2 = -x1^2 -y1^2 which would mean a very low error, almost cancelling out... unless I'm totally off track here, of course.

I am not shure
See results on synthetic signal
Seems to work for me. Effect is most easily seen with open inputs, eliminating most common mode content. Measurement titles below show total input rms level for the various tests, starting with an rms average as a reference.

x1+jy1 and x2+jy2 error terms
Those represent the unknown and uncontrolled noise present on each input. They can't be altered but if they meet the assumption of being zero mean and uncorrelated with each other the associated terms in the cross correlation output will average to zero over time.

Seems to work for me. Effect is most easily seen with open inputs, eliminating most common mode content. Measurement titles below show total input rms level for the various tests, starting with an rms average as a reference.

View attachment 385128
what would you get with longer fft's comparable with the number of samples processed in total?

It not inverted, rather the payload signal is inverted in one channel. But for processing we invert one channel again so now the signal is in-phase and the common noise is out of phase.
@KSTR
Do I get you right, that you want to feed the 2 differential inputs of the ADC with the identical signal (y-cable), but with pin 2 and 3 reversed on one input. Any systematic nonlinearity of the ADC would show up differently in the converted data. Inverting the data of the reversed channel again (in SW) would be the input to the cross-correlation.

The idea is, that polarity dependent differences in the ADC would get minimized by the cross-correlation in this case. Also e.g. limit cycle related spurs are likely to be different and get reduced.

Have I got your idea right?

Last edited:
I didn't have the recording from yesterday, but this should be similar: https://we.tl/t-KzWymSK46j
It is a very quality DAC
All do with 32k samples , window BH7

What is your measure configuration ?

What your file is in 64bits ?

#### Attachments

• resultRightChannel.png
37.5 KB · Views: 35
• resultCorrel.png
47.8 KB · Views: 34
• result_In_dBFS.png
37.2 KB · Views: 37
• resultLeftChannel.png
36.5 KB · Views: 31
Last edited:
It is a very quality DAC
All do with 32k samples , window BH7

What is your measure configuration ?
May I ask you to measure without weighting ?
It's a detail for sure, but this kind of measure is always unweighted here.

what would you get with longer fft's comparable with the number of samples processed in total?
FFT length doesn't affect the rms input level, so still -92.7 dBFS, but here is a plot with a long FFT:

Those represent the unknown and uncontrolled noise present on each input. They can't be altered but if they meet the assumption of being zero mean and uncorrelated with each other the associated terms in the cross correlation output will average to zero over time.
@KSTR
Do I get you right, that you want to feed the 2 differential inputs of the ADC with the identical signal (y-cable), but with pin 2 and 3 reversed on one input. Any systematic nonlinearity of the ADC would show up differently in the converted data. Inverting the data of the reversed channel again (in SW) would be the input to the cross-correlation.

The idea is, that polarity dependent differences in the ADC would get minimized by the cross-correlation in this case. Also e.g. limit cycle related spurs are likely to be different and get reduced.

Have I got your idea right?
Let me put in another way.
Say S is the signal we want to measure, and U1 and U2 are the uncorrelated random noises of the ADC channels, and C the fully correlated (in-phase) common ADC error, like for example mains hum ingress to both channels.

With the normal way, CC would only reduce U1 and U2 in the output, but C cannot be distinguished from the signal S and thus sees no reduction, it's part of the signal.

Now lets wire one channel inverted so that we have
CH1 = +S + U1 + C, and
CH2 = -S + U2 + C.
Then CH2' = -CH2 = S + U2 - C, and CH1 = S + U1 which is what would be the actual inputs for CC.

We know that U1 and U2 would be reduced just as before as they remain fully uncorrelated when one sign is flipped.
But what happens to the S term which appears fully out of phase when it undergoes the CC averaging process?
With normal time-domain or vector average across channels it would fully cancel, but does it as well with CC averaging?

In simpler terms, what happens to the CC averaging output if the ADC channel input signals are identical except for polarity? Does it (partially) cancel?

OCA
Could you try it with an AP multitone 32 signal ?
That would bring huge benefits vs the notch...
Do you mean like this? blue=32 non-vector averages, red = 32 cross-corr vector averages (192kHz, 1M FFT with Chebyshev 200 window):

Seems to work for me. Effect is most easily seen with open inputs, eliminating most common mode content. Measurement titles below show total input rms level for the various tests, starting with an rms average as a reference.

View attachment 385128
What equation did you take
I think I can do your manipulation to confirm,
I still have my noise file on the E1DA adc.

Do you mean like this? blue=32 non-vector averages, red = 32 cross-corr vector averages (192kHz, 1M FFT with Chebyshev 200 window):

View attachment 385138
That could give us another measurement metric with high added value, IMO.
Actually, one measurement for TD+N and noise, but with much higher resolving power than today -since today we are relying too much on the ADC quality.

If that's working, I see that as a game changer.

Replies
16
Views
2K
Replies
20
Views
2K
Replies
17
Views
3K
Replies
186
Views
55K
Replies
16
Views
5K