Starting from:
$30

$24

Homework 2: Time Domain Filtering Solution

Introduction



In this homework, you will implement some simple time domain exercises with MATLAB.




1.1 Advanced Peak Finder




In this part, you will improve your peak detection algoritm that you developed in the previous homework. You will design a moving average lter (See Chapter 5 : FIR Filters for detailed description) For this lter, you will change the number of samples used for average calculation , N, from 2 to 30. You will plot the number of peaks you found versus N (include no lter option also i.e. peaks without moving average lter). Add these plots to your pdf report. Name your script as AdvancedPeakFilter.m




1.2 Frequency (Pitch) of the Sound




In this part, you will follow the instructions in waveexample.m on laughter.wav sample le and explain the di erences between the applications. Does the sound play the same in di erent applications? Brie y explain in the pdf report.




1.3 N-tap Filter




In the last part, you will design an N-tap lter (see Section 5 for detailed information about FIR lter). This lter is used for alleviating the e ects of delayed versions of the sound. You are asked to write a MATLAB script that combines mike.wav and delayed version of it with K seconds. K is by default 100 miliseconds. You will use the N-tap lter demonstrated at Figure 1:




Delays ( s) will be multiples of K. Second parameter of the function is N. You will change N from 1 -




In your report, explain the e ect of N, and K. Output: You will output three gures.



Use constant N and K, change from 0 to 1 and plot SNR of mike.wav and recovered signal.



Use constant and K, change N from 1 to 50 and plot SNR of mike.wav and recovered signal.



Use constant and N, change K between 100,200,300,400 miliseconds and plot SNR of mike.wav and recovered signal.









1



Figure 1: General description of an N-tap lter







1.3.1 How to Calculate SNR of two audio les




Signal to Noise Ratio (SNR) is used as an objective measure for the metric of imperceptibility. Signal to Noise Ratio (SNR) is a di erence metric that is used to calculate the similarity between the original audio signal and the recovered audio signal. The SNR computation is carried out according to equation 1, where In is the original audio signal, and En corresponds to the watermarked audio signal.



P(
n In
2


(1)
n


n
n
)2
SN R (dB) = 10log
E


I
P















1.4 Report and Notes




Prepare a report explains your code brie y. Add the gures and SNR results to report and m ake comments about created gures for Q1 and Q3. Interpret the results for these questions. Compress the report and the code les. Name it as "YourNumber CmpE362 HW3.zip"(or rar, or 7z etc.). Upload the le to canvas before the deadline. Deadline is strict. When copying is detected, both parties will get zero.


























































2

More products