Presentation is loading. Please wait.

Presentation is loading. Please wait.

Research Methods in Acoustics Lecture 7: Convolution and Fourier Transform Jonas Braasch Partly based on Jens Blauert’s Communication Acoustics script.

Similar presentations


Presentation on theme: "Research Methods in Acoustics Lecture 7: Convolution and Fourier Transform Jonas Braasch Partly based on Jens Blauert’s Communication Acoustics script."— Presentation transcript:

1 Research Methods in Acoustics Lecture 7: Convolution and Fourier Transform
Jonas Braasch Partly based on Jens Blauert’s Communication Acoustics script.

2 Definition of a System system
A mathematical model of a physical process that relates the input signal to the output signal (excitation and response) is a system. The unequivocal relationship of two mathematical functions, here s(t) and g(t), is typically referred to as a transformation or system: system e.g., loudspeaker e.g., microphone

3 System If we know how the system transforms the input signal, we can determine the output signal for a given input signal. The system that we are most interested in this class is the acoustics of a room Today we will learn to determine how a given input signal is transformed through a room. The underlying process is called convolution. For a room, the system is described by the so-called room impulse response for a given source/receiver position configuration.

4 LTI systems As we will see later, the convolution only works with Linear Time Invariant systems, so-called LTI systems. Two requirements have to be met for an LTI system: 1.) Superpositon (to meet the requirement of linearity) 2.) Displacement Law (to meet the requirement of time invariance)

5 Superposition Each linear combination of input signals leads to a linear combination of the output signals that are derived from the individual input signals:

6 Superposition Linear Example

7 Superposition Non-Linear Example

8 Displacement Law For any (real) time shift T we find that the shape of the output signal g(t) is independent of the reference point in time of the input signal s(t). Example for time-variant system:

9 The impulse response of a system
As the word impulse response suggests, it is the response of a system to an impulse as input signal. We will now need to define an impulse mathematically to define convolution system (room)

10 The Kronecker delta function
A delta function is a function that is zero for any other values than zero. Two different delta functions with different amplitudes are common. The Kronecker delta is defined as: 1 t0=0 t Kronecker delta

11 The Dirac delta function
The Dirac delta is an impulse of infinite amplitude: Dirac delta Nevertheless, its area is well defined over its distribution: Area of the Dirac delta

12 The Dirac delta function
Using this area definition, we can use the Dirac delta to blend out the value of a signal s(t) at any time instance t we want:

13 The Dirac delta function
Visually speaking, we cut out a very thin piece of our integral using the delta function. f(t) A=1 s(t) d(t-t) t t

14 Resynthesizing the function s(t)
Since the delta function is symmetrical, we can write: Basically, we synthesize the signal s(t) from many delta impulses d(t) that are weighted with s(t). (It is like a cake that while having many cuts, is still a complete cake).

15 Impulse Response system
We can also use the delta function to determine the impulse response h(t) of our system (This is very similar to our approach to hear the impulse response of a room using a hand-clap).

16 Example for an impulse response
Let us start with a good example of an impulse response. There is one type of impulse response we all know by now: The room impulse response. The room impulse response can be measured or heard after performing a hand clap. We measure the response of the room by ear or microphone: room (system)

17 Example for an impulse response
h(t) direct sound early reflections late reflections t Even though we excite the room only at one point in time t with d(t−t), we receive a response that is spread over time. Since the room responds to events that happened in the past, it has some type of memory. Memory of d(t−t) after T seconds h(t) t t t+T

18 Room Impulse response The memory effect is induced due to the circumstance that the sound needs time to travel through the room (with the speed of sound). The sound is typically reflected one or more times before it reaches the listener’s position. For most purposes, it is valid to assume that the room is an LTI system. In reality, the room impulse response changes constantly, because of temperature fluctuations in the room and the fact that the speed of sounds is dependant on T. Since the room is an LTI system, the overall amplitude of the room response is in linear relation to the amplitude of the hand clap. Furthermore, we receive the same room response for a hand clap of the same amplitude at any point in time.

19 Linearity Example for an impulse response
s(t) g(t) ad(t−t) ah(t−t) t t 0.5ad(t−t) 0.5ah(t−t) t t a is a constant

20 Double Handclap (double excitation)
+ hand clap 1.+2.

21 Two hand claps (previous slide)
Now, let us consider what will happen, if we carry out a second hand clap before the room response to the first hand clap fully decayed. Naturally, the room would respond to the second hand clap, but still would finish its response to the first hand clap. Both impulse responses will add up – delayed in time according to the superposition equation:

