This week there wasn't that much that was worked on. The main thing was getting the logging system for raw data streams up and running. Because of the changes made in #90 and b4156fb we can set constellation to stream raw ADC and filter data to a computer over USB. Last week I just got a basic stream working and left it at that, but this week I worked mainly on the host side.
In pico-constellation under scripts there is now a record.sh and an updated record.py. The script simply starts up the python virtual environment and then starts the python script. The python script stars up a couple threads: one that waits for a device to connect to /dev/ttyACM0 and then reads from it and stores the data in a queue. The other thread processes that stream of data. The main thread then graphs it at about 480Hz. I got the data streaming over and ran it. Aaaaaand... garbled data. The data was somewhat correlated to when audio was coming over the line but it more or less didn't make any real sense. This is because just like any other communication medium, UART needs the data to be synced. Fortunately this is a pretty easy fix. Similarly to what we do in constellation in the byte assembler, we needed to have a sync word that would let us re-align our incoming byte stream. A simple 2-byte 0xABCD was added to the beginning of every packet (since that was easy and we have plenty of bandwidth) and a little synchronizer on the python side and there we go, a nice clean stream of ADC and filter data being graphed using python.
TLDR; make sure to have a way to synchronize asynchronous data streams.