**Introduction**

Red Pitaya, an open-source tool combining numerous measurement and control instruments, is an ideal platform for exploring digital signal processing (DSP), specifically digital filtering. Digital filters manipulate signal characteristics, performing tasks like noise removal and signal smoothing.

**Z-Domain LTI Systems**

It’s important to remember that all discrete time LTI (Linear Time-Invariant) systems can be formulated in a canonical form:

$H(z) = \frac{b_{0} + b_{1}z^{- 1} + b_{2}z^{- 2} + \ldots + b_{k}z^{- k}}{a_{0} + a_{1}z^{- 1} + a_{2}z^{- 2} + \ldots + a_{m}z^{- m}}\ where\ k,m\mathbb{\in N}$Here, the coefficients of each term in the equation can be perceived as the coefficients in the corresponding difference equation:

$y[n](a_0+a_1+ \delta[n-1]+a_2 \delta [n-2] +...+ a_m \delta [n-m]) = x[n](b_0 +b_1 \delta [n-1] + b_2 \delta [n-2]+...+ b_k \delta [n-k])$**Filter Design Basics**

When designing a filter, the order plays a significant role in determining its performance characteristics. The order of a filter is often considered in terms of the filter’s ‘sharpness’ in transitioning from the passband to the stopband. A higher order filter results in a steeper roll-off, allowing for a sharper transition. However, this comes with the drawback of potentially introducing more phase distortion.

A simple first-order low-pass filter has the following transfer function in the s-domain:

$H(s) = \frac{1}{1 + sT}$where s is the time constant of the filter. The higher the order of the filter, the more complex this equation becomes.

**Windowing in Digital Filters**

In digital FIR filter design, windowing techniques involve the multiplication of an ideal impulse response with a window function. The selection of a window function impacts the trade-offs between side lobe level, transition width, and main lobe width.

A general formula for the FIR filter coefficients using windowing can be represented as:

$h[n] = h_d[n] w[n]$where $h_d[n]$ is the impulse response of an ideal filter, $w[n]$ is the window function, and * n* ranges from 0 to N-1.

**The Power of IIR Filters**

Unlike FIR filters, Infinite Impulse Response (IIR) filters have both poles and zeros, meaning their impulse response can theoretically continue indefinitely. A basic first-order IIR filter has a transfer function given by:

$H(z) = \frac{b_0 + b_1z^{-1}}{1 + a_1z^{-1}}$where $b_o$ and $b_1$ are feedforward coefficients and $a_1$ is a feedback coefficient. Higher order IIR filters have more complex transfer functions, with additional ‘b’ and ‘a’ coefficients.

**A Glimpse into Digital Signal Processing**

The Nyquist-Shannon sampling theorem states that a continuous time signal can be properly sampled, only if it does not contain frequency components above half of the sampling rate. If the condition is not satisfied, aliasing occurs. In mathematical terms, for a signal with a maximum frequency component of ** B **Hz, the sampling frequency $f_s$ should be:

The Discrete Fourier Transform (DFT) transforms a finite sequence of equally-spaced samples of a function into an equivalent sequence of samples in the frequency domain. Its general equation can be written as:

$X[k] = \sum_{n=0}^{N-1} x[n] \exp\left(-j\frac{2\pi}{N} nk\right)$The convolution operation, denoted by ‘*’, is used to find the output * y[n]* of an LTI system, given an input

*and an impulse response*

**x[n]***:*

**ℎ[n]**The Z-transform maps a sequence of numbers in the time domain into a sequence in the complex frequency domain. It is defined by:

$X(z) = \sum_{n=-\infty}^{\infty} x[n] z^{-n}$where * x[n]* is the discrete-time input signal and

*is the Z-transform of*

**X(z)***. This tool proves to be instrumental in the analysis and design of digital filters.*

**x[n]**Digital filters are designed to perform various operations on signals such as amplification, attenuation, or specific frequency content modification. The filter’s functionality can be described by a difference equation. For instance, a generic form of a first-order (one-pole) discrete-time system is described by:

$y[n] = a_1 y[n-1] + b_0 x[n]$where * y[n]* is the output,

*] is the input, $a_1$ and $b_0$ are the filter coefficients. This equation exemplifies how the output signal at a specific time ‘n’ depends on the previous output and the current input.*

**x[n**With the digital representation of signals and systems, we can leverage computational resources to perform complex processing tasks, analyze the behavior of systems, and design intricate signal processing architectures. The theory behind digital signal processing sets the foundation for the tasks and analysis that follow in this text.

**Conclusion**

In this series of experiments, we’ve explored different types of digital filters using the Red Pitaya and the LTI DSP workbench. We’ve studied an all-pass filter that passes all frequency components without alteration, a moving average filter acting as a low-pass filter, a dedicated low-pass filter, a first-difference high-pass filter, and a feedback filter.The study included a theoretical analysis of their transfer functions, prediction of their behavior based on Bode plots, and hypotheses about how these filters would alter the waveforms of input signals. We also examined the difference equations of these filters, which provide a time-domain representation of their operation.In conclusion, this exercise provides a solid basis for understanding how different types of digital filters function and how to implement and analyze them using real-world tools and equipment.