Category: Software
Product Number: AD9361
The AD9361 datasheet supports fast lock mode. I am currently using the AD9361 for sweep functionality, which requires rapid frequency band switching. During the sweep process, I notice a very strong image signal appearing beside my main signal. Could someone please provide some solutions or suggestions to address this issue?
I am using the following fast frequency hopping method:
- My frequency band ranges from 3 to 6 GHz, and I have divided it into 75 segments, each 40 MHz wide. When powered on, I store the center frequency of each AD9361 segment in my ARM local structure using the following method.
int WriteFastClockFreqToStruct(uint64_t freq, FastLockEntry *entry, uint32_t profile){uint64_t readFreq = 0;int readCnt = 100;ad9361_set_rx_lo_freq(ad9361_phy, freq);do{if (ad9361_get_rx_lo_freq(ad9361_phy, &readFreq) != 0){log_error("读取AD9361接收频率失败,回读频率:%d", readFreq);return -1;}
// log_error("次数:%d,读取AD9361接收频率:%llu",100-readCnt,readFreq);uint64_t diff = (readFreq > freq) ? (readFreq - freq) : (freq - readFreq);if (diff <= 1000){// log_info("配置AD9361本振%lluMHz成功", readFreq / 1000000);break;}} while (readCnt--);if (readCnt <= 0){return -1;}ad9361_rx_fastlock_store(ad9361_phy, profile);ad9361_rx_fastlock_save(ad9361_phy, profile, entry->profile);entry->freq = freq;entry->slots = profile;log_info("配置AD9361本振%lluMHz成功,ALCVAL:0x%02x", readFreq / 1000000,entry->profile[15]);return 0;}2、During frequency sweeping, I achieve fast locking by loading the profiles of 8 frequency points at once and then calling the recall function. I noticed that adding a 50 ms delay after the recall function significantly improves the image rejection. Could it be that the RX chain hasn't stabilized yet after the recall function completes, causing the image interference? However, for my current system, a 50 ms delay is unacceptable. Are there any possible solutions to this issue?void FreqSweep(void){bool errorFlag = false;while (1){if (!g_sweepFlag){usleep(1000);continue;}
errorFlag = false;struct timeval start1,end1;while (1){gettimeofday(&start1, NULL);for (int segmentId = 0;segmentId < TOTAL_SEGMENTS; segmentId++){g_sampleFlag = false;bram_write32(START_CAP_DATA, 0);int bankId = segmentId / FASTLOCK_PROFILE_NUM;int slotId = segmentId % FASTLOCK_PROFILE_NUM;if (slotId == 0){int bankStart = bankId * FASTLOCK_PROFILE_NUM;int bankEnd = bankStart + FASTLOCK_PROFILE_NUM;
if (bankEnd > TOTAL_SEGMENTS){bankEnd = TOTAL_SEGMENTS;}
for (int i = bankStart; i < bankEnd; i++){int slot = i - bankStart;int ret = ad9361_rx_fastlock_load(ad9361_phy,slot,table.entry[i].profile);if (ret != 0){log_error("FastLock load失败, segment=%d slot=%d",i,slot);
errorFlag = true;break;}}
if (errorFlag){break;}}uint64_t freq = table.entry[segmentId].freq;int ret = ad9361_rx_fastlock_recall(ad9361_phy,slotId);
if (ret != 0){log_error("FastLock recall失败, segment=%d slot=%d",segmentId,slotId);
errorFlag = true;break;}bram_write32(FREQ_SEG_ID, segmentId);bram_write32(START_CAP_DATA, 1);bram_write32(START_CAP, 0);bram_write32(START_CAP, 1);bram_write32(START_CAP, 0);g_sampleFlag = true;if (!ReadFPGAUntilEnoughFrameLen(3)){// log_error("读取FPGA采集%d帧数据失败", frameCount);// errorFlag = true;break;}g_sampleFlag = false;}gettimeofday(&end1, NULL);long timeUse1 =(end1.tv_sec - start1.tv_sec) * 1000000L +(end1.tv_usec - start1.tv_usec);
log_fatal("扫频一轮时间 = %ld ms",timeUse1 /1000);}
if (errorFlag){log_error("本轮扫频失败");continue;}
log_info("==========================================");log_info(" Full Sweep Frame Ready");log_info("==========================================");}}
3、I tested both the direct call of ad9361_set_rx_lo_freq and the method of loading and recalling to achieve the same frequency. Neither of these approaches had the mirroring issue.