I am trying to use the ADRV9009-SOM with the Xilinx ZCU102 Evaluation board to demo a 20MHz bandwidth linearly swept chirp signal from 250MHz to 270MHz. I have been able to run a complex single tone example, so I know I have the BSP and IP addresses setup correctly, as per the PDF I have attached (see end of text, given to me courtesy of Jon Kraft). I have the following questions:
1) I have generated a linear chirp at baseband (0-20MHz) in Matlab using the chirp object. My understanding is that by setting the transmit center frequency to 250MHz, and feeding the baseband signal to the adi.ADRV9009.Tx object, the baseband signal will be brought up to 250MHz (from 0Hz) by a LO, and then transmitted (I have a SMA cable with a -10dB attenuator plugged from the Tx to Rx directly, no antenna is involved).
Is this understanding correct?
2) When I feed the adi.ADRV9009.Tx object the dsp.Chirp object I specified, I get the following errors. Is this because the dsp.Chirp object is not a complex vector? (Note the adi.ADRV9009.Tx object is named tx, and the chirp object tx_chirp.)
Error using matlabshared.libiio.base/cstatusAttribute hardwaregain return value -36, expected -30Error in adi.common.Attribute/setAttributeLongLong (line 21) cstatus(obj,status,['Attribute ' attr ' return value ' num2str(rValue) ', expected ' num2str(value)]);Error in adi.ADRV9009.Tx/setupInit (line 105) obj.setAttributeLongLong('voltage0','hardwaregain',obj.AttenuationChannel0,true);Error in adi.common.RxTx/configureChanBuffers (line 100) setupInit(obj);Error in matlabshared.libiio.base/setupImplError in adi.ADRV9009.Tx/setupImpl (line 74) setupImpl@matlabshared.libiio.base(obj);Error in chirp250MHz_to_270MHz_10us_length (line 36)tx(tx_chirp());
3) Similarly as in (1), I have the center frequency on the adi.ADRV9009.Rx object set to 250MHz. If I feed the adi.ADRV9009.Rx data into a spectrum analyzer, this would show the baseband signal (with whatever gain from the system), correct?
Matlab Streaming With ADI TRx PDF:
2. No, this is because you are setting a tx attenuation to an invalid range 'Attribute hardwaregain return value -36, expected -30'
3. To be specific, it will show the downconverted signal.
Thanks for the reply. In my code I do not address hardware gain at all, and coming back at it today (with the same code, just restarting the board) it is not throwing those errors.
It may have been in some weird state, especially if you were using IIO-Scope beforehand.
That could definitely had been it. I had used IIO-Scope to show a single tone, then switched to Matlab to generate a single tone myself
I have another question if it isn't too much trouble.
I have created my chirp object as described above, (0-20MHz, 10us duration).
I set up the Tx and Rx objects as follows:
%% Create Tx and Rx objects
tx = adi.ADRV9009.Tx;
rx = adi.ADRV9009.Rx;
% Set up Tx and Rx objects
tx.uri = 'ip:192.168.1.21';
tx.CenterFrequency = lo_freq;
tx.AttenuationChannel0 = -10;
rx.CenterFrequency = lo_freq;
rx.uri = 'ip:192.168.1.21';
Natively, the chirp output has an amplitude of 1, so before feeding to the adi.ADRV9009.Tx object, I scale it element-wise by 2^15. The adi.ADRV9009.Tx object is set to a center frequency of 250MHz, and channel 0 has a -10dB attenuation set to it. I feed the signal as shown below (the signal has 2^20 samples, about 2ms worth at the sampling rate I set):
I then setup a Spectrum Analyzer for the receive data as follows:
spec_an = dsp.SpectrumAnalyzer;
spec_an.SampleRate = samp_rate;
What I expect to see from the Spectrum Analyzer is something like in the image below (the chirp and some noise, generated in Matlab):
What I actually see is this next image, clearly just noise:
Is there something I am missing here? Am I not setting up the Rx side correctly?