Description
I want to manually generate a waveform file(*.wv) with Python that I can later load to my vector signal generator.
I want to manually generate a waveform file(*.wv) with Python that I can later load to my vector signal generator.
In order to generate a *.wv file manually you need the I and Q data of your waveform and the sampling frequency(clock) with which the signal is sampled.
In this easy example a clock of 10 MHz and a I/Q sequence of 20 samples is used.
In the header of the waveform file the so called tags are inserted. The tags TYPE, CLOCK, LEVEL OFFS and WAVEFORM are mandatory for each waveform.
All other tags are optional and can be inserted after the TYPE tag in arbitrary order.
The numeric range between –1.0 and +1.0 of the I and Q data corresponds to the modulation range of the waveform 16-bit D/A converter of -32767 to +32767.
This 16 bit signed integer numbers have to be converted to the resulting I and Q values represented in hexadecimal Little endian format.
Then the data has to be inserted in binary format into your WAVEFORM tag with the following structure:
After running the above code the generated file can be opened with the R&S ARB Toolbox and delivers the following waveform. Comparing the I and Q data from the Python code, one can see that the data has been generated correctly.
References:
SMBV100B User Manual
https://www.rohde-schwarz.com/produkte/messtechnik/vektorsignalgeneratoren/rs-smbv100b-vektorsignalgenerator_63493-519808.html