A Frequency-Domain Method for Active Acoustic Cancellation of Known Audio Sources
Total Page:16
File Type:pdf, Size:1020Kb
A FREQUENCY-DOMAIN METHOD FOR ACTIVE ACOUSTIC CANCELLATION OF KNOWN AUDIO SOURCES A Thesis presented to the Faculty of California Polytechnic State University, San Luis Obispo In Partial Fulfillment of the Requirements for the Degree Master of Science in Electrical Engineering by Ryan D. Rocha June 2014 © 2014 Ryan D. Rocha ALL RIGHTS RESERVED ii COMMITTEE MEMBERSHIP TITLE: A Frequency-Domain Method for Active Acoustic Cancellation of Known Audio Sources AUTHOR: Ryan D. Rocha DATE SUBMITTED: June 2014 COMMITTEE CHAIR: Dr. Wayne Pilkington, Ph.D. Associate Professor of Electrical Engineering COMMITTEE MEMBER: Dr. Tina Smilkstein, Ph.D. Assistant Professor of Electrical Engineering COMMITTEE MEMBER: Dr. Xiaozheng Zhang, Ph.D. Associate Professor, Associate Dept. Chair, Graduate Coordinator of Electrical Engineering iii ABSTRACT A Frequency-Domain Method for Active Acoustic Cancellation of Known Audio Sources Ryan D. Rocha Active noise control (ANC) is a real-time process in which a system measures an external, unwanted sound source and produces a canceling waveform. The cancellation is due to destructive interference by a perfect copy of the received signal phase-shifted by 180 degrees. Existing active noise control systems process the incoming and outgoing audio on a sample-by-sample basis, requiring a high-speed digital signal processor (DSP) and analog-to-digital converters (ADCs) with strict timing requirements on the order of tens of microseconds. These timing requirements determine the maximum sample rate and bit size as well as the maximum attenuation that the system can achieve. In traditional noise cancellation systems, the general assumption is that all unwanted sound is indeterminate. However, there are many instances in which an unwanted sound source is predictable, such as in the case of a song. This thesis presents a method for active acoustic cancellation of a known audio signal using the frequency characteristics of the known audio signal compared to that of a sampled, filtered excerpt of the same known audio signal. In this procedure, we must first correctly locate the sample index for which a measured audio excerpt begins via the cross-correlation function. Next, we obtain the frequency characteristics of both the known source (WAVE file of the song) and the measured unwanted audio by taking the Fast Fourier Transform (FFT) of each signal, and calculate the effective environmental transfer function (degradation function) by taking the ratio of the two complex frequency-domain results. Finally, we attempt to recreate the environmental audio from the known data and produce an inverted, synchronized, and amplitude-matched signal to cancel the audio via destructive interference. Throughout the process, we employ many signal conditioning methods such as FIR filtering, median filtering, windowing, and deconvolution. We illustrate this frequency-domain method in Native Instruments’ LabVIEW running on the Windows operating system, and discuss its reliability, areas for improvement, and potential future applications in mobile technologies. We show that under ideal conditions (unwanted sound is a known white noise source, and microphone, loudspeaker, and environmental filter frequency responses are all perfectly flat), we can achieve a theoretical maximum attenuation of approximately 300 dB. If we replace the white noise source with an actual song and the environmental filter with a low-order linear filter, then we can achieve maximum attenuation in the range of 50-70 dB. However, in a real-world environment, with additional noise and imperfect microphones, speakers, synchronization, and amplitude- matching, we can expect to see attenuation values in the range of 10-20 dB. Keywords: Digital Signal Processing, Active Noise Control, Discrete Filtering, Frequency Domain, FFT. iv ACKNOWLEDGMENTS I want to formally thank my family and friends for supporting me throughout my collegiate career, especially my parents, Rob and Char, who raised me to believe that I could achieve success through hard work and determination. I would also like to thank my thesis advisor Dr. Wayne Pilkington for meeting with me from week to week to go over my progress and providing suggestions and an expert opinion on the topics of digital signal processing. I also want to thank him for teaching me nearly all I know about signal processing and inspiring and engaging me in his undergraduate lectures. Furthermore, I want to thank my thesis committee members Dr. Tina Smilkstein and Dr. Xiaozheng Zhang, who, in addition to Dr. Pilkington, taught me valuable information in the field of Electrical Engineering. In fact, it was in Dr. Smilkstein’s EE- 521 course where I first formulated and tested the theory that this thesis builds upon. I also learned various image processing techniques in Dr. Zhang’s classes that I applied to digital audio processing in this thesis. Lastly, I want to thank the institution of California Polytechnic State University, San Luis Obispo for providing me with a thorough education in Electrical Engineering and challenging me to apply myself to achieve my fullest potential. v TABLE OF CONTENTS LIST OF TABLES .............................................................................................................. x LIST OF FIGURES ........................................................................................................... xi CHAPTER 1: INTRODUCTION ..................................................................................... 1 1.1 PROBLEM STATEMENT .......................................................................................... 1 1.2 PROJECT OVERVIEW ............................................................................................. 3 1.3 COMPARISON BETWEEN EXISTING AND PROPOSED CONCEPTS .............................. 5 CHAPTER 2: BACKGROUND ....................................................................................... 8 2.1 CURRENT APPROACHES TO NOISE CANCELLATION ............................................... 8 2.1.1 Passive Attenuation ............................................................................................................ 8 2.1.2 Active Attenuation .............................................................................................................. 9 2.2 FREQUENCY-DOMAIN METHOD: PROOF OF CONCEPT ......................................... 14 2.2.1 Example 1: Song as Unwanted Noise Source ................................................................... 14 2.2.2 Example 2: White Noise as Unwanted Noise Source ....................................................... 23 CHAPTER 3: DESIGN REQUIREMENTS .................................................................. 27 3.1 INTRODUCTION ................................................................................................... 27 3.2 ACOUSTIC MEASUREMENTS ................................................................................ 27 3.2.1 Dayton Audio EMM-6 Electret Measurement Microphone ............................................. 28 3.2.2 Blue Icicle XLR to USB Microphone Converter/Preamp ................................................. 30 3.3 LOUDSPEAKER .................................................................................................... 31 3.3.1 M-Audio AV-30 Reference Monitor Loudspeakers ......................................................... 32 vi CHAPTER 4: IMPLEMENTATION ............................................................................. 34 4.1 INITIAL DATA ACQUISITION ................................................................................ 34 4.1.1 Overview .......................................................................................................................... 34 4.1.2 LabVIEW Block Diagrams ............................................................................................... 35 4.1.3 Parameters Chosen ............................................................................................................ 36 4.2 INITIAL SYNCHRONIZATION ................................................................................ 37 4.2.1 Overview .......................................................................................................................... 37 4.2.2 LabVIEW Block Diagram ................................................................................................ 37 4.2.3 Parameters Chosen ............................................................................................................ 39 4.3 TRANSFER FUNCTION .......................................................................................... 40 4.3.1 Overview .......................................................................................................................... 40 4.3.2 LabVIEW Block Diagram ................................................................................................ 41 4.3.3 Parameters Chosen ............................................................................................................ 41 4.4 IMPULSE RESPONSE WINDOWING ....................................................................... 42 4.4.1 Overview .......................................................................................................................... 42 4.4.2 LabVIEW Block Diagram ................................................................................................ 43 4.4.3 Parameters chosen ...........................................................................................................