# How to measure correlation between 1 bit samples and theoretical original waveform?

I'm investigating quantization error.

I have an analogue waveform that looks like this and is of theoretically infinite resolution:- I've sampled it as (8 bit oscilloscope readings & 0b1) to produce a file of single ones or zeros. The samples are partially random as per quantization theory, but I want to check the correlation with the analogue original. Theory suggests that there should be some correlation.

How can I do that? Clearly I can't compare the 1 bit samples with the 8 bit samples they came from.

Put another way, how can I show that my quantization is entirely uncorrelated to the underlying waveform?

Edit & maybe a solution:-

St is the theoretical and perfect(!) signal.

S1 is my sample set as (scope reading) & 0b1.

S2 is another independent sample set as (scope reading) & 0b1.

It occurs to me that I can't possibly compare S1 with St, as quantisation error will be present in both sets. But, if S1 ~ St, then by inference S2 ~ St. Hence I can test the hypothesis that S1 ~ S2 since they're both derived from common signal St. If there is a correlation, then S1 must be correlated to St too.

So I can just use normal correlation analysis (or Hamming distance, Jaccard index) between S1 and S2 to measure any. Yes/no?

• with & 0b1, you're extracting the least significant bit position. Is that your intention? Why can't you "clearly" compare these, what's the problem there? Jan 14, 2021 at 12:23
• @MarcusMüller My understanding of quantisation theory is that the quantisation noise/error (my bits) is somewhat correlated to the waveform in the case of a regular waveform. I can't compare them with the original as that's a 100% fit because one is derived directly from the other. Jan 14, 2021 at 13:08
• That't not the quantization noise/error! That would be $V_{digitized}-V_{actual}$, and you don't know the latter. Jan 14, 2021 at 15:01
• @MarcusMüller You're right! So what would I call that single bit stream? I'm interested in the randomness of those bits. I can then amend the question... Jan 14, 2021 at 15:59
• That's the least significant bits coming from the scope. Jan 14, 2021 at 16:26