How to Generate RF Tone from SDRAM or onboard memory

Hi all, I am new in using the LimeSDR. I want to use the limeSDR to generate a single tone or multi-tone by IQ data. Currently I am using streaming to send the IQ data to limeSDR, but once I stop streaming, the RF tone would gone, so I need to keep streaming the IQ data to hold the RF tone.

What I am thingking is that, once I stream the IQ data to limeSDR, the IQ data would be stored in the SDRAM, so I don’t need to stream the same IQ data again, but I really don’t know how to do that? How to generate the RF tone from SDRAM and repeat this operation for ever until I stop the program?

Any idea/example/documents would help, Thanks.

1 Like

Hi,
what do you use to stream data?
if you use LMS API then with LimeSDR-USB you can try to use:

LMS_UploadWFM(lms_device_t *device, const void **samples, uint8_t chCount, size_t sample_count, int format);

format should be 2 - for float data, and 1 - for int16 data
sample count must be multiple of 4

and then

LMS_EnableTxWFM(lms_device_t *device, unsigned chan, bool active)

1 Like

Hi IgnasJ,

Thanks for the reply, it’s working now base on your suggestions. Some more question:

  1. according to “limesuite.h”, I found the data format as below, which is different from your setting. Actually, your setting is corrent, I just wonder how do you get this setting? From which file?
    enum
    {
    LMS_FMT_F32=0, ///<32-bit floating point
    LMS_FMT_I16, ///<16-bit integers
    LMS_FMT_I12 ///<12-bit integers stored in 16-bit variables
    }dataFmt;

2)The RF tone is working , but I got a very high noise floor, the signal quanlity is poor, is there any other settings I need to set ?

3)How to clean up the waveform memory? Should I do that before re-writing the waveform memory?

  1. I looked at https://github.com/myriadrf/LimeSuite/blob/master/src/API/lms7_api.cpp#L814 and saw that values do not match the format enum that is used for stream, so I specified what you should use to avoid problems.

  2. When uploading a tone make sure that you upload full period so there is no sudden jump when it is played in loop. Also, sometimes waveform uploads incorrectly when high sample/data rate is set, so you can try to set lower sample rate before uploading waveform and then set required sample rate after upload.

  3. Just upload new waveform, it will overwrite the old one.

2 Likes

Hi IgnasJ,

For the second question, your suggestion is amazing. It really help me solve the problem. Thanks again and a lot.

Hi @eleday,

I am also trying to generate a single tone sine wave at 2.47 GHz. Can you please tell me how you generated the I and Q data?
Also what registers I have to configure. I would appreciate if you could share the settings as well Thanks.

farhan296,

If you just want to generate the single tone, it would be very easy. You can set LO = 2.47GHz, and then make I = 0.5, Q = 0, or I = 0, Q = 0.5. Why the value is 0.5, because if you set it to 1, it will cause the output out of amplitude range

There are some documents and example , Try those example first, it will help you setup the settings.
https://github.com/myriadrf/LimeSuite/tree/master/docs
https://github.com/myriadrf/LimeSuite/tree/master/src/examples

1 Like

@eleday Thanks. Can you share any sample configuration file? i am not sure what registers to configure. Also I do not want any modulation.
I always see lower sidebands and LO leakage. I am not sure what settings I have to do to supress all these.

Hi farhan296,

I create s sample code for you, please check below link. It was ceated by using VS2015.
https://github.com/eleday/LimeSDR_SingleToneGeneration/blob/master/LimeSDR_TX/SingleToneGeneration.cpp

@eleday Thanks alot. I will take a look at it.

Hi @eleday,

If you have some spare time, can you please share the output plot of the code you shared with me? I am interested in individual I and Q, FFT and IQ constellation.

I am not sure what to expect at the output. Since we are not using NCO and provided the carrier will be completely removed by the analog side mixer on the Rx side, I should be expecting a single point in the constellation. Thanks.