# MATLAB AD9361 HIL EXAMPLE QUESTIONS

Question asked by chaoloveai on Sep 10, 2015
Latest reply on Sep 10, 2015 by dpu

I use the ZEDBOARD AND fmcomms3 Eval Board . When I use ADI fmcomms2_3_data_stream example in the MATLAB 2014b 。I don't get the ideal sine wave .Below is the picture. Could you show me how to solve this problem? Thank you .

clear;

clc;

s = iio_sys_obj_matlab; % Constructor

s.in_ch_no = 2;

s.out_ch_no = 2;

s.in_ch_size = 8192;

s.out_ch_size = 8192;

s = s.setupImpl();

input = cell(1, s.in_ch_no + length(s.iio_dev_cfg.cfg_ch));

Fs = 30.72e6;

Fc = 1e6;

t = 1/Fs:1/Fs:s.in_ch_size/Fs;

for i=1:s.in_ch_no

input{i} = sin(2*pi*Fc*t+(i-1)*pi/2)*1024;

end

input{s.in_ch_no+1} = 2.4e9;

input{s.in_ch_no+2} = 30.72e6;

input{s.in_ch_no+3} = 18.0e6;

input{s.in_ch_no+4} = 'slow_attack';

input{s.in_ch_no+5} = 0;

input{s.in_ch_no+6} = 'slow_attack';

input{s.in_ch_no+7} = 0;

input{s.in_ch_no+8} = 2.4e9;

input{s.in_ch_no+9} = 30.72e6;

input{s.in_ch_no+10} = 18.0e6;

output = cell(1, s.out_ch_no + length(s.iio_dev_cfg.mon_ch));

for i = 1:5

output = stepImpl(s, input);

end

s.releaseImpl();

figure % new figure

ax1 = subplot(2,1,1); % top subplot

ax2 = subplot(2,1,2); % bottom subplot

plot(ax1,output{1});

title(ax1,'I');

xlabel('Sample');

ylabel('Amplitude');

plot(ax2,output{2});

title(ax2,'Q');

xlabel('Sample');

ylabel('Amplitude');