Presentation is loading. Please wait.

Presentation is loading. Please wait.

Speech Signal Processing

Similar presentations


Presentation on theme: "Speech Signal Processing"β€” Presentation transcript:

1 Speech Signal Processing
Problem 1 Speech Signal Processing

2 Solution Filter length estimation: from transition band width
βˆ† 𝑓 1 = 𝑓 π‘ π‘‘π‘œπ‘ βˆ’ 𝑓 π‘π‘Žπ‘ π‘  𝑓 𝑠 π‘Žπ‘›π‘‘ 𝑁= 3.3 βˆ†π‘“ We select N = 25 for the number of filter coefficients and using the Hamming window method. we next obtain from the transition band central frequency 𝑓 𝑐 = 𝑓 π‘π‘Žπ‘ π‘  +π‘ π‘‘π‘œπ‘ 2 The normalized lower and upper cutoff frequencies are calculated as: and 𝑁=2 𝑀+1=25 𝑀=12

3 Design using MATLAB

4

5 w : Window coefficients
h: filter transfer function coefficients b: filter coefficients

6

7 Filter Coefficients

8

9 Original speech and processed speech using the band-pass filter.
The band-pass frequency components contain a small portion of speech energy

10 Spectral comparison of the original speech and processed speech using the ban-dpass filter.
low and high frequencies are removed by the band-pass filter. Low scale amplitude

11 Problem 2 1. Calculate the filter coefficients for a 5-tap FIR band-pass filter with a lower cutoff frequency of 1,000 Hz and an upper cutoff frequency of 1,500 Hz and a sampling rate of 5,000 Hz. 2. Determine the transfer function and plot the frequency responses with MATLAB. 3. apply the hamming window function to obtain windowed coefficients; 4. plot the impulse response β„Ž(𝑛).and windowed impulse response β„Ž 𝑀 (𝑛). Hamming window

12 Solution Calculating the normalized cutoff frequencies leads to
Ξ© 𝐿 = 2πœ‹ 𝑓 𝐿 𝑓 𝑠 = 2πœ‹ =0.4 πœ‹ π‘Ÿπ‘Žπ‘‘π‘–π‘Žπ‘›π‘  Ξ© 𝐻 = 2πœ‹ 𝑓 𝐻 𝑓 𝑠 = 2πœ‹ =0.6 πœ‹ π‘Ÿπ‘Žπ‘‘π‘–π‘Žπ‘›π‘  Since 2M +1= 5 in this case, using the equation in Table β„Ž 𝑛 = Ξ© 𝐻 βˆ’ Ξ© 𝐿 πœ‹ 𝑛=0 sin⁑(Ξ© 𝐻 𝑛) π‘›πœ‹ βˆ’ sin⁑(Ξ© 𝐿 𝑛) π‘›πœ‹ 𝑛≠0 π‘Žπ‘›π‘‘βˆ’2≀𝑛≀2 Calculations for non-causal FIR coefficients are listed as β„Ž 0 = Ξ© 𝐻 βˆ’ Ξ© 𝐿 πœ‹ = 0.6πœ‹βˆ’0.4πœ‹ πœ‹ =0.2 β„Ž 1 = sin⁑(Ξ© 𝐻 𝑛) π‘›πœ‹ βˆ’ sin⁑(Ξ© 𝐿 𝑛) π‘›πœ‹ = sin 0.6πœ‹ Γ—1 1Γ—πœ‹ βˆ’ sin 0.4πœ‹ Γ—1 1Γ—πœ‹ =0.0035 β„Ž 2 = sin⁑(Ξ© 𝐻 𝑛) π‘›πœ‹ βˆ’ sin⁑(Ξ© 𝐿 𝑛) π‘›πœ‹ = sin 0.6πœ‹ Γ—2 2Γ—πœ‹ βˆ’ sin 0.4πœ‹ Γ—2 2Γ—πœ‹ =0.0035

13

14

15 Problem 3 Let us design a first-order digital low-pass filter with a 3-dB cutoff frequency of πœ” 𝑐 =0.25 πœ‹ by applying the bilinear transformation to the analog Butterworth filter: 𝐻 π‘Žπ‘ (𝑠)= 1 1+ 𝑠 Ξ© 𝑐

