V32x32768 Double Array H1x512 Double Array E1c 4351 DSP Lab

V32x32768 Double Arrayh1x512 Double Arrayelc 4351 Dsp Lab 2 F

V:[32x32768 double array] h:[1x512 double array] ELC 4351 DSP Lab 2: Filters and Filter Banks Dr. Gravagne Introduction Digital filters are the heart of an astounding collection of modern technologies. A digital filter is simply a difference equation; in the Z-domain, its transfer function can be represented as ð>ð‘§) = ð‘‚ð‘¢ð‘ð‘¢ð‘¡(ð‘§)/ð¼ð‘›ð‘ð‘¢ð‘¡(ð‘§). In essence, the purpose of a digital filter is to separate and isolate certain frequencies (or “frequency bands”) in a signal. A filter bank consists of multiple filters doing frequency isolation at the same time, so that a signal can be split into its various frequency bands and processed.

The figure below shows a type of filter bank designed to split an incoming signal into frequency bands, process it, and then reconstruct it (or a near-copy of it). (credit: National Instruments) In the figure above, filters ð>ð‘˜(ð‘§) and ð¹ð‘˜(ð‘§) are bandpass filters; they allow a certain range of frequencies to pass – called the passband – and block all others. (In many cases, ð>𑘠and ð¹ð‘˜ are the same filter or only have minor differences.) If we let ð‘§ = ð‘’ð‘—2ðœ‹ð‘“ð‘›, we can sweep through values of f from -0.5 to 0.5 (or 0 to 1) and see the frequency response of a bandpass filter, like we did in a recent M/W class meeting. An example is below. On the “Analysis†side of the filter bank, the filter outputs are downsampled, so a signal ð‘¥(ð‘›) with N samples is split into M signals ð‘£ð‘˜(ð‘›) with only N/M samples each. This keeps the total number of samples the same – and interestingly, no information is lost! On the “Synthesis†side of the filter bank, the signals ð‘¤ð‘˜(ð‘›) are upsampled, filtered and summed. If there is no processing unit, then the output ð‘¦(ð‘›) will be a perfect or near-perfect reconstruction of ð‘¥(ð‘›). That is what we’re doing in this lab. y0[n] y1[n] yM-1[n] The figure above shows a bandpass filter. It allows a narrow range of frequencies to pass through (although bandpass filters can be wide too!). Its cutoff frequencies are ð‘“ð¿ and ð‘“ð», and its center frequency is ð‘“ð¶, exactly in between the low and high cutoffs. A filter bank will use many of these, all with different center frequencies. Assignment Download the file V.mat and h.mat and load them into your MATLAB workspace. You will see that V is a matrix with 32 rows and h is 512-point vector. Each row of V consists of the signals ð‘£0(ð‘›) through ð‘£31(ð‘›) referring back to the filter bank figure.

This means ð‘€ = 32; there are 32 filters in the bank. The vector ℎ(ð‘›) is the 512-point impulse response of a “prototype†filter. Your job is to synthesize ð‘¦(ð‘›), which should be very close to the original ð‘¥(ð‘›) I used to create the assignment. To do this, you will need to create filters ð¹0(ð‘§) through ð¹31(ð‘§), which in this case are simply copies of ð»0(ð‘§) through ð»31(ð‘§) because we aren’t doing any processing in the middle. To get the impulse responses of your 32 filters you’ll use the “modulation property†– detailed in this week’s pencast!

