jledet / waterfall

HTML Canvas Waterfall Plot
MIT License
81 stars 28 forks source link

json data structure for websocket #6

Open isemann opened 2 years ago

isemann commented 2 years ago

Dear Jeppe, I like your waterfall implementation very much and have connected it to an FFT stream from the LimeSDR. I am struggling with the json structure required by the script, could you share that ? thanks a lot in advance brgds Bernhard

r4d10n commented 2 years ago

The JSON structure is quite simple as shown here : https://github.com/jledet/waterfall/blob/885cb7bfd56ac1969e7c2a219819609a6ee8d0e6/script.js#L17

The spectrum data is sent in this format, with number of data points corresponding to the FFT bin count:

{"s":[-44,-46,-47,-49,-53,-51,-46,-46,-46,.................,-49,-44]}

Tuning parameters like "center" Frequency and "span" are sent independently during websock init or can be called when dynamically changing the frequency.

https://github.com/jledet/waterfall/blob/885cb7bfd56ac1969e7c2a219819609a6ee8d0e6/server.py#L38

For dynamic changing of parameters from keyboard and PlutoSDR support, you can check out my fork

isemann commented 2 years ago

Thanks a lot!