Producing Waterfall/Spectrogram in Lab View interfaced with RTSA Suite Pro
Quote from qureshi000 on 24/04/2024, 07:46I am using HiSLIP-SCPI Server Block for interfacing between RTSA Suite Pro and Lab View. I want to produce spectrogram plot (which looks like waterfall graph in RTSA Suite Pro) in Lab View from the data received from RTSA Suite Pro through streaming. I am using command "STREAM:DATA?" for that purpose.
Following was the reply I got from forums when I asked for how to stream data?Send a "STREAM:START" command, then continously request data with "STREAM:DATA?" (after optionally adjusting the settings to fit your needs). Parsing the returned data is a bit more complex:
It will start with a JSON formatted header that contains the parameters of the current packet (like start- and end-time, start- and end-frequency, payload type and measurement unit used). The header is then separated from the actual payload by a newline.
The payload will start with a hash sign (#), followed by one digit that denotes how many characters to read for determining the actual payload length in bytes. For example the payload may start with the string '#43408': the hash sign tells you that a length information follows, the first digit tells you that the actual length data contains four digits, which then results in a length of 3408 bytes of actual payload.
The actual payload will (at least in case of spectra data) be transmitted as binary float values of 32 bits length, so 3408 bytes contain 852 float values (this should match the "size" parameter in the header when dealing with spectra data). How to parse or process that data is then up to you (in python for example you could use 'struct.unpack("852f", data)' to convert it into an array of float values, but again we can't tell how that is handled in LabView).
Measurement values contained in the payload are evenly distributed across the frequency spectrum within the boundaries defined in the header.
I produced 852 floating values and plot spectrum in Lab View. But I do not how to plot waterfall graph (Spectrogram in Lab View) from the streamed data or what format is required to plot that graph. Kindly guide me.
First pic I attached is of waterfall graph produced in RTSA Suite Pro. Second pic is of spectrogram that is produced from 852f values in Lab View.
I am using HiSLIP-SCPI Server Block for interfacing between RTSA Suite Pro and Lab View. I want to produce spectrogram plot (which looks like waterfall graph in RTSA Suite Pro) in Lab View from the data received from RTSA Suite Pro through streaming. I am using command "STREAM:DATA?" for that purpose.
Following was the reply I got from forums when I asked for how to stream data?
Send a "STREAM:START" command, then continously request data with "STREAM:DATA?" (after optionally adjusting the settings to fit your needs). Parsing the returned data is a bit more complex:
It will start with a JSON formatted header that contains the parameters of the current packet (like start- and end-time, start- and end-frequency, payload type and measurement unit used). The header is then separated from the actual payload by a newline.
The payload will start with a hash sign (#), followed by one digit that denotes how many characters to read for determining the actual payload length in bytes. For example the payload may start with the string '#43408': the hash sign tells you that a length information follows, the first digit tells you that the actual length data contains four digits, which then results in a length of 3408 bytes of actual payload.
The actual payload will (at least in case of spectra data) be transmitted as binary float values of 32 bits length, so 3408 bytes contain 852 float values (this should match the "size" parameter in the header when dealing with spectra data). How to parse or process that data is then up to you (in python for example you could use 'struct.unpack("852f", data)' to convert it into an array of float values, but again we can't tell how that is handled in LabView).
Measurement values contained in the payload are evenly distributed across the frequency spectrum within the boundaries defined in the header.
I produced 852 floating values and plot spectrum in Lab View. But I do not how to plot waterfall graph (Spectrogram in Lab View) from the streamed data or what format is required to plot that graph. Kindly guide me.
First pic I attached is of waterfall graph produced in RTSA Suite Pro. Second pic is of spectrogram that is produced from 852f values in Lab View.
Quote from mm_dev on 24/04/2024, 09:24You will have a better chance to get a useful answer when asking this question in a LabView support forum, as this really has little to do with our software.
Also using a sample that contains an actual signal would help, looking at only noise data without any hard contrast makes it tricky to see if things work as intended. For all I can tell the green space could be a proper representation of the data you're feeding it (if all values are close together around -90 dBm).
Looking at the LabView image clearly it requires some information about the frequency distribution of the measurement values and the actual measurement unit to properly set up the x- and z-axis.
You will have a better chance to get a useful answer when asking this question in a LabView support forum, as this really has little to do with our software.
Also using a sample that contains an actual signal would help, looking at only noise data without any hard contrast makes it tricky to see if things work as intended. For all I can tell the green space could be a proper representation of the data you're feeding it (if all values are close together around -90 dBm).
Looking at the LabView image clearly it requires some information about the frequency distribution of the measurement values and the actual measurement unit to properly set up the x- and z-axis.