AnsweredAssumed Answered

Copying samples to ioo_buffer structure

Question asked by marcinsztajn on Oct 17, 2016
Latest reply on Oct 18, 2016 by pcercuei


I am working under application to streaming data using libiio libraries. My hardware contain ZC706 and FMCOMMS3 boards. I have a problem to uploading my samples after modulator to iio_buffer structure. I did not know in which format should they be stored in memory. I want to use dump memcpy() function to copy samples from modulator to iio_buffer. Modulator throws complex data, I am able to split it to I and Q samples but when I am using iterating over loop:

   for (p_dat = iio_buffer_first(txbuf, tx0_i); p_dat < p_end; p_dat +=p_inc) {   
            ((int16_t*) p_dat)[0] = tab_i[i];
            ((int16_t*) p_dat)[1] = tab_q[i];


Spectrum of my test wave is crashed.

Can somebody tell me is there any chance to copy my own samples to iio_buffer and see correct results on spectrum analyzer?

I want to admit that while copying I and Q samples while creating buffer with enable cyclic option, I could see my tone on the spectrum as well but while doing this in the loop (updating samples on my own) everything is crashing.

Thanks in advance.