You are on page 1of 4

EE352 DSP Laboratory

Spring 2013

LAB 7: Real-time audio effects and Overlap-save method


This assignment consists of 2 parts.
1. In part1, you will simulate room response effects using available measured stereo
impulse responses with real-time audio processing. You can implement the audio effect
on the provided speech and music segments via convolution processing (time domain) on
the DSK. Next, try it out on real-time voice input from a microphone while listening to
the output over headphones.
2. Part2 gives a demonstration of Overlap-save method based on block processing
technique which you have learnt in Lab 6. Overlap-save method is used to do filtering in
frequency domain.

PART 1 Real-time audio processing:


Steps involved in the experiment:
1. The experiment can be performed at both 8 kHz and 16 kHz sampling rate to generate a
stereo output. You have been provided with the input files Machali_male.wav,
Machali_female.wav and Music.wav sampled at 8 kHz and 16 kHz. The effect
generating stereo impulse responses are made available at both 8 KHz and 16 kHz
sampling rates in a header file coeff.h.
2. Implement the audio effect using both linear and circular convolution techniques. Use the
solution codes of linear and circular convolution provided on moodle to frame your
experiment so as to get a stereo output. To get a stereo output duplicate the mono input
and filter them independently using the given left and right channel impulse responses.
For this you will have to call the buffering function twice i.e. one for each channel.
3. Input signals should be acquired in real time through the DSK codec. Play the input files
from your PC soundcard to the line-in of your DSK codec. You can also use your own
voice through a microphone connected to mic-in of the DSK codec. In each case, you
need to make the appropriate settings in DSK5510_AIC23_Config . To acquire input
through line in set the Analog audio path control value to 0x0011 and to 0x0015
for acquiring the input through mic-in. You can refer the datasheet of AIC23 codec for
more details.
4. You can try this experiment with various other room responses available on following
website (http://www.voxengo.com/impulses/) keeping in mind constraints of processor
speed and memory.

5. To create header files out of these responses, read the impulse response in MATLAB
using wavread command. You may also require audio tool Audacity to manipulate
the sampling frequencies and the response time considering the memory and speed
constrain.

NOTE:
While implementing the effects using circular buffer, a limitation is imposed on the value
that can be given to the registers BRC0 and BK03. The value cannot exceed 4096. In
order to overcome this limitation we assign values to these registers in the following way
instead of conventional way. For more details you can refer to CCS Help file Assembler
Warning On Use of MMR Address (warning: W9999).
MOV #FIR_len, mmap (BK03)
MOV #FIR_len-1, mmap (BRC0)
By doing so you can increase the range of values that can be assigned to these registers
from 4096 to approx 14000.

Part2 Overlap-save method for frequency domain filtering:


In the above part, FIR filtering was implemented in time domain using linear and circular
buffering techniques. In this section, a similar filtering operation is implemented in frequency
domain using Overlap-save method, which is one of the efficient techniques used for
frequency domain filtering. This method is implemented with the help of block processing
technique which you have learnt in Lab 6.
Overview of Overlap-save method
This section gives a brief description of the overlap-save method. For complete details you
can refer to Chapter 7 in the book J.G. Proakis and D.G. Manolakis, Digital Signal
Processing: Principles, Algorithms, and Applications, Prentice-Hall, NJ, Fourth Edition,
2007 (a scanned copy of the required pages is uploaded in moodle).
Assume that the length of the filter coefficients is L and the input data size is M, then the
convolved output will have N=L+M-1 values. So if we have a real-time data coming
continuously and would like to use a frequency domain approach to filtering then we need to
implement product of FFTs. For efficient FFT operation we need to fix the value of N to be
some power of 2 which is greater than L. We increase the length of the filter to N by
padding M-1 0s at the end of filter coefficients. Similarly we take blocks of input data
which are of length M and prepend the more recent L-1 values of the previous input data

block. If the ith input block is represented by Xi(n) and filter coefficients are represented as
h(n), N point FFTs of Xi(n) and h(n) are computed and their product is obtained. Now
IFFT of this product is computed. The first L-1 values of the resulting output are discarded
and remaining output values are concatenated at each stage to form the correct output.
Example: - Suppose our filter length is 12 and the FFT size we are interested is128, i.e.,
L=12 and N=128, then M=N-L+1=117. So every time we collect 117 values of data and
process them. So, each time we insert the last 11 values of the previous input data block to
the current input data block. Also we append 116 zeros to the filter coefficients. Let the input
block be X(n) and impulse response be H(n), now
X(k)=FFT(X(n)) and H(k)=FFT(H(n)) are computed (128 point FFT).
Y(n)=IFFT(X(k)* H(k)) is computed and the first 11 values are discarded each time and
remaining samples are sent as output.

Exercise
This part of the exercise is to understand and implement overlap-save method. The entire code
for the overlap-save method is given to you with few portions of the code missing (These
portions are indicated by XXX in the code). You need to complete the missing portions of the
code. The filter given to you is a low pass filter of length 12. The FFT size you have to use is
128. Calculate the cutoff frequency of the given filter by observing the output.

Lab 7
Verification Page
Names:

TA Name:

Group Number:

.
Demonstrate the various audio effects using the impulse responses provided to you and
get it verified by your TA.

Explain why the output gets distorted beyond certain sampling frequency for a given
length of impulse response. Give a quantitative analysis using profiling.

Comment on the output observed by increasing the size of the impulse response.

Demonstrate the Overlap-Save method and get it verified by your TA.

Experimentally measure and plot the frequency response of the filter given to you.

Verified: ..

Date:

You might also like