16 1. Frequency Warping (mapping digital frequency to analog frequency)
Solution 1. Frequency Warping (mapping digital frequency to analog frequency) Because the 3-dB cutoff frequency of the Butterworth filter is Ξ© 𝑐 for a cutoff frequency πœ” 𝑐 =0.25 πœ‹ in the digital filter, we must have: Ξ© 𝑐 = 2 𝑇 𝑠 π‘‘π‘Žπ‘› 0.25πœ‹ 2 = 𝑇 𝑠 2. Prototype Transformation (From Prototype analog LPF to desired analog filter) Therefore, the system function of the analog filter is (we use directly the given analog Butterworth filter ): 𝐻 π‘Ž 𝑠 = 1 1+ 𝑠 Ξ© 𝑐 = 𝑠𝑇 𝑠 3. Bilinear Transformation (From analog filter transfer function to digital filter Transfer Function) Applying the bilinear transformation to the analog filter gives 𝐻 π‘Ž 𝑧 = 𝐻 π‘Ž 𝑠 𝑠= 2 𝑇 𝑠 1βˆ’ 𝑧 βˆ’1 1+ 𝑧 βˆ’1 = βˆ’ 𝑧 βˆ’1 1+ 𝑧 βˆ’1 = 𝑧 βˆ’1 1βˆ’ 𝑧 βˆ’1 Note that the parameter 𝑇 𝑠 , does not enter into the design.

17 Matlab %- freqz returns the frequency response based on the current filter coefficients b=[ ]; a=[ ]; [hz,f]=freqz(b,a); % 512 nb of data plot %- angle(hz)returns the phase angles in radians, phi = 180*unwrap(angle(hz))/pi; %- unwrap Correct phase angles to produce smoother phase plots subplot(2,1,1), plot(f, abs(hz)),grid; %axis([0 fs/2 0 1]); %xlabel('Frequency (Hz)'); ylabel('Magnitude Response') subplot(2,1,2), plot(f, phi); grid; %axis([0 fs/ ]); %xlabel('Frequency (Hz)'); ylabel('Phase (degrees)')

18 Problem 4 Illustrating the simple pole-zero method of calculating filter coefficients a band-pass digital filter is required to meet the following specifications: Assuming a sampling frequency of 500 Hz, obtain 1. The transfer function of the filter by suitably placing z-plane poles and zeros. 2. its difference equations. 3. Block diagram representation of filter.

19 Solution Since a complete rejection is required at zero and 250Hz we need to: place zeros at the corresponding points on the z-plane. These are at angles of 0Β° and 360Γ—250/500=180Β° on the unit circle. place zeros at : πœƒ= 𝑓 𝑓 𝑠 Β° = Β° = 0 Β° and πœƒ= Β° = 18 0 Β° 𝑧 1 =1 π‘Žπ‘›π‘‘ 𝑧 2 =βˆ’1 To have the pass-band centered at 125Hz requires us to place poles at Β±360Γ—125/500=Β±90Β°. place poles at : 𝑝 1 =π‘Ÿ 𝑒 𝑗 πœ‹ 2 π‘Žπ‘›π‘‘ 𝑝 2 =π‘Ÿ 𝑒 βˆ’π‘— πœ‹ 2 To ensure that the coefficients are real , it is necessary to have complex conjugate pole pair. The radius of the poles is determined by the desired bandwidth. An approximate relationship between r, for r > 0.9 , and bandwidth bw is: π‘Ÿ~1βˆ’ =0.937 for our specifications bw =10Hz and Fs = 500Hz . This leads to an r value of r = 0.937 The difference equation is

20 𝑓 𝑠 /2 Pole-zero dΔ±agram Block diagram representation of filter

21 Matlab f0 = 125 ; bw = 10; fs= 500; r=1-(bw/fs)*pi; % magnitude of the pole theta=(f0/fs)*360; % angle of the pole k=((1-r)*sqrt(1-2*r*cos(2*theta*(pi/180))+r^2))/(2*abs(sin(theta*(pi/180)))); % the filter transfer function b=[k 0 -k];a=[1 -2*r*cos(theta*(pi/180)) r^2]; %- freqz returns the frequency response based on the current filter coefficients [hz,f]=freqz(b,a,512,fs); % 512 nb of data plot %- angle(hz)returns the phase angles in radians, phi = 180*unwrap(angle(hz))/pi; %- unwrap Correct phase angles to produce smoother phase plots subplot(2,1,1), plot(f, abs(hz)),grid; axis([0 fs/ ]); xlabel('Frequency (Hz)'); ylabel('Magnitude Response') subplot(2,1,2), plot(f, phi); grid; axis([0 fs/ ]); xlabel('Frequency (Hz)'); ylabel('Phase (degrees)')

22


Download ppt "Speech Signal Processing"

Similar presentations


Ads by Google