How to use quantization data properly?



I’ve read about OSC Paths here. It is said: "To get the real (estimated) EEG value, multiply by this number."
Do quantization values come immedeately after EEG values that shoud be multiplied?
Or one should apply them to several EEG data samples?


Hi runner,

AFAIK, the quantization packet applies to all the eeg packets following it until the next quantization packet. I’ll double check and get back to you if it turns out I’m wrong.

By the way, when the data is quantized, it becomes significantly less useful in terms of containing any actual information. So in general, the presence of any quantization is most useful as an indication that your signal quality is poor. You can still try to use the data if you want, but just know that it is somewhat compromised.



Now I’m trying to write parser for compressed EEG Packets. I’ve found explanation here. But still I don’t understand the last part of the algorithm:

// After parsing, compute actual sample values:
deltas = (quotient * median + remainder) * sign * quantization
for each quotient in set
        Add delta to previous sample to get next sample
The final sample should be stored as the starting values for the next compressed EEG packet.

Could you explain me what I should do after finding all diffs?



So once you have a list of differences, you can reconstruct the original values.

As a baseline to start from, use the “heartbeat” message that gets sent out periodically to avoid drift, it’s an actual sample of EEG.

e.g. if your heartbeat value is 7 and you have these deltas: 5, 10, 2, -14

then your original values are 12, 22, 24, 10


So I’ll get 16 samples for each channel?


Tom, thanks again for your help. I’ve finally got it.