Forum
Please or Register to create posts and topics.

How to use the SPECTRAN V6 via Matlab

PreviousPage 4 of 5Next

That's very simple.

Check the Missions-Folder e.g. https://v6-forum.aaronia.de/forum/topic/simple-iq-file-to-tx/ (Use the FileSource block instead of the FileReader)

Hello,

We were able to do something. We are unable to play any signal but there is signal at the output as set by the center frequency. The intended output signal is not present but there seems to be LO leakage.

Please advise on how to do the following:

  1. Generate required file (format) in Matlab. How to set the sampling rate and in what format should the file be (fixed point, hexadecimal etc)
  2. What is the difference between File Source and File Read
  3. Can a waveform be generated and stored in the hardware?
  4. Can this exercise be done through a stand-alone exe (write C code and run it)?
  5. We also wish to acquire data. What is the flow for that. Also, how to set the sample rate, trigger and data length.
  6. Thank you.

Generate required file (format) in Matlab. How to set the sampling rate and in what format should the file be (fixed point, hexadecimal etc)

This is up to you. We can't help you on this. Please contact your Matlab support.

What is the difference between File Source and File Read

Please check the corresponding blocks:

https://v6-forum.aaronia.de/forum/topic/file-source-block/

https://v6-forum.aaronia.de/forum/topic/file-reader-block/

Can a waveform be generated and stored in the hardware?

No

Can this exercise be done through a stand-alone exe (write C code and run it)?

Sure but programming and implementation is up to you.

We also wish to acquire data. What is the flow for that. Also, how to set the sample rate, trigger and data length.

Check the various examples within this forum e.g. check the DLL examples at https://v6-forum.aaronia.de/forum/forum/dll-dynamic-link-library/

 

 

When I use the sample endpoint, or the samples?limit=1 endpoint, I get 65536 complex samples as a 1x131072 vector.

If I do samples?limit=X where X is some number greater than one, I get multiple sets of 65536 complex samples, but based on the startTime and endTime information of each (and also examining the data itself) they do not appear to be anywhere near contiguous.

Does anyone know how to get more than 65536 contiguous IQ samples from the http server hooked to the SpectranV6 IQstream1 output?  Or any other way that does not include file I/O to get more contiguous samples from the SpectranV6 into Matlab?

Thanks!

Best use the "/stream" endpoint to get actual streaming data. This also supports more efficient (binary) data formats, as converting numbers to text on such a scale is quite wasteful for both bandwidth and processing power, esp. if you need to convert it back for further processing.

Thank you for your response.  Starting from the RTSAGetIQandDoFFT.m example, I changed 'sample' on line 8 to 'stream?limit=1' to see what would happen.  I get a response.body.data back that is no longer a structure itself with a .samples underneath it, but is a 1098558x1 vector of uint8 values.  I am not sure what I need to do to convert that vector of uint8 values into I/Q samples in IQData so the rest of the example code with the FFT process will run.

The data should by default use the same format, only it's using MIME type application/octet-stream rather than text/json as it may contain binary values if you request a different output format. You can just access http://localhost:54664/sample and http://localhost:54664/stream?limit=1 in a browser to see the results directly (the latter one will be saved to a file as the browser won't know how to display application/octet-stream data, but you can just open that file in a text editor).

So you'll probably just have to explicitly tell Matlab to treat the data as JSON before accessing it, as specified in https://de.mathworks.com/help/matlab/ref/webread.html

Quote from mm_dev on 21/04/2022, 10:30

Best use the "/stream" endpoint to get actual streaming data. This also supports more efficient (binary) data formats, as converting numbers to text on such a scale is quite wasteful for both bandwidth and processing power, esp. if you need to convert it back for further processing.

Could you please say , how we can recive binary stream insted of TEXT/Json stream?

up to now  we ussed "127.0.0.1:54664 " , so wich parameter we have to add , for reciving binary stream ?

 

Could you please say , how we can recive binary stream insted of TEXT/Json stream?

up to now  we ussed "127.0.0.1:54664 " , so wich parameter we have to add , for reciving binary stream ?

http://localhost:54664/stream?limit=X&format=Y

X is the number of samples you want to receive per call (you can omit the limit parameter to get an infinite stream)

Y can be one of

  • json (this is the default)
  • int16 (you may want to also specify the "scale" parameter when using this to increase precision)
  • float16
  • float32

The metadata will still be JSON, just the sample values will use the specified binary format.

David3542 has reacted to this post.
David3542

Hi mm_dev, Admin_TC,

I am observing an issue (with matlab script)  with data samples received across multiple blocks/packets. The received data samples are not contiguous and broken.

I have followed above posts to generate streaming data.

Test signal is an exponent tone with 991Hz and is sampled at 61.44 MSPS. It is 10ms long ( Attaching matlab code as well). I am attaching the plots and Matlab codes for your reference. One can see that there is discontinuity from 49152th  sample to 49153th sample.

Two blocks of 49152 samples are concatenated

 

So,  these are the questions:

  1. How to ensure that there is no discontinuity between one block to another block?
  2. Why the startTime of packets are same across the packets (see the logs captured in the "991Hz_MatlabLogs.txt" )?

Additional information:

  1. newFileRead.m is the main file.
  2. AaroniaHTTP.m is the same file shared by the admin.
  3. expTone.m is the file that generates .mat file of 991 Hz.
  4. expTone_991Hz.mat to expTone_991Hz.wv conversion file is not attached, but  converted file - expTone_991Hz.wv file is attached (as expTone_991Hz.zip) file).

Thanks

Uploaded files:
PreviousPage 4 of 5Next