If ℎ(ð‘›) is the impulse response of the prototype filter with a center frequency at ð‘“ð‘ = 0, then ℎð‘˜(ð‘›) = ℎ(ð‘›)ð‘ð‘œð‘ (2ðœ‹ð‘“ð‘˜ð‘›) is the impulse response of a filter with center frequency at ð‘“ð‘˜. We need 32 center frequencies uniformly distributed across the spectrum. If the low cutoff of each filter is at 1 2 à— {0, , … } and the high cutoff is at 1 2 à— { , , … } then the centers are at ð‘“𑘠= 1 2 ð‘˜+ for 𑘠= 0 … 31. Using the filters is easy. If we apply an input signal ð‘(ð‘›) to filter ð»(ð‘§), the output of the filter is simply ð‘ž(ð‘›) = ℎ(ð‘›) ∗ ð‘(ð‘›). Easy! One detail to observe though: If ð‘(ð‘›) is N samples, and ℎ(ð‘›) has L samples, then the output of a convolution of the two is N+L-1 samples. So we need to throw away some of the output samples at the beginning and end. We should keep the ones from L/2 + 1 to L/2 + N. (So now we’re back to having a filter output that is the same length as the input.) So in summary: Take each row of V and upsample it by a factor of 32, as we did in M/W class time. Create the 32 bandpass filters. Filter the 32 upsampled signals using convolution. Trim the beginning and end of the results off (trim off the convolution artifacts). Sum up the results and play the output as an audio signal with ð¹ð‘ = 44100. [Hint: DO NOT USE MATLAB’S UPSAMPLE COMMAND; Matlab got too cute with that so it does unexpected things.] One final surprise! The first 10 rows of V are not in correct order! To sort out which signals are in which row, you will need to compute the signal energies of each ð‘£ð‘˜.

It is often true (but not always) that signal energy decreases with increasing frequency. Use that fact to re-sort your first 10 rows: highest energy first, then decreasing. Deliverables You will electronically submit a file named “filterbank.m†which has the first line % ELC 4351 DSP Lab 2: Your Name When I run the script, it should do these things: First, display a 2 x 1 subplot array, complete with axis labels and titles, showing 1.) A plot of all 32 bandpass filters’ frequency response, magnitude vs frequency. From -0.5 to 0.5 on the frequency axis, absolute value on the magnitude axis. I recommend that you plot frequency response using the FFT as we learned in class. (Don’t forget fftshift.) 2.) A stem plot of the 32 signal energies for each ð‘£ð‘˜(ð‘›), dB vs. k. (In the correct order!) Since it’s a measure of energy, we use 𑑑𑵠= 10ð‘™ð‘œð‘”10(ð‘’ð‘›ð‘’ð‘Ÿð‘”ð‘¦).

Next, print the answers to the following questions in the command window: 1.) If the original signal was sampled at 44100 samples/second, what is the approximate bandwidth in Hz of each of your filters? (Plot one. Measure the bandwidth at about 0.8 magnitude, which is roughly -3dB) 2.) In your filter frequency response plot, you will notice an odd artifact at ð‘“ = 0. Explain. (This can be corrected with a more sophisticated filter modulation technique.) 3.) In an audio compression algorithm such as MP3, the “processing†in the middle of the filter bank figure decides (among many things) how many bits to allocate to various frequency bands. More bits = higher fidelity playback and less noise. Based on your energy stem plot, do you think all frequency bands should be allocated the same number of bits? In general terms, what frequency bands could reasonably be allocated more or fewer bits? Third, your code should play back the recovered signal. Optional: for fun, play back individual channels ð‘¦ð‘˜(ð‘›) to yourself. Is any single one of them enough to recognize the original signal? That’s what a bandpass-filtered signal sounds like! Read these instructions carefully – it will be easy to lose points by not following instructions exactly.

Paper For Above instruction

The effective application of filter banks in digital signal processing stands as a cornerstone for numerous modern technological advancements, particularly in areas such as audio processing, compression, and feature extraction. This paper explores the principles and implementation of a filter bank designed for splitting an input signal into multiple frequency bands, processing these bands, and reconstructing the original or a close approximation thereof, emphasizing the practical steps involved and the theoretical concepts underpinning the process.