22 Simple impulse response
Consisting of only the direct sound a1 at t1 and one reflection a2 at t2. a1 a2 t1 t2 t The transformation of a signal x(t) will be similar to our organ pipe Simulation from last week:

23 Simple impulse response
x (t) t t rd(t − T) rx (t−T) t t

24 Convolution We can now generalize the equation above to any impulse response with N reflections: With the impulse response h:

25 General Convolution Since we can synthesize any signal in time using weighted impulse responses, we can generalize our finding about the response of the room to two hand claps. We just have to replace the delta function with the impulse of our room:

26 Convolution f(t) s(t) h(t-t) t t Convolution

27 Convolution f(t) s(t) h(t-t) t t current point in time
Point in past time. The value of the impulse response at this point is weighted with the corresponding signal. This memorized part of the impulse response is audible at t.

28 Convolution t t + t t d(t=0) d(t)=1 for t=0 =0 elsewhere rd(t − T)
Impulse response of a cylindrical resonator

29 Convolution t t t t + t t t t x (t) d(t=0) rd(t − T) rx (t−T)

30 Convolution Now let us go into the digital domain with the time indices n and k. We can now generalize the last equation: Impulse Response Convolution impulse response 2. time signal With the help of the convolution, we can calculate the output y(k) for an input signal x(k) and the impulse response h(k).

31 Definition of Convolution
A convolution is an integral that expresses the amount of overlap of one function as it is shifted over another function . It therefore "blends" one function with another. In mathematics and, in particular, functional analysis, convolution is a mathematical operator which takes two functions f and g and produces a third function that in a sense represents the amount of overlap between f and a reversed and translated version of g. A convolution is a kind of very general moving average, as one can see by taking one of the functions to be an indicator function of an interval.

32 Convolution z(k)= x(k)*y(k)= S x(m) y(k-m) + k,m: samples in time
inf z(k)= x(k)*y(k)= S x(m) y(k-m) m=-inf + k,m: samples in time x: signal y: impulse response z: convolved signal

33 Convolution [signal,Fs]=wavread('MarlabSoloMono2');
[ir,Fs]=wavread('gs201m.wav'); tic y=conv(signal,ir); toc y=0.8.*y./max(abs(y)); wavwrite(y,Fs,'ConvSignal.wav'); Elapsed time is seconds. Name Size Bytes Class Fs x double array ir x double array signal x double array y x double array

34 Fourier Transformation
We would now like to develop a technique to analyze the frequency content of a signal s(t). The most common technique is the so-called Fourier Transformation. A period function is defined as: with T the period. A periodic function will repeat itself every interval of T. s = for all t that are element of R

35 Fourier Transformation
According to Fourier, we can write every period function as a series of cosine and sine functions with multiple frequencies (the so-called Fourier Series): with

36 Rectangular wave function
Other signals that are often used in electronics are the square wave the sawtooth and the triangular function. Each of the signals is synthesized by adding several sinusoids with its frequencies n being multiples of the fundamental frequency f to create a harmonic frequency spectrum. The square-wave function is defined as:

37 Sawtooth Function

38 Triangular wave function

39 Orthogonal relationships
The sine and cosine functions follow the following orthogonal relationships: k, l=harmonic indices Kronecker delta:

40 Fourier coefficients to insert into:
The orthogonal relationships between the sine and cosine functions are helpful to determine the Fourier coefficients: to insert into:

41 Inverse Fourier Transformation
We can group each pair: to one frequency. Using ak and bk we can set the phase: and amplitude:

42 Fourier Transformation with e-function
Basically, we can also treat non-harmonic functions by setting T to ∞. We can also use the complex e-function instead of sine and cosine: x=2pt, T→∞

43 Relationship between exp and sine
Proof:

44 Fourier Transformation for NON-harmonic signals (T→∞)
S(f) is complex! Inverse Fourier transformation

45 Now let us apply the Fourier transform to convolution
Now we easily separated s and h Because of the orthogonal relationships and the superposition principle, we can generalize our finding to any s(t) [no proof].

46 FFT and convolution in Matlab
function [y_fft,y_trad]=fftconv(x,h); % traditional convolution tic y_trad=conv(x,h); toc % fft convolution Y=fft(x,(length(x)+length(h)-1)); H=fft(h,(length(x)+length(h)-1)); G=Y.*H; y_fft=real(ifft(G));


Download ppt "Research Methods in Acoustics Lecture 7: Convolution and Fourier Transform Jonas Braasch Partly based on Jens Blauert’s Communication Acoustics script."

Similar presentations


Ads by Google