Presentation is loading. Please wait.

Presentation is loading. Please wait.

ECE 598: The Speech Chain Lecture 5: Room Acoustics; Filters.

Similar presentations


Presentation on theme: "ECE 598: The Speech Chain Lecture 5: Room Acoustics; Filters."— Presentation transcript:

1

2 ECE 598: The Speech Chain Lecture 5: Room Acoustics; Filters

3 Today Room = A Source of Echoes Room = A Source of Echoes Echo = Delayed, Scaled Copy Echo = Delayed, Scaled Copy Addition and Subtraction of Scaled Cosines Addition and Subtraction of Scaled Cosines Frequency Response Frequency Response Impulse Response Impulse Response Filter = A System with Echoes Filter = A System with Echoes

4 Room Acoustics Sample Application: The Beckman Cube Virtual Reality Theater

5 Room Acoustics Test Laboratory: the Plywood Cube

6 Measuring the Frequency Response of a Room: 2X2 Locations

7 Direct Sound

8 Direct Sound: Mathematical Notation x(t) = (r s /r 0 ) s(t  0 ) x(t) = Recorded sound pressure (Pascals) x(t) = Recorded sound pressure (Pascals) s(t) = Sound at the source (Pascals) s(t) = Sound at the source (Pascals) r s = radius of the source (lips, loudspeaker, …) r s = radius of the source (lips, loudspeaker, …) r 0 = distance from source to microphone r 0 = distance from source to microphone  0 =r 0 /c = time it takes for sound to travel from source to microphone  0 =r 0 /c = time it takes for sound to travel from source to microphone s(t) = s e j  t x(t) = x e j  t x = s (r s /r 0 ) e  j  0

9 Direct Sound + First Echo

10 x(t) = a 0 s(t  0 ) + a 1 s(t  1 )  1 =r 1 /c = time it takes for the first echo to travel from source to microphone  1 =r 1 /c = time it takes for the first echo to travel from source to microphone a 0 = r s /r 0 (the “1/r scaling” of the direct sound) a 0 = r s /r 0 (the “1/r scaling” of the direct sound) a 1 =  r s /r 1 a 1 =  r s /r 1  = amount by which echo amplitude is reduced when it bounces off the wall = “reflection coefficient”  = amount by which echo amplitude is reduced when it bounces off the wall = “reflection coefficient”  depends on the material:  ≈1 for hardwood,  ≈0.1 for carpet  depends on the material:  ≈1 for hardwood,  ≈0.1 for carpet s(t) = s e j  t x(t) = x e j  t x = s ( a 0 e  j  0 + a 1 e  j  1 )

11 Direct Sound + Lots of Echoes

12 The Image Source Method for Simulating the Room Response (Berkeley and Allen, 1979) Key Observation: An echo arrives at the microphone from the same direction, having traveled exactly the same distance, as if it had come from an “image source” located behind the wall. The location of the “image source” is the “mirror image” of the location of the true source, after reflection through the wall.

13 Image Source Method: Lots of Echoes An echo that bounces off multiple walls behaves as if it had come from several rooms away.

14 Direct Sound + Lots of Echoes x(t) =  a n s(t  n ) a 0 s(t-  0 ) = direct sound a 0 s(t-  0 ) = direct sound a n s(t-  n ) = n th echo a n s(t-  n ) = n th echo s(t) = s e j  t x(t) = x e j  t x = H(  ) s H  is called the “frequency response” of the room, at frequency  : H  is called the “frequency response” of the room, at frequency  : H(  ) =  a n e  j  n n=0 ∞ ∞

15 Example: Starter Pistol Direct sound: an “impulse” (a very short, very loud sound: s(t)=  (t)) An impulse has energy at all frequencies; we say s(  )=1 regardless of  Impulse response: a series of delayed, scaled impulse echoes, x(t) =  a n  (t-  n ) Frequency response: the frequency “coloration” you hear is the frequency response of the room: x(  ) = H(  ) s(  ) = H(  ) =  a n e  j  n

16 Example: Sweep Tone Direct sound is a cosine, s(t) = e j  t, with  changing slowly Recorded sound is a scaled, phase-shifted cosine, x(t) = H(  ) e j  t H(  ) of the room (the subject of today’s lecture) Spectrum of the background noise Signal to noise ratio, as a function of frequency

17 Today’s Important Math Fact: Cosine + Cosine Echo = Scaled, Shifted Cosine

18 Cosine + Cosine Echo: Phasor Notation x(t) = a 0 e j  (t  0 ) + a 1 e j  (t  1 ) = e j  t (a 0 e  j  0 + a 1 e  j  1 ) = e j  t (a 0 e  j  0 + a 1 e  j  1 )  0 = Phase shift caused by traveling from source to microphone, direct sound (in radians)  0 = Phase shift caused by traveling from source to microphone, direct sound (in radians)  1 = Phase shift, first echo (radians)  1 = Phase shift, first echo (radians)

19 Cosine + Cosine Echo: Phasor Notation H(  ) = a 0 e  j  0 + a 1 e  j  1 = {a 0 cos(  0 )+a 1 cos(  1 )}  j{a 0 sin(  0 )+a 1 sin(  1 )} ) = a x cos(  x )  ja x sin(  x ) So H(  ) = a x e  j  x for some a x and  x So H(  ) = a x e  j  x for some a x and  x

