DCSP-16 Jianfeng Feng Department of Computer Science Warwick Univ., UK [email protected]...

19
DCSP-16 Jianfeng Feng Department of Computer Science Warwick Univ., UK [email protected] http://www.dcs.warwick.ac.uk/ ~feng/dsp.html

Transcript of DCSP-16 Jianfeng Feng Department of Computer Science Warwick Univ., UK [email protected]...

Page 1: DCSP-16 Jianfeng Feng Department of Computer Science Warwick Univ., UK Jianfeng.feng@warwick.ac.uk feng/dsp.html.

DCSP-16

Jianfeng Feng

Department of Computer Science Warwick Univ., UK

[email protected]

http://www.dcs.warwick.ac.uk/~feng/dsp.html

Page 2: DCSP-16 Jianfeng Feng Department of Computer Science Warwick Univ., UK Jianfeng.feng@warwick.ac.uk feng/dsp.html.

Applications of filter

Page 3: DCSP-16 Jianfeng Feng Department of Computer Science Warwick Univ., UK Jianfeng.feng@warwick.ac.uk feng/dsp.html.

Example

Right hemisphere Left hemisphere

Page 4: DCSP-16 Jianfeng Feng Department of Computer Science Warwick Univ., UK Jianfeng.feng@warwick.ac.uk feng/dsp.html.

HumanEar.jpg

Frequency band [f1 f2]

Frequency band [f3 f4]

Page 5: DCSP-16 Jianfeng Feng Department of Computer Science Warwick Univ., UK Jianfeng.feng@warwick.ac.uk feng/dsp.html.

simple filter designIn a number of cases, we can design a

linear filter almost by inspection, by moving poles and zeros like pieces on a chessboard.

This is not just a simple exercise designed for an introductory course, for in many cases the use of more sophisticated techniques might not yield a significant improvement in performance.

Page 6: DCSP-16 Jianfeng Feng Department of Computer Science Warwick Univ., UK Jianfeng.feng@warwick.ac.uk feng/dsp.html.

In this example consider the audio signal s(n), digitized with a sampling frequency Fs=12kHz.

The signal is affected by a narrowband (i.e., very close to sinusoidal) disturbance w(n).

Fig. show the frequency spectrum of the overall signal plus noise,

x(n)=s(n)+w(n), which can be easily determined.

Page 7: DCSP-16 Jianfeng Feng Department of Computer Science Warwick Univ., UK Jianfeng.feng@warwick.ac.uk feng/dsp.html.
Page 8: DCSP-16 Jianfeng Feng Department of Computer Science Warwick Univ., UK Jianfeng.feng@warwick.ac.uk feng/dsp.html.

Notice two facts:

• The signal has a frequency spectrum concentrated within the interval 0 to 6 kHz.

• The disturbance is at frequency F0=1.5 kHz.

Now the goal is to design and implement a simple filter that rejects the disturbance without affecting the signal excessively.

We will follow three steps:

Page 9: DCSP-16 Jianfeng Feng Department of Computer Science Warwick Univ., UK Jianfeng.feng@warwick.ac.uk feng/dsp.html.

Step 1: Frequency domain specifications

We need to reject the signal at the frequency of the disturbance.

Ideally, we would like to have the following frequency response:

where 0=2 (F0/Fs)=/4 radians, the digital frequency of the disturbance.

Page 10: DCSP-16 Jianfeng Feng Department of Computer Science Warwick Univ., UK Jianfeng.feng@warwick.ac.uk feng/dsp.html.

Step 2:

Determine poles and zeros

Page 11: DCSP-16 Jianfeng Feng Department of Computer Science Warwick Univ., UK Jianfeng.feng@warwick.ac.uk feng/dsp.html.

21 2 1 2 1 2

2

( ) ( )( ) [ ( ) ]

[ (1.414) 1]

z H z k z z z z k z z z z z z

k z z

/4

Page 12: DCSP-16 Jianfeng Feng Department of Computer Science Warwick Univ., UK Jianfeng.feng@warwick.ac.uk feng/dsp.html.
Page 13: DCSP-16 Jianfeng Feng Department of Computer Science Warwick Univ., UK Jianfeng.feng@warwick.ac.uk feng/dsp.html.
Page 14: DCSP-16 Jianfeng Feng Department of Computer Science Warwick Univ., UK Jianfeng.feng@warwick.ac.uk feng/dsp.html.
Page 15: DCSP-16 Jianfeng Feng Department of Computer Science Warwick Univ., UK Jianfeng.feng@warwick.ac.uk feng/dsp.html.
Page 16: DCSP-16 Jianfeng Feng Department of Computer Science Warwick Univ., UK Jianfeng.feng@warwick.ac.uk feng/dsp.html.

Step 3: Determine the difference

equation in the time

domain

From the transfer function, the difference equation is determined by inspection:

y(n)=1.343 y(n-1)-0.9025 y(n-2)+0.954 x(n) -1.3495x(n-1)+0.9543 x(n-2)

Page 17: DCSP-16 Jianfeng Feng Department of Computer Science Warwick Univ., UK Jianfeng.feng@warwick.ac.uk feng/dsp.html.

The difference equation can be easily implemented as a recursion in a high-level language.

The final result is the signal y(n) with the frequency spectrum shown in Fig., where we notice the absence of the disturbance.

Page 18: DCSP-16 Jianfeng Feng Department of Computer Science Warwick Univ., UK Jianfeng.feng@warwick.ac.uk feng/dsp.html.
Page 19: DCSP-16 Jianfeng Feng Department of Computer Science Warwick Univ., UK Jianfeng.feng@warwick.ac.uk feng/dsp.html.

demo

C:\Program Files\MATLAB71\work

simple_filter_design

soundsc(s,Fs)

soundsc(x,Fs)

soundsc(y,Fs)

soundsc(yrc,Fs)