I'd like to be able to look at the output of the LNA in the AD9361 Simulink model. I've been able to modify the model to get the output from the IQ demod, but no further back towards the receive antenna. The issue is that when I take the output from the LNA, I still get the spectrum from roughly -5.5 to +5.5MHz. I'm not sure how to set the spectral display. It seems that the issue is with the inherited sample rate in the spectral display, but I don't see how to adjust that.
One other question. In the LNA, I see that NF (noise figure) is used as a variable to set the noise contribution of the LNA, but I don't see where in the model where NF is actually defined/quantified.
Can you indicate the block at the output of which you are connecting the spectrum analyzer.
As for the NF variable, it can be found as follows. Right click RF_RX block, select Mask->View Mask. Then select Initialization tab in the Mask Editor. You'll find NF extrapolated from the noise figure values in the datasheet using interp1 MATLAB function.
This is what I'm doing. I've created an extra output from RF_Rx, from the LNA. I then moved the output of the block from DDC_Filters_Rx to this new output of RF_Rx. Thanks!
Hi Steve, sorry for the delay. Double-click the Outport block that is connected to the output of the LNA and set the carrier frequency to 2 GHz, the LO frequency used at the top-level of the ad9361_RX block. This will show the 2 MHz signal.
Hi Srikanth, when I double click on the LNA block, I get the dialogue box shown below, that only gives me input and output impedances for parameters. Am I doing something wrong?
I was referring to the Dialogbox of the Outport block (labeled Outport_Q in your first screenshot), not LNA.
That was it, working fine now, thank you!
For the most part, this is working. However, I noticed that the expected output (@LO = 2GHz and RF = 2MHz) is sitting at about 2.5MHz, not where is should be at 2MHz. By itself this is a problem, but I am also getting spurs at about 4.5MHz. This is really messing up my attempt at harmonic distortion measurement.
If I look at the demodulated output of the system, the signals show up at 2MHz, exactly where I placed them.
Do you have any idea of where this inaccuracy is coming from?
Hi Steve, which output signal is this spectrum analyzer block plotting? Is it connected to the output of AD9361_RX block? Did you make any other changes to the model?
No other changes to the model, it is as shown below. The two conditions that I am testing are (1) with the output connected to the LNA output , as shown, where I get the strange offset in frequency and (2) where the connection to the RF port on Outport_I is from the Demodulator output, where the frequency is accurate, showing 2 MHz on the spectral plot. For condition (2), the carrier frequency in Outport_I is set to the default of abs(LO-RF). For condition (1), I set this same variable to abs(LO), though I have tried without the abs part of the equation too.
For both scenarios, as we discussed previously, the carrier frequency in the Outport block needs to be set to 2 GHz. For (2), you might need to connect two Outport blocks at the output of the demodulator, since we need to convert circuit envelope signal to Simulink signal for both I and Q channels. The output type in the Outport_I and Outport_Q blocks in this case might have to be set to Real Passband, since that makes most sense among the options. However, this may not be very helpful to diagnose the offset issue since what we get is a passband signal. In the case of (1), I'm not observing any offset. The peak is at 2 MHz.
Condition 2 works fine for me, not a problem, I get 2 MHz on the output. Condition 1 is where I am seeing the offset. I do have the carrier frequency in the outport block set to 2 GHz. I'm still struggling with how to set variable types in Simulink. How would I set the data type in one of the outport blocks? I have a sneaking suspicion that my problem is due to a data type somewhere not having enough resolution, so that when it calculates the RF frequency of 2MHz, based on the LO of 2GHz, it doesn;t come up with an accurate enough number. Does that make sense. Can you help me understand how to set the data type in the outport block?
When you drop the Outport block on the canvas, the default output is Complex Baseband. So, nothing else other than Center Frequency needs to be set for this block for (1). Similarly, nothing else needs to be changed in the model out-of-the-box. You should be able to see the correct spectrum plot.