How to generate a .wfm file?

I want to generate an LTE TM3.1a signal to evaluate the 256 QAM EVM performance of LimeSDR. I can generate the TM signal use the LTE tool in MATLAB. What should I do to process the mat file to the wfm file?
Thanks!

We use the same 16bit big endian format as Keysight signal generators.
Here is typical octave/matlab code.

% Assuming x is a vector of complex numbers (I + j Q,…) with max amplitude |1.0|
% convert to interleaved integer vector (I,Q,…) and binary write as big endian 16 bit signed integer
fname=‘my.wfm’
buf=floor(32767*reshape([real(x);imag(x)],1,[]));
fid=fopen(fname,‘w’,‘ieee-be’);
fwrite(fid, buf, ‘int16’, ‘ieee-be’ );
fclose(fid);

Hi Danny,
Thanks for your code.
Above all, I can get the normal 10Mhz FDD TM3.1 spectrum using the LTE_DL_TM31_20MHZ.wfm provided by Lime.
However, I can’t get a normal wfm file using your code in MATLAB. I first generate a TM3.1 20MHz FDD signal in the wireless waveform generator tool. Then I give the waveform in generated structure to your code and feed the wfm file to the WFM loader. After I change the same sample rate as the generator (30.72e6), the LimeSDR output spectrum is not what I wanted.






I also try the TM3.1 wfm file using in my 5182A generator, the spectrum seems wrong too.

Sorry for the wrong picture.

Can you double check that your Matlab object is a vector of complex numbers, and that the amplitude is <=1.0 using abs(max(x)). Please note the waveform will be invalid if abs(max(x))>1.0. I have double checked my code with simple SSB example and keysight MXG signal generator and spectrum analyser, all is correct. Here is the full example:
fname=‘temp.wfm’;
x=0.99exp(i(322pi/4096)(0:4095))+0.01; % clock 30.72MHz, SSB with DC 40dB down.
x(1:10) % view sample of complex number format
abs(max(x)) % display peak amplitude of waveform, should be <=1.0
buf=floor(32767
reshape([real(x);imag(x)],1,[]));
fid=fopen(fname,‘w’,‘ieee-be’);
fwrite(fid, buf, ‘int16’, ‘ieee-be’ );
fclose(fid);

Hi Danny,
Your SSB sample just work fine.
I’m checking my code.

Hi Danny,
I transpose the variable generated by the wireless signal generator tool and it works fine.
However, I found another issue. I can generator a 30.72Msps single tone signal and play it with the LimeSuiteGUI. When I try to generate a 61.44Msps signal, the signal can be loaded in LimeSuiteGUI, but the output spectrum is strange. There are many glitches spread all the spectrum. In the meanwhile, the LimeSDR can’t update the sample rate and output errors:

[16:06:34] WARNING: SetPllFrequency: error configuring phase
[16:06:34] ERROR: LML TX phase search FAIL

Have you tested a signal with a 61.44Msps sample rate? My settings are like this:
image


And I also tried settings like this:


Thank you very much for helping!

61.44MS/s is too fast for USB3 link. Our LimeSDR-QPCIe and LimeSDR-PCIe solutions allow 61.44MS/s MIMO if you need this at baseband (e.g. digital predistortion). Otherwise, make use of interpolation and decimation to up the DAC/ADC rates. On LMS7002M, DAC can go up to 640MS/s and ADC can go up to 160MS/s. So x8 interpolation would give you 245.76MS/s at DAC, and x4 decimation would give you 122.88MS/s at ADC, whilst your USB rate would still be 30.72MS/s.

Hi Danny,
I can understand the USB3 speed throttle, but the LimeSDR can properly used in 61.44MHz bandwidth in several SDR app like SDR console, gqrx. Do you have any idea why that happened?
Thanks!