Você está na página 1de 16

Project Manual

for
Adaptive Echo Cancellation

Last updated March 22, 2004

Benny Sällberg, bsa@bth.se


Henrik Åkesson, hsy@bth.se
Jörgen Nordberg, jno@bth.se
Contents

1 Introduction 2

2 The Project 3
2.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
2.2 Equipment . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
2.3 Project Procedure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
2.4 Tip . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5

3 Mandatory Tasks 6
3.1 Time Plan . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
3.2 Tasks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
3.3 The DSP-Project room . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
3.4 Project Approval . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7

4 Report 8
4.1 Disposition . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
4.2 Figures . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
4.3 Equations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
4.4 Bibliography . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
4.5 Word Processor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10

5 Assistance 12
5.1 UDL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
5.2 DSP TMS320C31 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
5.3 Spectrum Analyzer Data Format . . . . . . . . . . . . . . . . . . . . . . . 12
5.4 Hardware Problems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
5.5 Supervisor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13

1
Chapter 1

Introduction

This Manual is for the Adaptive Echo Cancellation project, in the course Adaptive Signal
Processing at Blekinge Institute of Technology. The Manual states important and mandatory
parts of the project, how they should be carried out, documented, and presented for passing
the project examination. This Manual will also act as a guideline of how to write the project
report.

2
Chapter 2

The Project

2.1 Introduction
An Adaptive Echo Canceller (AEC) aims in cancelling or reducing crosstalk interference in
a system, by employing adaptive filters.

Examples of AEC-applications

• Hands-free telephony system echo reduction

• Telephone network 4-2-wire hybrid echo reduction

• Reduction of echoes in speaker amplification systems, for an example in auditoriums

2.2 Equipment
The following list of equipment is for implementing an acoustic echo cancellation system,
the setup is illustrated in Fig. 2.1.

1. A Digital Signal Processor TMS320C31/32, from Texas Instrument.

2. Anti-alias and reconstruction filters.

3. Signal source, reference signal.

4. Signal sink, for the error signal.

5. Microphone, with preamplifier.

6. Loudspeaker

7. Cables and connectors.

Other available instruments are: Spectrum Analyzer, Oscilloscope, Loudspeaker, Filter,


Function Generator etcetera.

3
2.3. Project Procedure Chapter 2. The Project

D ig ita l S ig n a l P ro c e s s o r

x (n )
S o u rc e L P F

L M S w (n ) h (n )
e (n ) - d (n )
+
S in k L P F

Figure 2.1: Setup for implementing an acoustic echo cancellation system. LPF are anti-alias,
and reconstruction low pass filters.

2.3 Project Procedure


Preparation
Make a copy of the through example program. Convert your copy of the through-program
into a new project. See section 5.1 for further reading on the development environment, and
on how to use existing projects as templates for creating new projects. The through-program
samples the input channels and sets the output channels to the same values. As always, when
implementing algorithms on DSP, the utilization of the dynamic voltage ranges of the ADC
and DAC is evident for gaining performance, and minimization of numerical errors. Find a
proper way of investigating the dynamic voltage ranges of the DSP’s ADC and DAC, BUT
BE CAREFULL, START WITH A VOLTAGE OF 1 VOLT PEAK-TO-PEAK. In figure
2.2 an overview of the DSP configuration is illustrated. Note that the DSP TMS320C32 has
a different notation of the ADC- and DAC-channels than the TMS320C31. Get acquainted
to the UDL program. Examine for example the program variables in real-time and verify
that the have correct values, see the DSP User Guide.

Simulations
It is not required, but recommended, that the algorithm implementations are first simulated
and verified in Matlab. By doing so, the DSP implementation is likely to be less defiled by
those mathematical- and algorithm-specific errors.

Implementation
First, set up your experiment hardware properly, i.e. allocate cables, connectors and instru-
ments required for carrying out the project.

4
2.4. Tip Chapter 2. The Project

P C

C h A In C h A O u t
A D C D A C
(C h A ) (C h C )
D S P T M S 3 2 0 C 3 1
(D S P T M S 3 2 0 C 3 2 )
C h B In A D C D A C C h B O u t
(C h B ) (C h D )

P C

Figure 2.2: Block diagram of the DSP configuration

2.4 Tip
How the source-code implementation is carried out is not of higher interest in this project,
but some important issues are listed below. These issues are in general terms, but of special
interest in DSP-environments with limited debugging capabilities.

SMALL STEPS Implement your algorithm in small steps, verify each new step, if possible.

BACKUPS Before carrying out major changes in your code, or before starting a new day’s
work, make a backup of your source code. Remember to comment the backup revision
number properly, in the end of the project, it is likely to have many revisions of the
source code.

USE LIBRARIES Prefer pre-installed libraries, in as far extent as possible. It is not time
efficient to; "to invent the wheel twice". This might not be possible to conform to,
when implementing highly optimized algorithms. The header file is named ensigdsp.h
for the TMS320C31 and hkrc32.h for the TMS320C32.

COMMENTING Comment your source code carefully. It should not be over-commented,


