GRIFFINCollaboration / data-spy

an online parser of raw GRIFFIN data
http://griffincollaboration.github.io/data-spy
MIT License
1 stars 0 forks source link

waveform sample #3

Open bkatiemills opened 8 years ago

bkatiemills commented 8 years ago

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?

VinzenzBildstein commented 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.

bkatiemills commented 8 years ago

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?

SmithJK commented 8 years ago

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.

VinzenzBildstein commented 8 years ago

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.

bkatiemills commented 8 years ago

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!