Open bkatiemills opened 8 years ago
I'm not sure about the GRIF-16s, but the 4Gs actually output two 14 bits waveform samples in that word. And this word will be repeated multiple times to give the full waveform. If you wanted to you could actually display the waveform as a graph, but keep in mind that most data comes without the waveform word.
Sure, we'll have to decide when the waveform word is actually there - but assuming it is, how do I translate those bits into that graph?
I think they are just sequential values for the waveform, so you would just line them up in the order they are written, with integer x-values.
The way the data parser stores the waveforms indicates the the 14 LSB form the first waveform sample, and the 14 MSB form the second waveform sample. Both waveform samples are signed, so if the MSB of that waveform is set, it's a negative value (using two's complement). So you can just use a vector to store the waveform samples and push them back onto the vector (LSB first, MSB second) and then draw the vector values vs. the vector index.
OK, so if I understand you correctly, a type VIb word 0xC1110111
implies the first waveform sample was 00111111111111
and the next waveform sample was 11111111111100
, and these should be parsed as signed integers.
If so the docs need to change, there is no indication of there being two samples in one word there.
Thanks both!
Word VIb contains a 28-bit waveform sample, but the docs don't describe how to unpack this into anything more meaningful than an integer. Are there things we can do to make this number more human-readable in the data spy?