nor should it be under-commented. A good measure is to comment in such an extent,
that it would be a relatively easy task to reinsert yourself in the source code at a later
point of time.

INDENTION Indent your source code properly.

C-/ASM-SYNTAX Have one, uniform, naming standard for variables, functions, constants
etcetera.

5
Chapter 3

Mandatory Tasks

3.1 Time Plan


It is not allowed to start the actual project work, until a time plan is handed in to the
project supervisor(-s). The time plan should be SENT BY E-MAIL as PDF-FILE to the
PROJECT’S SUPERVISOR(-S).
WHEN THE TIME PLAN IS APPROVED, THE PROJECT STARTS.

The time plan should include:


• Name, class, and e-mail of all project-members.

• Name, and e-mail of the project’s supervisor(-s).

• A detailed time-plan for the full duration of the project. All parts, and important steps,
of the project should be denoted. Time estimates for each part or step should also be
included.

3.2 Tasks
The following tasks must be carried out to pass the project:
Background Information Read articles, books, and search for information on the web on
how to solve the problem.

Preliminary Planning Sketch on paper, or digitally, the proposed solution.


Note: Preliminary planning is a key to reduce, or to fully avoid, later issues when
carrying out the DSP implementation.

Implementation Implement the algorithm in DSP.

Results The results should be based on measurements, and if possible, in combination with
results from Matlab-simulations. Preferably the results should emphasize the perfor-
mance of the implementation, i.e. comparison of having the algorithm switched on,
and off.
6
3.3. The DSP-Project room Chapter 3. Mandatory Tasks

Report Write a project report and use the proposed disposition in section 4.1.

Oral Presentation Give an oral presentation of the project.

3.3 The DSP-Project room


In order to be allowed to access the DSP-project room, you must book a seat. There are
papers at the door of the DSP-project room, on which you can note your bookings. Some
basic rules for booking and for using the project room:

• You must enter your name, and your e-mail address when registering a booking.

• You may not register more than one booking in advance.

• Respect other students working in the room.

• Before starting working, check cables, connectors and settings of the instruments.
They could have been used and altered, since you experimented last.

• Tidy your working area up when leaving the project room: put trash in the trashcan,
put unused cables and connectors back, log off the computer, and switch instruments
off.

3.4 Project Approval


To get the project approved one has to:

• Hand in a time plan, and get it approved by the supervisor(-s).

• Get the report finished and approved by the supervisor(-s).

• Pass the oral presentation of the project.


Note: The report does not have to be finished when giving the oral presentation, but
permission from the supervisor(-s) is required to be allowed to give the oral presenta-
tion.

7
Chapter 4

Report

Feel free to choose any type of word processor for report writing. But the suggested dispo-
sition, see section 4.1, must be withheld. This Manual has been written using LATEXReport
style, see section 4.5, and could be seen as an example on how the report disposition should
look like.

4.1 Disposition
Following must be included in the report.

Title Project title, each project member’s: name, e-mail and class, name and e-mail to
supervisor(-s), and date of submission.

Abstract A brief presentation of the problem, the proposed solution, the implementation,
and the most interesting results, should be denoted in the abstract.
Hint 1: The abstract should NOT exceed half a page.
Hint 2: Try to write an abstract, as if it was meant for selling your implementation.

Table of Contents

Introduction Introduction to the field of adaptive filter theory, notch filters, etcetera. With
proper references to literature, web-references (with date), and other published ma-
terial. A typical subsection could be Problem formulation, i.e. formulation of the
problem for which the proposed solution is to compensate for.

Proposed solution In this section a detailed, analytical, presentation of the proposed solu-
tion is given, with algorithms and structures described.

Experiment setup Detailed presentation of the experiment setup. Listing of hardware used,
and hardware specific settings, e.g. Spectrum Analyzer’s window-type, overlap-percent,
sampling frequency etcetera. The presentation of the experiment setup should be self-
contained, i.e. by only using the report as reference, the experiment should be possible
to be set up, without any additional background research.

8
4.2. Figures Chapter 4. Report

Source code General presentation of C, ASM, and Matlab source code, e.g. block-diagrams,
state-diagrams etcetera. Vital source-code blocks of the implementation should be pre-
sented more thoroughly in this section. The inclusion of the full source code should
rather be in appendix.

Results Presentation and comments on the results. Typical interesting results to highlight:
suppression rates, convergence rates, filter-lengths versus suppression rates. As well as
presenting "good/positive" results, it is equally important to show on scenarios where
the algorithm is not suitable.
Note: Plots, graphs, and tables are excellent examples of how to present the results.

Conclusions Conclusions that could be drawn from the project, the implementation, and the
results.

Appendices Code-listings, project timetable, large pictures, tables, lists, etcetera, should be
in appendix not in the sections.

List of Figures List of figures

List of Tables List of tables

Bibliography Bibliography, see section 4.4.

