AnsweredAssumed Answered

ad9361-iiostream print received samples

Question asked by suranga on Jan 29, 2018
Latest reply on Jan 29, 2018 by larsc

I got this example to work on my zc706 fmcomms3 and trying to do some modifications so that I can read the received samples. So I modified the relevant code in the following way.

 

for (p_dat = (char *)iio_buffer_first(rxbuf, rx0_i); p_dat < p_end; p_dat += p_inc) {
            // Example: swap I and Q
            const int16_t i = ((int16_t*)p_dat)[0]; // Real (I)
            const int16_t q = ((int16_t*)p_dat)[1]; // Imag (Q)
            ((int16_t*)p_dat)[0] = q;
            ((int16_t*)p_dat)[1] = i;

           //print received sample
            printf("\tI %d, Q %d \n", i, q);
        }

 

I was expecting to see zeros in the output, as this example fills the tx buffer with zeros . However what I am getting is a sequence like this.

   ...................

   ...................

   I -344, Q -527
    I -340, Q -531
    I -338, Q -532
    I -347, Q -526
    I -351, Q -525
    I -344, Q -527
    I -349, Q -527
    I -354, Q -524
    I -356, Q -523
    I -361, Q -519
    I -352, Q -523
    I -358, Q -524
    I -358, Q -521
    I -356, Q -523
    I -352, Q -525
    I -354, Q -521
    I -363, Q -520
    I -358, Q -521
    I -352, Q -526
    I -361, Q -521
    I -367, Q -515
    I -364, Q -519
    I -363, Q -517
    I -366, Q -518
    I -366, Q -519
    I -366, Q -517
    I -366, Q -517
    I -366, Q -518
    I -365, Q -517
    I -367, Q -517
    I -361, Q -519
    I -364, Q -518
    I -373, Q -512
    I -376, Q -511
    I -371, Q -513
    I -372, Q -513
    I -372, Q -514
    I -374, Q -512
    I -373, Q -513
    I -372, Q -515
    I -379, Q -510
    I -378, Q -510
    I -374, Q -513
    I -373, Q -511
    I -376, Q -510
    I -381, Q -508
    I -377, Q -510
    I -380, Q -510
    I -386, Q -505
    I -381, Q -506
    I -388, Q -506
    I -383, Q -504
    I -387, Q -508
    I -380, Q -504
    I -379, Q -512
    I -378, Q -507
    I -388, Q -506
    I -396, Q -497
    I -392, Q -499
    I -389, Q -503
    I -388, Q -503
    I -392, Q -499
    I -394, Q -501
    I -393, Q -499
    I -396, Q -499
    I -400, Q -495
    I -395, Q -498
    I -390, Q -503
    I -389, Q -499

 

 

   ...................

   ...................

  

Is there anything that I am missing here? What must I do to correctly record the samples?

 

-Suranga

Outcomes