Starting from:

$29

Homework #2: Room acoustics

In Example 2.8, we discussed a digital recursive IIR reverberator, which is also
known as “comb reverberator.” In this homework, you will try to implement an
“allpass reverberator” which is introduced by Schroeder and Logan (1961) to prevent
“coloration” of the input sound by the comb reverberator. The allpass reverberator can
be modeled or implemented via the following recursive LCCDE.
y[n]  ay[n  D] ax[n] x[n  D],
where all the symbols in the LCCDE share the same definitions in Example 2.8. With
this LCCDE modeling, please try to answer the following questions.
(a) Derive the impulse response of this allpass reverberator and compare with the one
derived in Eq. (2.102). Please use the MATLAB function filter() to compute and
plot the impulse responses of the allpass and comb reverberators and to verify
your derivation , where a = 0.7, and D = 5.
(b) Please comment whether this allpass reverberator can be potentially implemented
in real time and under what condition of a and D this allpass reverberator is stable.
(c) Approximate the allpass reverberator as a FIR filter and implement it using the
MATLAB function filter() (or conv()) with a = 0.7 and D = Fs where D is the
delay in sampling interval given the delay = 0.1 sec. and sampling rate Fs (in
Hz). Given the sound file Halleluyah.wav, you can load the file, play the sound
and save the output sound by using the following MATLAB codes:
[x, Fs] = wavread(' Halleluyah.wav');
sound(x, Fs);
wavwrite(y,Fs, ' Halleluyah_FIRecho_Allpass.wav');
where x is the input sound (a column vector), y is the output sound (a column
vector, too), and Fs is the sampling rate in samples/sec (i.e., in Hz).
Please elaborate how you approximate the reverberator as a FIR filter. That is,
elaborate how you determine the order of the FIR filter (i.e., the M in the general
LCCDE in Eq. 2.94). Also plot x and y together as a function of time and check
the changes in x done by your FIR filter. You may need to zoom in the plot to see
the changes in details.
(d) Write your own MATLAB codes to implement the allpass reverberator using the
provided recursive LCCDE with a and D being the same values used in (c). To2/3
generate digital reverberation, we will use the same sound file in (c), and save
your output sound as Halleluyah_IIRecho_Allpass.wav. You may verify your
results using MATLAB function filter(). Note that you have to provide the initial
condition (i.e., y[n] and x[n], n < 0) used in your implementation. Also plot x and
y together as a function of time, check the changes in x done by your IIR filter,
and comment the output differences between the two different implementations in
(c) and (d). Note that you may need to zoom in the plot to see the changes in
details.
(e) Change the a in (d) to the values resulting in an unstable reverberator, and grasp
the feeling about the output of an unstable reverberator sounds like, also with the
sound file used in (d) as the system input.
(f) Change the initial condition (e.g., y[n] = x[n] = 1, n < 0, or y[n] and x[n] are
random numbers (try MATLAB function rand()), n < 0. Note that you may try to
scale y[n] or x[n] to the values close to your input) which you used in (d) and see
how the initial condition affect the results. Plot the outputs with different initial
condition together as a function of time and tell the difference, also with the sound
file used in (c) as the system input and the a and D the same values used in (c).
(g) Following (f), verify whether the system output y[n] is equal to the zero-input
response plus zero-state response.
(h) Implement the comb reverberator in Example 2.8 using the MATLAB function
filter() and the same input sound file, a and D in (d) and save your output sound as
Halleluyah_IIRecho_Comb.wav. Can you hear or see by plot any output
differences between the two reverberator? Please comment on the differences via
the magnitude responses of the two reverberators? Also from the magnitude
responses, do you know why one is called “comb” reverberator and the other is
called “allpass” reverberator? Note that the magnitude response is the magnitude
of the frequency response, i.e.,
( )
( )

 j
j
X e
Y e
, where  is from – to + or
( 2 )
( 2 )
X j F
Y j F


. Note that the frequency response can be calculated with the sample
codes used in your homework #1, and you may need to plot the two magnitude
responses together to see the difference.
Notice:
1. Please hand in your solution files to the LMS elearning system, including your
word file of the detailed solutions, the associated Matlab codes, and all the related3/3
materials. It would be nice that you can put your codes with comments side by
side along with your answer in the word file.
2. Name your solution files “EE3660_HW2_StudentID.doc” and
“EE3660_HW2_StudentID.m”, and archive them as a single zip file:
EE3660_HW2_StudentID.zip.
3. The first line of your word or Matlab file should contain your name and some
brief description, e.g., % EE 3660 王小明 u9612345 HW2 MM/DD/2017
.

More products