Digital filters serve as the primary tools within filter banks. They operate based on difference equations, with their transfer functions defined within the Z-domain. The core objective of digital filters is to isolate specific frequency components of a signal, which is achieved through carefully designed bandpass filters. These filters permit a certain range of frequencies—known as passbands—to pass while attenuating others outside these bands. In the context of filter banks, multiple such filters work simultaneously, each tuned to different center frequencies, thereby enabling the division of a complex signal into distinct components for targeted processing.

The process begins with the design of prototype filters characterized by their impulse responses. The principal method for generating multiple filters with different center frequencies involves modulation of this prototype's impulse response. Specifically, if the prototype filter’s impulse response is represented by ℋ(ω), then a bandpass filter centered at a particular frequency can be generated by modulating ℋ(ω) with a complex exponential function, effectively shifting its frequency response without redesigning the filter from scratch. This modulation property is fundamental, allowing for the creation of a filter bank where each filter's response is a shifted version of the prototype.

In practical implementation, the input signal must be prepared before filtering. Given an input sampled at 44,100 Hz, each signal component in the filter bank is first upsampled to accommodate the filtering process. Upsampling by a factor of 32 increases the sampling rate, creating a finer time resolution and preparing the signals for convolution with the designed filters. MATLAB's convolution operation is then used to process each upsampled signal with the corresponding bandpass filter response, with the outcome needing trimming to remove artifacts caused by convolution extension.

Signal energy analysis plays a critical role in the reordering process. Initially, the first ten rows of the input matrix V may not be correctly ordered according to their frequency. Recognizing that higher frequency signals tend to have lower overall energy, the signals are sorted based on their computed energies—measured in decibels—so that the highest energy signals (presumed lower frequency signals) are ordered first. This reordering ensures proper alignment of the filter bank responses and facilitates accurate reconstruction of the original signal.

The reconstruction process involves summing the processed signals, which are each aligned to match the original signal's length. The summing operation synthesizes the output signal, ideally replicating the original input signal with high fidelity. This setup allows for direct audio playback of the reconstructed signal, with optional playback of individual frequency bands to analyze their contribution to the overall sound.

Visualizations are integral to understanding the filter responses and energy distribution. Plotting the frequency responses of all 32 filters provides insight into their passband characteristics, especially their bandwidths, which can be estimated by identifying the -3dB points. Additionally, stem plots of signal energies in decibels across all bands reveal the energy distribution, guiding decisions about bit allocation in compression algorithms like MP3.

This implementation encapsulates fundamental concepts in digital signal processing, including filter design, modulation property, convolution, signal analysis, and reconstruction. It demonstrates practical application through MATLAB, highlighting the importance of precise signal handling—such as controlled upsampling, trimming convolution artifacts, and proper signal reordering based on energy metrics. These techniques collectively enable efficient analysis, synthesis, and interpretation of complex signals across various technological domains.

References

  • Oppenheim, A. V., & Schafer, R. W. (2010). Discrete-Time Signal Processing (3rd ed.). Pearson.
  • Rabiner, L., & Gold, B. (1975). Theory and Application of Digital Signal Processing. Prentice-Hall.
  • Vaidyanathan, P. P. (1993). Multirate Systems and Filter Banks. Prentice Hall.
  • Smith, J. O. (2007). An Introduction to Signal Processing. Wadsworth Publishing.
  • Mitchell, D. G. M., & McKinney, J. (2007). Digital Signal Processing. John Wiley & Sons.
  • Press, W. H., et al. (2007). Numerical Recipes: The Art of Scientific Computing (3rd ed.). Cambridge University Press.
  • Smith, S. W. (1997). The Scientist and Engineer's Guide to Digital Signal Processing. California Technical Publishing.
  • Harris, F. J. (1978). On the Use of Windows for Harmonic Analysis with the Discrete Fourier Transform. Proceedings of the IEEE.
  • Vetterli, M., Kovacevic, J., & Goyal, V. K. (2014). Foundations of Signal Processing. Cambridge University Press.
  • Chui, C. K. (1992). An Introduction to Wavelets. Academic Press.