hey,I hope you are well.I needed some help in solving my DSP homework.Your help will be appreciated.
Thanks 🙂
Homework 3
EE 415
DSP and Filter Design
March 31, 2016
This homework is due on Thursday, 7th April before the start of the class. You are
welcome to send me a soft copy of your assignment at aleem@pnec.nust.edu.pk before
Tuesday?s class. You can consult one another for this assignment, but copying from one
another is not allowed.
1
Reading Assignment
Read sections 2.1, 2.3, 2.7, 4.1, 4, 2 and 4.3 of Oppenheim and Schafer Discret-Time
Signal Processing Second Edition
2
Problems
Question 1. Suppose that a discrete-time signal x[n] is given by the formula
x[n] = 4cos(0.6?n + 5?/7)
If the sampling rate of the C-D converter is fs = 90 samples/second, many di?erent continuoustime signals could have been inputs to the above system. Determine two such inputs with frequency between 360 and 450 Hz; i.e. ?nd x1 (t) = A1 cos(w1 t+?1 ) and x2 (t) = A2 cos(w2 t+?2 )
such that x[n] = x1 (nTs ) = x2 (nTs ) if Ts = 1/90 seconds.
Question 2. Suppose the sinusoid x(t) = cos(0.3?t + ?/4) is input to a continuous-todiscrete converter with sampling frequency fs .
a. Find an fs that would result in x[n] = cos(0.5?n + ?/4).
b. Find an fs that would result in x[n] = cos(0.25?n + ?/4).
Question 3. Consider the system shown in ?gure 1.
Input to the ideal C/D converter is
x(t) = 2cos(44?t) + 4cos(32?t + 3?/4)
a. Sketch the spectrum of x(t), the input to the CD converter, where fs1 = 20 samples
per second.
1
Figure 1: Ideal C/D and D/C converter
b. Sketch the spectrum of x[n], the output of the CD converter.
c. If the sampling rate of the ideal DC converter is fs2 = 100 samples per second, sketch
the spectrum of the output signal y(t).
Question 4. Suppose we recorded a 3 seconds of piano note with a fundamental of 440 Hz
using a sample rate of 8 kHz.
a. Suppose we play back our piano recording at three times the record speed, i.e., we
play it back using a playback rate of 24 kHz. What will be the fundamental frequency of
the played back sound? How long will the sound last?
b. Now suppose we want to play back our piano recording at such a rate that it sounds
like it has a fundamental of 311 Hz. What playback sample rate should we use? How long
will the resulting sound last at that playback rate?
Question 5. Do problem 4.4 of Oppenheim and Schafer Discret-Time Signal Processing
Second Edition.
Question 6. Do problem 4.5a of Oppenheim and Schafer Discret-Time Signal Processing
Second Edition.
Question 7. Do problem 2.11 of Oppenheim and Schafer Discret-Time Signal Processing
Second Edition.
Question 8. In this problem, you will analyze the e?ects of changing the sampling rate of
an audio signal.
a. Record your voice of 4 seconds duration using MATLAB?s audiorecorder function.
Keep the Sampling rate at 44, 100 Hz and bits per sample equal to 8. The instructions on
using audiorecorder can be found at http://www.mathworks.com/help/matlab/import
export/record-and-play-audio.html
b. Save your audio recording as an array ?x? using getaudiodata function. Now play
the saved array ?x? using audioplayer function with sampling rate, F S, set at 44, 100 Hz,
22, 050 Hz and 88, 200 Hz. What do you observe? Explain the di?erent e?ects based on
what is happening to the spectrum of the signal at the di?erent sampling rates.
c. Drop half samples of ?x? and save your new signal as ?xh ?. Now play this new signal
at 44, 100 Hz and 22, 050 Hz. Explain what is happening.
Question 9. Write your own MATLAB code for convolution and correlation operations.
a. Your function should take two vectors x and h, and their axis information as input
and produce two vectors y and n as output, where y is the convolution/correlation of x and
h, and n contains the axis information , which will ensure the correct plotting of y.
2
b. The function should generate a stem plot of y with properly labeled x-axis.
c. Use circshift and ?iplr commands in your MATLAB function.
d. Zero pad the signal where required.
e. Use your code to verify and plot the results of problem 7 of homework 2. Make sure
the plots are labelled correctly.
3