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:
Here, the coefficients of each term in the equation can be perceived as the coefficients in the corresponding difference equation:
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:
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:
where is the impulse response of an ideal filter, 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:
where and are feedforward coefficients and 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 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:
The convolution operation, denoted by ‘*’, is used to find the output y[n] of an LTI system, given an input x[n] and an impulse response ℎ[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:
where x[n] is the discrete-time input signal and X(z) is the Z-transform of x[n]. This tool proves to be instrumental in the analysis and design of digital filters.
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:
where y[n] is the output, x[n] is the input, and 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.
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.