I have an application where I am trying to efficiently switch between different BWs. I'm using the ADI Linux driver with an fmcomm3 & Zedboard combo for evaluation. From timer prints I have around the various libiio channel attribute changes I perform on the tx channel, it seems the time-dominating attribute changes are "sampling_frequency" and "rf_bandwidth", in this case corresponding to the ADC+DAC sampling frequency and TX analog filter bandwidth updates.
From the discussion in https://ez.analog.com/thread/51049, it sounds like most of the time is spend in the TX Quadrature Calibration functions for the phase offset loop + search. What I took from the prescribed procedure in AD9361 Transmit Quadrature Calibration (Tx Quad Cal) and from this post https://ez.analog.com/message/166870#166870 from tlili, it sounds like a potential application behavior could be to read back the calibrated phase offset values for a specific profile after the TX quad cal is performed "once." Thereafter returning to that profile (defined as 4-part sample rate, carrier freq, digital filter selection/taps, temperature +/- threshold) could use the stored phase offset values instead of rerunning the TX quad cal every time and taking the time hit.
I have a couple questions about validity and implementation:
1) Is it valid to assume that the phase offset values reached by the TX quad cal will be the same for one profile upon returning to that profile, assuming temperature is constant? (I.e. If one profile is loaded, the TX quad cal is performed and the NCO values saved, another profile is loaded, the TX quad cal is performed again and the 2nd profile NCO values are saved, the 1st profile is loaded again but the TX quad cal is not performed, the saved NCO values for the 1st profile are loaded.) Should I expect that the performing the TX quad cal again should not shift the NCO values for a set of profile conditions?
2) Returning to my investigation of the times required for sample rate & BW changes using the libiio channel attributes:
2.1) Looking through the driver code (linux/ad9361.c at xcomm_zynq · analogdevicesinc/linux · GitHub), the "sampling_frequency" attribute calls the driver's ad9361_phy_write_raw(). There it will perform the necessary clock chain changes for the ADC+DAC sample frequency and then calls ad9361_update_rf_bandwidth() with the "current" RX and TX analog BWs, which performs the TX quad cal.
2.2) The "rf_bandwidth" attribute calls the driver's ad9361_phy_store() for the respective channel, setting the "current" TX analog BW in the ad9361_update_rf_bandwidth() function again. This second attribute change to update the analog filter BW has the performance cost of TX quad cal again.
2.3) Is there any support in the driver as of now to change the sample rate and both RX and TX analog filter bandwidths while only performing the ad9361_update_rf_bandwidth() function once (in order to only run the necessary TX quad cal once)? I would prefer using only ADI-supported features, but it seems adding to the iio_dev_attr list is fairly straight-forward.
3) I have more questions about the temperature-dependent relationship of the quadrature calibration, but they may be better suited to a separate discussion.