AnsweredAssumed Answered

AD9361 libiio sine wave transmission problem

Question asked by tugcey on Oct 20, 2016
Latest reply on Oct 27, 2016 by larsc

We are using an AD9361 on an FMCOMMS3 board. We are able to transmit and receive sine waves at various frequencies using the MATLAB interface. However, we're having a problem with the sample libiio code in C. 

 

Starting with ad9361-iiostream.c, we make the following modifications

- TX frequency = RX frequency = 2.405 GHz

- TX sample rate = RX sample rate = 30.72 MHz

- TX bandwidth = RX bandwidth = 18.0 MHz

 

We fill the transmit buffers with a 3.0 MHz sine wave as follows. 

 

float freq = 2.0 * M_PI * 3.0e6;
double ampl = 32767;

double i = 1. / txcfg.fs_hz;

for (p_dat = iio_buffer_first(txbuf, tx0_i); p_dat < p_end; p_dat += p_inc) {
short ipart = ampl * sin(freq * i);
short qpart = ampl * cos(freq * i);

((int16_t *)p_dat)[0] = ipart;
((int16_t *)p_dat)[1] = qpart;

i += 1. / txcfg.fs_hz;
}

 

We use the same receiver code as in the example and simply save the received data to a file. The only thing we get is a DC component + noise, not our signal. Do you have any advice? Thanks. 

Outcomes