For the practical tasks, we will be using the Red Pitaya’s web applications and MATLAB to analyze external waveforms. The tasks involve exploring the audio DAC’s bandwidth, observing the effects of bit depth and quality, analyzing waveforms from USB soundcards and PC soundcards, examining the Red Pitaya’s own DAC for quantization artifacts, and quantifying crosstalk between input channels.

**Single channel analysis**

**For all of this analysis, set the second channel to output all zeros in MATLAB, as described in the slides and class time instruction.**

**Audio DAC Bandwidth**

Audio devices have bandwidth limits typically in the range of 20kHz due to their sample rate. In this task, we will experimentally observe this limitation using a pure sine wave tone with sufficient amplitude.

- Show at least one plot demonstrating aliasing in the time domain, and frequency domain.

*The plot in the time domain will show distortions, such as jagged edges or waveform folding, indicating aliasing. The frequency domain plot will exhibit energy at frequencies that are not present in the original signal, indicating the presence of aliases.*

- Observe the frequency of the aliased wave appears to have, and comment on what you estimate to be the sample rate (bandwidth) of the card.

*By stepping through the example frequencies and comparing the measured frequency with the expected frequency, we can determine the sample rate (bandwidth) of the audio DAC. When the measured frequency deviates from the expected frequency, it indicates the point at which aliasing occurs. The sample rate can be estimated by doubling the highest expected frequency at which aliasing is observed.*

Hint: One way to do this is to step through each of the following example frequencies (for example like those given in the table below), and look for when the measured frequency doesn’t match the expected frequency.

Frequency (kHz)

18

19

20

22

23

24

25

30

**Audio DAC Bit depth and quality**

In addition to a sample rate, Audio DACs have a known number of quantized states. We will observe how this can appear by using multiple DACs, and why the rule of thumb of more bits is better is usually true.

For all tests, use a sinewave excitation signal with a frequency of 1kHz. For each sinewave, analyze the samples through both the time and frequency domains.

**USB Soundcard**

- Time domain

*The time domain analysis of the captured waveforms will reveal their characteristics, such as pulse widths, rise and fall times, and overall waveform behavior.*

Frequency Domain

*The frequency domain analysis will allow us to identify the frequency components and their magnitudes in the captured waveforms.*

**Higher frequency output**

As an optional demonstration, set the output frequency to be 10kHz on the Soundcard. Comment as to what appears to be occurring, and if there is any unusual behavior observed. Speculate as to the origin of the atypical behavior if any is observed.

- Time domain

*By examining the captured waveforms in the time domain, we can observe any changes in their characteristics compared to lower frequencies. This may include variations in pulse widths, amplitude, or overall waveform shape.*

- Frequency Domain

*The frequency domain analysis will reveal the spectral content of the captured waveforms at the higher frequency. This can help identify any additional frequency components or changes in the magnitude distribution.*

**Red Pitaya Output**

The Red Pitaya also has a DAC, which is what the analog outputs employ. We have already viewed some of the signals of the Red Pitaya before, but now let’s examine them for quantization artifacts. For this, configure the red pitaya in the usual Loopback configuration using the SMA cables we have previously used, and configure the output to the same 10kHz sinewave.

- Time domain

*The time domain analysis of the captured waveforms will reveal any quantization artifacts and their impact on the waveform shape and fidelity.*

- Frequency Domain

*The frequency domain analysis will allow us to observe any additional frequency components, distortions, or noise introduced by quantization artifacts in the Red Pitaya’s output signal.*

**Dual Channel analysis**

**For all of this analysis, both channels will have non-zero values in MATLAB.**

**Cross talk**

We previously observed the effect of cross talk between input channels of the red pitaya. Let’s try to better quantify this now that we can load the waveforms in MATLAB. To Do this, we will setup the soundcard to output two (2) sinewaves of differing frequency, one on each channel, and measure the spectrum of one channel for content of the other.

Capture the cross talk behavior on the red pitaya’s web interface before attempting the MATLAB processing to ensure you can see the cross talk visually. Label in each screen the feature caused by cross talk.

- Red Pitaya - Time domain

*By examining the captured waveforms in the time domain, we can observe any interference or bleed between the channels, indicating the presence of cross talk.*

- Red Pitaya Frequency Domain

*In the frequency domain, we can calculate the ratio of strength (in linear and dB) between the fundamental frequency and the frequency of the other channel. This will help us measure the extent of cross talk and evaluate any observed asymmetry.*

After this, acquire the data through MATLAB, and use the variable **ch_1_data** to show the effects of cross talk. (Hint, for the frequency domain, plot the amplitude spectrum, and compare the relative magnitudes of the frequency bins in both frequencies)

In the frequency domain, calculate the ratio of strength (in linear and dB) of the fundamental frequency to the ratio of the strength of the frequency of the other channel. Do this for both channels, and comment on any observed asymmetry.

**Conclusion**

In conclusion, the Red Pitaya serves as a versatile platform for measuring external waveforms. Through the tasks and analyses conducted, we gained insights into bandwidth limitations, the impact of bit depth on waveform quality, characteristics of different soundcard outputs, and the quantification of cross talk effects. This knowledge enhances our understanding of discrete time systems and enables accurate signal measurements and analysis. The Red Pitaya’s capabilities empower us to explore and experiment with waveforms, contributing to advancements in signal processing and analysis.