4.2 Figures
All figures should have descriptive, stand-alone, texts. An illustration of how a figure is
expected to be, is presented in Fig. 4.1.
Note 1: No references should be given in figure texts.
Note 2: Any figure presenting physical data, must have PROPER LABELS on x-, y-, and
eventually z-axes, WITH CORRECT SI-UNITS, e.g. [s], [Hz], [m], [V].
Note 3: Spectrum Analyzer plots should be exported and plotted in Matlab, utilities for
converting Spectrum Analyzer ".DAT" files into Matlab ".MAT" files exists.

4.3 Equations
All equations included in the report should be numbered. An equation is often derived in
several steps, if that is the case, show those steps and explain the derivation. Referring to an
equation should look like follows:
The mean x̄ of a signal x(n) is estimated as in equation 4.1 where N is the number of
samples.
N
1 X
x̄ = x(n) (4.1)
N n=1

9
4.4. Bibliography Chapter 4. Report

Suppresion of a damped sinus


1.5
Noise Signal
Cancellation Signal
Suppressed Signal

0.5

Amplitude [V]
0

−0.5

−1

−1.5
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1
Time [s]

Figure 4.1: Time-data of ANC on sinusoidal noise. The noise source signal (solid), the
cancellation signal (dashed), the suppressed noise signal (dotted).

Vectors and matrices should be written in Bold typeface, like in equation 4.2. A compact
version of the Wiener-Hopf matrices is given in equation 4.3.

Rx w = rdx (4.2)

    
rx (0) rx∗ (1) · · · rx∗ (p − 1) w(0) rdx (0)
 rx (1) rx (0) · · · rx∗ (p − 2)  w(1)   rdx (1) 
= (4.3)
    
 .. ... ..  .. .. 
 . .  .   . 
rx (p − 1) · · · rx (0) w(p − 1) rdx (p − 1)

4.4 Bibliography
All references that are used in the report should be listed at the end of the report, either in
the order as they are referred to, or in alphabetic order. Furthermore, all references must be
described in such an extent, that the source could easily be found. The use of a reference
could look like follows: The wiener filter [2] implemented in the DSP is an optimum digital
filter. Some of the FIR filter structures [4] are useful when programming DSP’s.

4.5 Word Processor


LATEXis a document preparation system for high-quality typesetting. It is most often used
for medium-to-large technical or scientific documents, but it can be used for almost any
form of publishing. LATEXcan be found on the internet ”miktex for windows” together with
Ghostscript and WinEdt. Ghostscript for being able the view included figures and pictures,
10
4.5. Word Processor Chapter 4. Report

and WinEdt for text editing, supporting many LATEXcode functions. WinEdt could be found
as Shareware at http://www.winedt.com.

11
Chapter 5

Assistance

5.1 UDL
Read the User guide for the DSP TMS320C31/C32, [3].

5.2 DSP TMS320C31


The DSP TMS320C31/C32 Software Manual [1] has a list of the build in function that are
available when programming the DSP. It also contains full descriptions for each command.
There is also a free ebook available at http://www.bth.se/eng/Library.nsf. Choose → Infor-
mation resources → Electronic Books → Electronic and Electrical Engineering Collection
→ Digital Signal Processing: Laboratory Experiments Using C and the TMS320C31/C32
DSK

5.3 Spectrum Analyzer Data Format


When saving data to disk from the Spectrum Analyzer 35665A, the data will be saved in
HP SDF format. To be able to use the data in Matlab, the data has to be converted from
SDF format to a more appropriate format, e.g. Matlab .mat format. This could be done by
using the program SDFTOML.EXE at http://www.stanford.edu/class/ee122/Handouts/. It is
also possible to convert .Dat files directly to .ascii files in a four channel signal analyzer and
subsequently import these files directly to Matlab.

5.4 Hardware Problems


Check cables and connectors, settings of instruments etcetera. Try to back-trace eventual
problems.

12
5.5. Supervisor Chapter 5. Assistance

5.5 Supervisor
When you got stuck, or you have a phenomena you do not understand, you can ask your
supervisor for help. Make sure that you already tried to identify and solve the problem
before asking your supervisor.

13
List of Figures

2.1 Setup for implementing an acoustic echo cancellation system. LPF are anti-
alias, and reconstruction low pass filters. . . . . . . . . . . . . . . . . . . 4
2.2 Block diagram of the DSP configuration . . . . . . . . . . . . . . . . . . . 5

4.1 Time-data of ANC on sinusoidal noise. The noise source signal (solid), the
cancellation signal (dashed), the suppressed noise signal (dotted). . . . . . 10

14
Bibliography

[1] ENSIGMA. DSPLib DSP Routines for TMS320C3X/4X. Ensigma Ltd. Dallas, Texas,
1994.

[2] Monson H. Hayes. Statistical digital signal processing and modelling. Wiley, 1996.

[3] Henrik Åkesson. DSP TMS320C31/C32 USER’S GUIDE. Applied Signal Processing
Research Group, Blekinge Institute of Technology, Box 520, SE-372 25 Ronneby, Swe-
den, March 2004.

[4] John G. Proakis. Digital signal processing: principles, algorithms and applications.
Prentice-Hall, Inc., third edition edition, 1996.

15

Você também pode gostar