20 If s(t) is a cosine, then x(t) is a scaled shifted cosine x(t) = H(w) s(t) = a x e  j  x e j  t = a x e j(  t  x ) Re{x(t)} = a x cos(  t  x ) If s(t)=cos(  t), then x(t) is a scaled, shifted cosine at the same frequency! If s(t)=cos(  t), then x(t) is a scaled, shifted cosine at the same frequency! The scaling factor a x and the phase shift  x depend on frequency in some way (remember that  0 =  0 and  1 =  1 ) The scaling factor a x and the phase shift  x depend on frequency in some way (remember that  0 =  0 and  1 =  1 ) Next question: how can we calculate a x and  x ? Next question: how can we calculate a x and  x ?

21 ONAMI (Oh No! Another Math Idea!)*: Magnitude and Phase of a Complex Number Suppose z=z R +jz I z R = Re{z} z I =Im{z} We can also write z=Ae j  = Acos  +jAsin  A = |z| (“magnitude of z”)  = arg(z) (“phase of z”) Obviously, z R =Acos  ; z I =Asin  * “oonami” (“oo”=long /o/) means “big wave” in Japanese. Curiously enough, “onami” (short /o/) means “little wave.” Meaningless but entertaining question for the reader: is the magnitude and phase of complex numbers a big wave, or a little wave?

22 Finding the Magnitude and Phase Finding the magnitude: A 2 =z R 2 +z I 2 Finding the magnitude: A 2 =z R 2 +z I 2 Proof: z R 2 +z I 2 =A 2 cos 2  +A 2 sin 2  = A 2 (cos 2  +sin 2  ) = A 2 Finding the phase if z R > 0:  =tan -1 (z I /z R ) Finding the phase if z R > 0:  =tan -1 (z I /z R ) Proof: z I /z R =sin  /cos  =tan  Finding the phase if z R < 0:  =tan -1 (z I /z R )  Finding the phase if z R < 0:  =tan -1 (z I /z R )  The Problem:  = tan -1 (z I /z R ) is always between –  /2 and  /2 so cos(  ) is always positive! The Solution: assume, instead, that  = tan -1 (  z I /  z R ) so Ae j  = Acos  +Asin  =  z R  jz I =  z =  e j  = Ae j  e j   = Ae j(  )

23 Imagining the Magnitude and Phase of a Complex Number: Four Examples Real Part Imaginary Part zRzR zIzI z=z R +jz I A  Real Part Imaginary Part zRzR zIzI A  Real Part Imaginary Part zRzR zIzI A  Real Part Imaginary Part zRzR zIzI A  zIzI zRzR  zIzI zRzR 

24 Magnitude and Phase of A Frequency Response H(  ) =  a n e  j  n = H R +jH I = A e j  A 2 = H R 2 +H I 2 A 2 = H R 2 +H I 2  = tan -1 (H I /H R ), possibly ±   = tan -1 (H I /H R ), possibly ±  Here’s what it means: Here’s what it means: If: If: s(t) = e j  t ; Re{s(t)} = cos(  t) s(t) = e j  t ; Re{s(t)} = cos(  t) Then: Then: x(t) = H(  ) e j  t ; Re{x(t)} = A cos(  t+  ) x(t) = H(  ) e j  t ; Re{x(t)} = A cos(  t+  ) n=0 ∞

25 Filters A “filter” is any system that adds its input to scaled, shifted copies of itself A “filter” is any system that adds its input to scaled, shifted copies of itself x(t) =  a n s(t  n ) x(t) =  a n s(t  n ) In order to find x(t), we need two pieces of information: In order to find x(t), we need two pieces of information: The input, s(t) The input, s(t) The sequence of echo times,  n, and echo amplitudes, a n. This whole sequence of information is often summarized by the “impulse response” of the system, h(t) =  a n  (t  n ). Remember that  (t) is a very short, very loud sound, like a gunshot. h(t) is the output of the system if the input is  (t) The sequence of echo times,  n, and echo amplitudes, a n. This whole sequence of information is often summarized by the “impulse response” of the system, h(t) =  a n  (t  n ). Remember that  (t) is a very short, very loud sound, like a gunshot. h(t) is the output of the system if the input is  (t) Given s(t) and h(t), we find x(t) using “convolution:” Given s(t) and h(t), we find x(t) using “convolution:” x(t) = s(t)  h(t) =  a n s(t  n ) x(t) = s(t)  h(t) =  a n s(t  n ) In matlab, In matlab, s=wavread(‘speechsound.wav’); s=wavread(‘speechsound.wav’); h=wavread(‘impulseresponse.wav’); h=wavread(‘impulseresponse.wav’); x=conv(s,h); or x=filter(h,1,s); x=conv(s,h); or x=filter(h,1,s); n=0 ∞ ∞ ∞

26 Summary: Filters A “filter” is any system that adds the direct sound together with any number of echoes. There are two methods for simulating a filter in software: A “filter” is any system that adds the direct sound together with any number of echoes. There are two methods for simulating a filter in software: Impulse response: Impulse response: Given h(t) =  a n  (t  n ), compute Given h(t) =  a n  (t  n ), compute x(t) = s(t)  h(t) =  a n s(t  n ) Frequency response: Frequency response: Break down s(t) into a sum of cosines, s(t)=s e j  t Break down s(t) into a sum of cosines, s(t)=s e j  t Then, for each cosine, compute Then, for each cosine, compute x(t) = H(  ) s(t) = H(  ) s e j  t n=0 ∞ ∞


Download ppt "ECE 598: The Speech Chain Lecture 5: Room Acoustics; Filters."

Similar presentations


Ads by Google