**Objective**

This lab aims to use the Red Pitaya, a versatile tool for digital signal processing, to investigate various properties of periodic waveforms. We’ll demonstrate the functions of the Red Pitaya as an oscilloscope, signal generator, and spectrum analyzer, focusing on the measurement of waveform characteristics such as period, frequency, phase, and spectral content.

**Period and Frequency of a Waveform**

The period of a waveform is a crucial characteristic, defining the time it takes for one complete cycle of the wave to occur. It’s typically measured from peak to peak or trough to trough. The frequency, on the other hand, tells us how many of these cycles occur in one second. It’s typically measured in Hertz (Hz).

The Red Pitaya, in its capacity as an oscilloscope, is used in this lab to measure the period of a sinusoidal waveform. This can be achieved both manually, by using cursors to highlight a complete cycle on the oscilloscope’s display, and automatically, with the Red Pitaya’s built-in measurement capabilities.

Crucially, there is a simple mathematical relationship between the period (T) and frequency (f) of a waveform, expressed by the equation:

$f = \frac{1}{T}$This equation highlights that the frequency is the reciprocal of the period, and vice versa.

**Phase Difference**

Phase difference is another vital characteristic of waveforms, particularly when comparing two or more signals. It refers to the difference in phase between two waveforms, represented as an angle (either in radians or degrees).

In this lab, we delve into the concept of phase difference by observing two 1500Hz sinusoids, one of which has been intentionally delayed by 45 degrees. This delay introduces a phase shift, which can be measured by observing the time difference between corresponding points (like peaks or zero crossings) on the two waveforms.

The phase difference (Φ) for signals of equal frequency can be calculated using the formula:

$\phi = 2\pi f\Delta t$Here, Δt represents the time delay between the two waveforms.

**Spectrum Analysis**

The Red Pitaya is not just an oscilloscope, it’s also a potent spectrum analyzer. This functionality allows us to view the frequency content of a signal, showing how the signal breaks down into its constituent frequencies. This is achieved by performing a Discrete Fourier Transform (DFT) on the time-domain signal, converting it into the frequency domain.

The spectrum of a pure sinusoid will show a single peak at the sinusoid’s frequency. More complex waveforms, however, will have additional peaks representing the harmonic content of the signal. The power of these peaks can be measured in dBm, a logarithmic scale relative to a reference power of 1 milliwatt.

The conversion from a linear power scale (P_lin) to dBm is given by:

$P_{dBm} = 10\log_{10}\frac{P_{lin}}{1mW}$