lab9lames

docx

School

California Polytechnic State University, Pomona *

*We aren’t endorsed by this school

Course

3101L

Subject

Electrical Engineering

Date

Feb 20, 2024

Type

docx

Pages

7

Uploaded by jamesperez0120

Report
Lab#09 Digital Filter Design II ECE 3101L-02 April 18, 2023 Objectives 1. The student will be able to design digital FIR filters by placing zeros in the Z-Domain unity circle.
2. The student will be able to write simple programs to implement digital filters and filter audio signals . Filters zero (cartesian) pole (cartesian) filter real imaginary real imaginary 1 -1 0.95 2 1 -0.95 3 ±1 ±0.95i 4 ±i ±0.95 5 -1 ±i,±1/√2±i/√2 6 1 ±i,±1/√2±i/√2 7 ±1 ±1/√2±i/√2 8 ±i,±1/√2±i/√2 zero (polar) q zero (polar) r pole (polar) q pole (polar) r 9 0.6283 1 10 0.7854 1 11 1.0472 1 12 3.1416 1 13 2.0944 1 14 0.6283 0.98 15 0.7854 0.98 16 2.0944 0.98 17 0.6283 0.75 18 0.7854 0.75 19 2.0944 0.75 Figure (9.1) : poles and zeros of different filters LAB i. Apply audio signal(s) and white noise to the filters 5 to 8 above.
GRAPH: 0 1 2 3 x 10 4 -1 0 1 Audio Signal 1 - Original -11.4752 -11.4752 -0.9691 9.537 9.537 x 10 307 -2 0 2 4 x 10 307 Audio Signal 1 - Filtered 0 2 4 6 8 x 10 4 -1 0 1 Audio Signal 2 - Original -5 0 5 x 10 307 -3.6643 2.8901 9.4445 x 10 307 0 1 2 3 x 10 4 -5 0 5 White Noise - Original -11.4345 -3.1044 5.2258 x 10 307 -2 0 2 4 x 10 307 Figure (9.2) : Audio signal, Noise signal and Filtered signal 0 1 2 3 x 10 4 -10 0 10 20 Filtered Audio Signal 1 0 2 4 6 8 x 10 4 -100 -50 0 50 100 Filtered Audio Signal 2 0 1 2 3 x 10 4 -1000 -500 0 500 1000 Filtered White Noise 0 0.5 1 0 0.5 1 Figure (9.3) : Audio signal, filtered white-Noise signal and Filtered signal.
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
  • Access to all documents
  • Unlimited textbook solutions
  • 24/7 expert homework help
0 0.5 1 1.5 2 2.5 3 -10 -5 0 5 10 15 Time (s) A m plitude Input and Output Audio Signal for audio f ile 1 .wav 0 1000 2000 3000 4000 5000 6000 7000 8000 0 0.5 1 1.5 2 2.5 3 3.5 4 4.5 x 10 4 Frequency (Hz) Magnitude Input and Output Audio Signal for audio f ile 1 .wav in Frequency Domain Input Signal Filtered Signal The given code loads two audio signals (speech and gore) and white noise and applies four filters to each of them. The transfer functions of the filters are defined in terms of their zeros and poles, which are provided in the code as arrays of complex numbers. The transfer function coefficients are then computed using the "poly" function in MATLAB, which takes the zeros and poles as input and returns the corresponding polynomial coefficients. The filters are then applied to the audio signals and noise using the "filter" function in MATLAB, which takes the filter coefficients and the input signal as input and returns the filtered output signal. The filtered
signals are then played using the "sound" function in MATLAB, which plays the audio signal through the computer's speakers. Finally, the filtered signals are plotted in the time domain using the "plot" function in MATLAB, which takes the input signal as input and returns a plot of the signal over time. The filtered sum of the signals and noise is also plotted in the time domain. There is also a comment in the code that suggests that there might be additional code to plot the filtered signals and noise in the frequency domain, but that code is not provided. ii. Apply audio signal(s) and white noise to the filters 9 to 19 above. iii. Plot the input and output audio signals overlaid in the time and frequency domain. GRAPH: 0 1 2 3 x 10 4 -1 0 1 Audio Signal 1 - Original -2000 -1000 0 1000 2000 -2000 0 2000 Audio Signal 1 - Filtered 0 2 4 6 8 x 10 4 -1 0 1 Audio Signal 2 - Original -2 -1 0 1 2 x 10 4 -5000 0 5000 Audio Signal 2 - Filtered 0 1 2 3 x 10 4 -10 0 10 White Noise - Original -1 -0.5 0 0.5 1 x 10 6 -5 0 5 x 10 5 White Noise - Filtered Figure (9.4) : Audio signal, Noise signal and Filtered signal
0 1 2 3 x 10 4 -6 -4 -2 0 x 10 307 Filtered Audio Signal 1 0 2 4 6 8 x 10 4 0 2 4 6 8 x 10 307 Filtered Audio Signal 2 0 1 2 3 x 10 4 -10 -5 0 x 10 307 0 0.5 1 0 0.5 1 Figure (9.3) : Audio signal, filtered white-Noise signal and Filtered signal. 0 0.5 1 1.5 2 2.5 3 -7 -6 -5 -4 -3 -2 -1 0 x 10 307 Time (s) Amplitude Input and Output Audio Signal for audio f ile 1 .wav
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
  • Access to all documents
  • Unlimited textbook solutions
  • 24/7 expert homework help
0 1000 2000 3000 4000 5000 6000 7000 8000 0 50 100 150 200 250 300 350 Frequency (Hz) Magnitude Input and Output Audio Signal for audio f ile 1 .wav in Frequency Domain Input Signal Filtered Signal This code applies digital filters to audio signals and white noise using their transfer function coefficients calculated from their respective zeros and poles. The filtered signals are then played and plotted in both the time and frequency domains. The audio signals and white noise are loaded using the audioread function, and white noise is generated using the randn function. The transfer function coefficients are computed using the poly function from the zeros and poles of the system. The filter function is used to apply the transfer function coefficients to the audio signals and white noise separately. The filtered signals are then played using the sound function and plotted using the subplot function. In the time domain, the input and output audio signals are overlaid on the same plot using the plot function, and in the frequency domain, the input and output audio signals are plotted using the fft function. The plots provide insights into the effect of the applied filters on the signals and noise. Overall, this code demonstrates how to apply digital filters to audio signals and white noise, and how to analyze the filtered signals in both the time and frequency domains.