安诺尼实时频谱分析仪如何使用MATLAB进行二次研发(5)

发布时间:2022/11/4 14:57:00

1.png

6、安诺尼实时频谱分析仪二次研发的数据端点(Data Endpoints)说明

Single Samples
Polling single samples from the server block input is performed with the “/sample” endpoint. This can easily be tried using a standard web browser http://localhost:54664/sample :

2.jpg

The result will contain one or no samples.
Receiving multiple samples can be achieved using the “/samples” endpoint. The number of samples can be controlled with the “limit” argument e.g. http://localhost:54664/samples?limit=1000 will try to capture 1000 samples or spectra. The result will be an array of sample objects.
The “input” argument may be used to select a different input than the “main”.
Stream Data
Another option is the use of streaming with a chunked transfer setting using the “/stream” endpoint. The data is transmitted as line limited JSON. Each sample packet is encoded as individual JSON data separated by a line feed (ASCII 10) and a record separator (ASCII 30) character.
The stream can be limited to a maximum number of samples using the limit argument: http://localhost:54664/stream?format=json
Additional optional arguments are “rate_reduction=n” to reduce the number of samples transmitted by a factor of n. Automatic rate adaption can be disabled by using “rate_adaption=0”.
The “input” argument may be used to select a different input than the “main”.

Alternative Inputs
Some connectors provide more than one stream. The “input” argument of the sample and stream endpoint is used to select this stream. The “inputs” endpoint returns an array of available inputs.
{"inputs":["main","{3b459e11-74e1-4b82-88ad-28459dfe2fe1}"]}
New inputs can be created based on existing inputs with a post request to the inputs endpoint. The argument is a JSON document with the following fields:

3.jpg

The result is a JSON document that provides the name of the new input. Available types are:

4.jpg

Each input does also provide a set of configuration parameters. The input endpoint together with the input parameter can be used to query the current settings (see configuration data).
Raw Data Format
High data rates of e.g. raw IQ data cannot be achieved using JSON formatted arrays (at least not in a compute efficient way). The combined raw format transmits alternating pairs of JSON meta data and binary sample data as 16bit signed integers or 32bit floats. The binary part starts behind the record separator character. The “samples” element of the JSON meta data contains the number of samples (e.g. spectra or IQ pairs). This format is not available for e.g. structured data.
The float data is requested using the “raw32” format and the integer data using the “int16” format. A scale value is provided in the JSON metadata section to convert from the integer format to float values;
The RTSA HTTP server block will start dropping data when the outbound TCP buffer exceeds 8 Mbytes. A loss of data can be determined by comparing the timestamps of two adjacent data packets.

《安诺尼实时频谱分析仪如何使用MATLAB进行二次研发》的相关内容将以连载的方式进行更新,这是连载的第5期,感谢您的阅读。