Description
1 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 filter (See Chapter 5 : FIR Filters for detailed description) For this filter,
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 filter option also i.e. peaks without moving average filter).
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 file and explain
the differences between the applications. Does the sound play the same in different applications? Briefly
explain in the pdf report.
1.3 N-tap Filter
In the last part, you will design an N-tap filter (see Section 5 for detailed information about FIR filter).
This filter is used for alleviating the effects 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 filter demonstrated at Figure 1:
Delays (τ s) will be multiples of K. Second parameter of the function is N. You will change N from 1 –
50. In your report, explain the effect of N, and K.
Output: You will output three figures.
1. Use constant N and K, change α from 0 to 1 and plot SNR of mike.wav and recovered signal.
2. Use constant α and K, change N from 1 to 50 and plot SNR of mike.wav and recovered signal.
3. 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 filter
1.3.1 How to Calculate SNR of two audio files
Signal to Noise Ratio (SNR) is used as an objective measure for the metric of imperceptibility. Signal to
Noise Ratio (SNR) is a difference 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.
SNR (dB) = 10log
P
n
In
2
P
n
(En − In)
2
(1)
1.4 Report and Notes
Prepare a report explains your code briefly. Add the figures and SNR results to report and m ake comments
about created figures for Q1 and Q3. Interpret the results for these questions. Compress the report and
the code files. Name it as ”YourNumber CmpE362 HW3.zip”(or rar, or 7z etc.). Upload the file to canvas
before the deadline. Deadline is strict. When copying is detected, both parties will get zero.
2