MATLAB Examples

These two models show how to determine the relative frequency offset between two ADALM-PLUTO radios.

The transmitter sends a 12000 Hz sine wave with the Frequency Offset Calibration (Tx) with ADALM-PLUTO Radio model. The receiver receives the signal, calculates the frequency offset and displays the offset in the Frequency Offset Calibration (Rx) with ADALM-PLUTO Radio model.

## Overview

These two models perform an FFT-based frequency offset calculation at complex baseband. The receiver model provides the following information:

• The quantitative value of the frequency offset
• A graphical view of the spur-free dynamic range of the receiver
• A graphical view of the qualitative SNR level of the received signal

## Structure of the Example

The following figure shows the transmitter model:

The following figure shows the receiver model:

The following figure shows the detailed structure of the Receiver subsystem:

• The Find Peak Frequency block - uses an FFT to find the frequency with the maximum power in the received signal.
• The Spectrum Analyzer block - computes and displays the power spectral density of the received signal.

## Find Peak Frequency

The Find Peak Frequency subsystem finds the frequency with the maximum power in the received signal, which equals the frequency offset plus 12000 Hz. The following diagram shows the subsystem. In this subsystem, the Periodogram block returns the PSD estimate of the received signal. The Probe block finds the frame size and the frame sample time. With this information, this subsystem finds the index of the maximum amplitude across the frequency band and converts the index to the frequency value according to

Foffset = IndexofMaxAmplitude * FrameSize / (FFTLength * FrameSampleTime)

The MATLAB function findpeakfreq.m performs this conversion.

## Spectrum Analyzer

The following figure shows the output of the Spectrum Analyzer on a frequency range of -50 kHz to 50 kHz. In the case shown below, the frequency with the maximum power of the received signal is about 7 kHz, and the spur-free dynamic range of the receiver is about 34 dB.