implementation of an audio reverberation algorithm fergal dunne supervisor: dr. edward jones

18
N ational University Ireland, G alway of Ollscoil na hÉireann, Gaillimh Roinn na hInnealtóireachta Leichtreonaí D epartm ent ElectronicEngineering of Implementation of an Audio Reverberation Algorithm Fergal Dunne Supervisor: Dr. Edward Jones

Upload: roland-mcbride

Post on 16-Dec-2015

219 views

Category:

Documents


0 download

TRANSCRIPT

National University Ireland, GalwayofOllscoil na hÉireann, Gaillimh

Roinn na hInnealtóireachta LeichtreonaíDepartment Electronic Engineeringof

Implementation of an Audio Reverberation Algorithm

Fergal Dunne

Supervisor: Dr. Edward Jones

National University Ireland, GalwayofOllscoil na hÉireann, Gaillimh

Roinn na hInnealtóireachta LeichtreonaíDepartment Electronic Engineeringof

Project Aim

• To implement a reverberation algorithm for audio applications

• Gardner’s reverb algorithm - consists of three variations of the same general approach, intended to simulate rooms of different sizes

• Implementation of a real-time version• Simulation in Matlab -> C• Implementation on a DSP development

system/PC-Based system

National University Ireland, GalwayofOllscoil na hÉireann, Gaillimh

Roinn na hInnealtóireachta LeichtreonaíDepartment Electronic Engineeringof

Reverberation

• A multiplicity of echoes whose speed of repetition is too quick for them to be perceived as separate from one another

• Early and late reflections• Reverberation time – time

taken for the sound intensity to decay to 1/1,000,000th (60 dB) of its original value

National University Ireland, GalwayofOllscoil na hÉireann, Gaillimh

Roinn na hInnealtóireachta LeichtreonaíDepartment Electronic Engineeringof

Gardner’s Algorithm

• Combination of early and late echoes into a “unified” system, intended to simulate rooms of different sizes

• Early reflections trigger late reverberation network• Late reflections delayed until after the last early echo• Tap/gain included to produce the desired level of late

reverberation

National University Ireland, GalwayofOllscoil na hÉireann, Gaillimh

Roinn na hInnealtóireachta LeichtreonaíDepartment Electronic Engineeringof

Late Reflections

• Three similar algorithms – small, medium & large room• Common global structure based mainly, on allpass filters

(both simple and nested) and delays, followed by a first order low pass filter

• Output signal is obtained by summing signals taken from various points along the delay line

National University Ireland, GalwayofOllscoil na hÉireann, Gaillimh

Roinn na hInnealtóireachta LeichtreonaíDepartment Electronic Engineeringof

Which algorithm to use?

• The appropriate reverb algorithm is chosen based on the reverberation time of the room to be simulated (bathroom, auditorium…)

• Reverb time is calculated using Sabines Equation• Sabines equation uses information from the room to

be simulated - room dimensions, material, absorption coefficients…

National University Ireland, GalwayofOllscoil na hÉireann, Gaillimh

Roinn na hInnealtóireachta LeichtreonaíDepartment Electronic Engineeringof

Room Responses - Bathroom

National University Ireland, GalwayofOllscoil na hÉireann, Gaillimh

Roinn na hInnealtóireachta LeichtreonaíDepartment Electronic Engineeringof

Early Echoes

• Only one algorithm needed to simulate rooms of different sizes

• Group of delays (20) followed by a first order low pass filter

• Early echo output is the low pass filtered sum of each delay block

National University Ireland, GalwayofOllscoil na hÉireann, Gaillimh

Roinn na hInnealtóireachta LeichtreonaíDepartment Electronic Engineeringof

Early Echo Response - Auditorium

National University Ireland, GalwayofOllscoil na hÉireann, Gaillimh

Roinn na hInnealtóireachta LeichtreonaíDepartment Electronic Engineeringof

Unified System Response - Bathroom

• Combination of both early and late reflections• Uses medium room “tail” algorithm

National University Ireland, GalwayofOllscoil na hÉireann, Gaillimh

Roinn na hInnealtóireachta LeichtreonaíDepartment Electronic Engineeringof

Real-time Implementation

• Involves the rewriting of Gardner’s Network to process input signals on a sample-by-sample basis rather than processing bulk input samples (entire signals)

• Real-time implementation of non real-time functions: splitting up functions into two parts – real-time part & non real-time part

• Real-time implementation of the in-built Matlab filter function: two architectures – direct form I & II

• Trade-off – Network execution time vs. No. of memory elements needed

National University Ireland, GalwayofOllscoil na hÉireann, Gaillimh

Roinn na hInnealtóireachta LeichtreonaíDepartment Electronic Engineeringof

Translation from Matlab to C

• Real-time implementation on a suitable platform requires a translation of all real-time functions from Matlab to C

• C-code equivalent versions of all real-time Matlab functions were written and verified using the originals as references

• C test program results -> binary file -> read into Matlab -> verified against a Matlab equivalent program

• All results agreed perfectly!

National University Ireland, GalwayofOllscoil na hÉireann, Gaillimh

Roinn na hInnealtóireachta LeichtreonaíDepartment Electronic Engineeringof

C Program Execution

• Requires three user inputs:

• Sampling rate• Simulation file• Binary input file

name containing the samples to be reverberated

National University Ireland, GalwayofOllscoil na hÉireann, Gaillimh

Roinn na hInnealtóireachta LeichtreonaíDepartment Electronic Engineeringof

Functional Verification

National University Ireland, GalwayofOllscoil na hÉireann, Gaillimh

Roinn na hInnealtóireachta LeichtreonaíDepartment Electronic Engineeringof

Implementation on a DSP Development System

• ADSP-21065L EZ-KIT Lite evaluation kit from Analog Devices

• fast 32-bit DSP floating-point processor – 21065L

• a full duplex, 16-bit stereo audio codec – AD1819A (ADC & DAC)

• 544 Kb of internal user memory

• 16-megaword map of external SDRAM

National University Ireland, GalwayofOllscoil na hÉireann, Gaillimh

Roinn na hInnealtóireachta LeichtreonaíDepartment Electronic Engineeringof

Real-time Simulation of C-code on board

• Read in samples from a mic or CD player - ADC

• Process the samples in real-time using Gardner’s algorithm

• Send the samples out to a set of speakers - DAC

• Successful: Early Echo implementation

• Failure due to: lack of internal memory (big arrays), software tools…

National University Ireland, GalwayofOllscoil na hÉireann, Gaillimh

Roinn na hInnealtóireachta LeichtreonaíDepartment Electronic Engineeringof

Implementation on a PC-Based System

• 6025E DAQ plug-in device by National Instruments• A software programmable device (NI-DAQ

Functions) featuring 16 channels (eight differential) of analog input, two channels of analog output

• Two simulation programs:• ‘Pseudo’ real-time application – records n secs of

audio (mic/cd player), processes it, and plays it back in almost real-time

• Real-time application – records and plays back audio in real-time (low sampling rate < 2 kHz)

National University Ireland, GalwayofOllscoil na hÉireann, Gaillimh

Roinn na hInnealtóireachta LeichtreonaíDepartment Electronic Engineeringof

Conclusion

• Ultimate Project Goal: Real-time implementation of a reverberation algorithm for audio applications – practically realised

• A real-time audio reverberation system was implemented but only for low sampling rates

• A “pseudo” real-time system was also implemented• Future work: optimization of code to operate at

higher sampling rates (speech, audio)• Simulation of more room types other than a

bathroom, auditorium & cathedral