Department of Electrical and Computer Engineering Digital Speech Processing Homework No. 6 Solutions

Similar documents
Review of Fundamentals of Digital Signal Processing

Voiced Speech. Unvoiced Speech

Review of Fundamentals of Digital Signal Processing

SIGNALS AND SYSTEMS. Unit IV. Analysis of DT signals

Digital Signal Processing Lecture 10 - Discrete Fourier Transform

Digital Signal Processing. Midterm 1 Solution

Digital Signal Processing Lecture 9 - Design of Digital Filters - FIR

Very useful for designing and analyzing signal processing systems

ECSE 512 Digital Signal Processing I Fall 2010 FINAL EXAMINATION

Final Exam of ECE301, Prof. Wang s section 1 3pm Tuesday, December 11, 2012, Lily 1105.

Discrete-Time Fourier Transform (DTFT)

Signal representations: Cepstrum

Transform Analysis of Linear Time-Invariant Systems

Signals & Systems Handout #4

Multimedia Signals and Systems - Audio and Video. Signal, Image, Video Processing Review-Introduction, MP3 and MPEG2

Review of Discrete-Time System

UNIVERSITY OF OSLO. Please make sure that your copy of the problem set is complete before you attempt to answer anything.

The Z transform (2) 1

Final Exam of ECE301, Section 1 (Prof. Chih-Chun Wang) 1 3pm, Friday, December 13, 2016, EE 129.

Discrete Time Fourier Transform (DTFT)

Digital Signal Processing

Feature extraction 2

6.003 (Fall 2011) Quiz #3 November 16, 2011

LAB 6: FIR Filter Design Summer 2011

EE 225D LECTURE ON DIGITAL FILTERS. University of California Berkeley

EE 521: Instrumentation and Measurements

Department of Electrical and Computer Engineering Digital Speech Processing Homework No. 7 Solutions

Discrete-time signals and systems

6.003: Signals and Systems

Digital Filters Ying Sun

Grades will be determined by the correctness of your answers (explanations are not required).

Digital Signal Processing Lecture 3 - Discrete-Time Systems

Chap 2. Discrete-Time Signals and Systems

/ (2π) X(e jω ) dω. 4. An 8 point sequence is given by x(n) = {2,2,2,2,1,1,1,1}. Compute 8 point DFT of x(n) by

EE482: Digital Signal Processing Applications

GATE EE Topic wise Questions SIGNALS & SYSTEMS

Optimal Design of Real and Complex Minimum Phase Digital FIR Filters

Lab 3 & 4. LTI Systems, the Z-Transform, and an Introduction

Overview of Discrete-Time Fourier Transform Topics Handy Equations Handy Limits Orthogonality Defined orthogonal

The Discrete-Time Fourier

Your solutions for time-domain waveforms should all be expressed as real-valued functions.

VI. Z Transform and DT System Analysis

Final Exam of ECE301, Section 3 (CRN ) 8 10am, Wednesday, December 13, 2017, Hiler Thtr.

EEL3135: Homework #4

Lecture 7 Discrete Systems


University of Illinois at Urbana-Champaign ECE 310: Digital Signal Processing

Topic 4: The Z Transform

Introduction to DSP Time Domain Representation of Signals and Systems

Signals and Systems. Problem Set: The z-transform and DT Fourier Transform

Mel-Generalized Cepstral Representation of Speech A Unified Approach to Speech Spectral Estimation. Keiichi Tokuda

Lecture 2 OKAN UNIVERSITY FACULTY OF ENGINEERING AND ARCHITECTURE

8. z-domain Analysis of Discrete-Time Signals and Systems

Discrete-Time Signals and Systems. Frequency Domain Analysis of LTI Systems. The Frequency Response Function. The Frequency Response Function

Digital Signal Processing. Lecture Notes and Exam Questions DRAFT

Stability Condition in Terms of the Pole Locations

Sec$on The Use of Exponen$al Weigh$ng Exponen$al weigh$ng of a sequence x(n) is defined by. (equa$on 13.70)

Multidimensional digital signal processing

EC Signals and Systems

Frequency-Domain C/S of LTI Systems

Discrete Time Systems

ECE 413 Digital Signal Processing Midterm Exam, Spring Instructions:

Grades will be determined by the correctness of your answers (explanations are not required).

Z-TRANSFORMS. Solution: Using the definition (5.1.2), we find: for case (b). y(n)= h(n) x(n) Y(z)= H(z)X(z) (convolution) (5.1.

Definition of Discrete-Time Fourier Transform (DTFT)

Let H(z) = P(z)/Q(z) be the system function of a rational form. Let us represent both P(z) and Q(z) as polynomials of z (not z -1 )

Final Exam of ECE301, Prof. Wang s section 8 10am Tuesday, May 6, 2014, EE 129.

LAB 2: DTFT, DFT, and DFT Spectral Analysis Summer 2011

Frequency Domain Speech Analysis

HW13 Solutions. Pr (a) The DTFT of c[n] is. C(e jω ) = 0.5 m e jωm e jω + 1

Each problem is worth 25 points, and you may solve the problems in any order.

y[n] = = h[k]x[n k] h[k]z n k k= 0 h[k]z k ) = H(z)z n h[k]z h (7.1)

Discrete-Time Signals and Systems. The z-transform and Its Application. The Direct z-transform. Region of Convergence. Reference: Sections

UNIVERSITY OF OSLO. Faculty of mathematics and natural sciences. Forslag til fasit, versjon-01: Problem 1 Signals and systems.

CMPT 889: Lecture 5 Filters

Digital Signal Processing:

Digital Filters. Linearity and Time Invariance. Linear Time-Invariant (LTI) Filters: CMPT 889: Lecture 5 Filters

ESE 531: Digital Signal Processing

DHANALAKSHMI COLLEGE OF ENGINEERING DEPARTMENT OF ELECTRICAL AND ELECTRONICS ENGINEERING EC2314- DIGITAL SIGNAL PROCESSING UNIT I INTRODUCTION PART A

ECE-314 Fall 2012 Review Questions for Midterm Examination II

Digital Control & Digital Filters. Lectures 1 & 2

APPLIED SIGNAL PROCESSING

x[n] = x a (nt ) x a (t)e jωt dt while the discrete time signal x[n] has the discrete-time Fourier transform x[n]e jωn

Digital Signal Processing: Signal Transforms

ECE-700 Review. Phil Schniter. January 5, x c (t)e jωt dt, x[n]z n, Denoting a transform pair by x[n] X(z), some useful properties are

QUESTION BANK SIGNALS AND SYSTEMS (4 th SEM ECE)

Discrete Fourier Transform

PROBLEM SET 3. Note: This problem set is a little shorter than usual because we have not covered inverse z-transforms yet.

Question Paper Code : AEC11T02

EE 3054: Signals, Systems, and Transforms Spring A causal discrete-time LTI system is described by the equation. y(n) = 1 4.

Discrete Time Systems

ECE 8440 Unit Applica,ons (of Homomorphic Deconvolu,on) to Speech Processing

Chapter 9. Linear Predictive Analysis of Speech Signals 语音信号的线性预测分析

Filter Analysis and Design

Lecture 04: Discrete Frequency Domain Analysis (z-transform)

-Digital Signal Processing- FIR Filter Design. Lecture May-16

Signals and Systems Lecture 8: Z Transform

ELEG 305: Digital Signal Processing

ELEG 305: Digital Signal Processing

Problem Value

Transcription:

Problem 1 Department of Electrical and Computer Engineering Digital Speech Processing Homework No. 6 Solutions The complex cepstrum, ˆx[n], of a sequence x[n] is the inverse Fourier transform of the complex log spectrum ˆX(e jω ) = log X(e jω ) + j arg[x(e jω )] Show that the cepstrum c[n], defined as the inverse Fourier transform of the log magnitude, is the even part of ˆx[n]; i.e., show that c[n] = ˆx[n] + ˆx[ n] 2 Solution We begin with the basic definitions: and show that: ˆx[n] ˆX(e jω ) = log X(e jω ) + j arg[x(e jω )] c[n] log X(e jω ) By definition we have c[n] = ˆx[n] + ˆx[ n] 2 c[n] = 1 = 1 log X(e jω ) e jωn dω log X(e jω ) [cos(ωn) + j sin(ωn)]dω Recall that for x[n] real, X(e jω ) is an even function; therefore Leading to the result log X(e jω ) [j sin(ωn)]dω = 0 c[n] = 1 log X(e jω ) cos(ωn)dω By inverse transforming ˆX(e jω ) we obtain 1

ˆx[n] = 1 [log X(e jω ) + j arg{x(e jω )}] [cos(ωn) + j sin(ωn)]dω For x[n] real, arg{x(e jω )} is an odd function, therefore j arg{x(e jω )} cos(ωn)dω = 0 Similarly, since log X(e jω ) is an even function of ω and sin(ωn) is an odd function of ω, therefore we have Thus we get: log X(e jω ) (j sin(ωn))dω = 0 ˆx[n] + ˆx[ n] 2 ˆx[n] = 1 ˆx[ n] = 1 = 1 [log X(e jω ) ][cos(ωn)]dω 1 [log X(e jω ) ][cos(ωn)]dω + 1 [log X(e jω ) ][cos(ωn)]dω = c[n] arg[x(e jω )][sin(ωn)]dω arg[x(e jω )][sin(ωn)]dω Problem 2 A linear time-invariant system has the transfer function: H(z) = 8 1 4z 1 1 1 6 z 1 (a) Find the complex cepstral coefficients, ĥ[n], for all n. (b) Sketch ĥ[n] versus n for the range 10 n 10. (c) Solve for the (real) cepstrum coefficients, c[n], for all n. Solution (a) We can write H(z) in the normalized format: H(z) = 8 1 [ ] 4z 1 1 z/4 1 1 = 32z 1 1 z 1 /6 6 z 1 2

We now can form the log of H(z) as: Ĥ(z) = log H(z) = log(32) + log[ z 1 ] + log(1 z/4) log(1 z 1 /6) where the log terms for the minus sign and the z 1 term have no effect and are omitted from subsequent computation. Recognizing the log series: we get: giving: log(1 x) = Ĥ(z) = log(32) + 1 n= n=1 x n n, x < 1 (1/4) n z n (1/6) n z n n n log(32) n = 0 (1/6) n ĥ[n] = n > 0 n (1/4) n n < 0 n (b) Figure 1 (at the top) shows a plot of ĥ[n]. By setting ĥ[n] to a value of zero, we can better see the behavior of ĥ[n] for the range 10 n n as shown in Figure 1 at the bottom. n=1 Figure 1: Plot of complex cepstral sequence; top panel with all cepstral values, bottom panel without cepstral value at n=0. 3

(c) We can solve for c[n] as: c[n] = = ĥ[n] + ĥ[ n] 2 log(32) n = 0 (1/6) n (1/4)n n > 0 2n 2n (1/6) n + (1/4) n n < 0 2n 2n Problem 3 Consider a finite length minimum phase sequence x[n] with complex cepstrum ˆx[n], and a sequence with complex cepstrum ŷ[n]. y[n] = α n x[n] (a) If 0 < α < 1, how will ŷ[n] be related to ˆx[n]? (b) How should α be chosen so that y[n] would no longer be minimum phase? (c) How should α be chosen so that y[n] is maximum phase? Solution (a) 0 < α < 1; assume length N for x[n], then we get Y (z) = N 1 N 1 α n x[n]z n = x[n](αz 1 ) n n=0 = X(z/α) If the zeros of X(z) occur at z 0, z 1,..., z N 1, then the zeros of Y (z) occur at αz 0, αz 1,..., αz N 1 ; therefore ŷ[n] = α nˆx[n]. (b) Let max i z i denote the magnitude of the maximum magnitude zero of X(z). y[n] is not minimum phase if any zero of Y (z) lies on or outside the unit circle. Therefore choose α so that α max z i 1 α i n=0 max i 1 z i (c) Let min i z i denote the magnitude of the minimum magnitude zero of X(z). y[n] is maximum phase if all the zeros of Y (z) lie outside the unit circle. Therefore choose α so that 1 α min z i > 1 α > i min z i i 4

Problem 4 Given the signal, x[n], with complex cepstrum, ˆx[n], it was shown in class that their z-transforms are related by the relation: ˆX(z) = log X(z) The complex cepstrum of a causal, minimum phase signal can be generated with the use of DFTs. However, there also exists a recursive relationship for determining ˆx[n] directly from x[n]. The purpose of this problem is to derive this recursive relationship between ˆx[n] and x[n]. We do this as follows: (a) by differentialing ˆX(z) and X(z), show that x[n] and ˆx[n] are related by: nˆx[n] x[n] = nx[n] (b) assuming that x[n] is minimum phase, use this expression to derive the following recursive formula for generating ˆx[n] 0 n < 0 log x[0] n = 0 ˆx[n] = x[n] x[0] 1 n 1 kˆx[k]x[n k] n > 0 nx[0] k=0 (Hint: use the initial value theorem for n = 0) x[0] = lim z X(z) Solution (a) X(z) = n= x[n]z n [ d dz X(z) = d ] x[n]z n dz n= = nx[n]z n 1 n= z d dz X(z) = n= nx[n]z n nx[n] ZT z d dz X(z) 5

Since ˆX(z) = log X(z) d dz ˆX(z) = d 1 d log X(z) = dz X(z) dz X(z) X(z) d dz ˆX(z) = d dz X(z) Multiplying both sides by z and inverse transforming gives: [ z d ] dz ˆX(z) X(z) = z d dz X(z) nˆx[n] x[n] = nx[n] (b) If x[n] is minimum phase, then X(z) has no poles or zeros outside the unit circle. Thus both x[n] and ˆx[n] are causal, i.e., Step 1: x[n] = 0 n < 0 Using the initial value theorem we get: Step 2: ˆx[n] = 0 n < 0 ˆx[0] = lim ˆX(z) = lim [log X(z)] z z [ = lim log(x[0] + x[1]z 1 +...) ] = log x[0] z Finally, using the expression from part (a) we get: nx[n] = nˆx[n] x[n] = x[n] = 1 n k= k= kˆx[k]x[n k] kˆx[k]x[n k] Since x[n] = 0, for n < 0, and ˆx[n] = 0, for n < 0, we can change the limits of summation, giving: Isolating the k = n term gives: x[n] = 1 n n kˆx[k]x[n k] k=0 x[n] = 1 n 1 kˆx[k]x[n k] + ˆx[n]x[0] n k=0 6

Step 3: ˆx[n] = x[n] x[0] 1 n 1 kˆx[k]x[n k] nx[0] k=0 Problem 5 Write a MATLAB program to compute the complex and real cepstrums of the following signals: 1. x 1 [n] = δ[n] 0.85δ[n 99] [ ] n 2. x 2 [n] = sin 0 n 99 100 3. x 3 [n] = 0.95 n 0 n 99 4. a section of voiced speech 5. a section of unvoiced speech For each of the first 3 signals, plot the waveform, the complex cepstrum, and the real cepstrum. For the speech signals (numbers 4 and 5) plot the signal, the log magnitude spectrum, the real cepstrum, and the lowpass liftered log magnitude spectrum. Use the file test 16k.wav to test your program. Specify the unvoiced section as starting at sample 3400 in the file, and of duration 400 samples. Specify the voiced section as starting at sample 13000 in the file, and of duration 400 samples. Use a Hamming window before computing the cepstrums of the speech files. Solution The following MATLAB code computes the complex and real cepstrums of the signals as well as the speech waveforms. % test_cepstrum_3.m % cepstrum.m NFFT=input( FFT size for cepstral calculations: ); % % generate impulse plus delayed impulse n=0:nfft-1; x1=zeros(1,nfft); x1(1)=1; x1(100)=-.85; % generate sine wave pulse with period 100 Hz 7

n1=0:99; x2=sin(2*pi*n1/10); x2=[x2 zeros(1,nfft-100)]; % generate exponential x3=.95.^n1; x3=[x3 zeros(1,nfft-100)]; % compute complex and real cepstrum for all three signals % xhat1=cceps(x1,nfft); rhat1=rceps(x1); xhat2=cceps(x2,nfft); rhat2=rceps(x2); xhat3=cceps(x3,nfft); rhat3=rceps(x3); % read in speech file % [xin,fs,mode,format]=loadwav( ah_truncated.wav );xin) filename=input( enter speech filename:, s ); [xin,fs,mode,format]=loadwav(filename); % choose section to plot m1=input( starting speech sample in file for unvoiced section: ); m2=input( starting speech sample in file for voiced section: ); stitle=sprintf( file: %s, unvoiced/voiced starting sample: %d %d,filename,m1,m2); % choose analysis parameters nwin=400; x4=(xin(m1:m1+nwin-1).*hamming(nwin)) ; x4=[x4 zeros(1,nfft-nwin)]; X4m=log(abs(fft(x4,NFFT))); xh4=fft(x4m,nfft)/nfft; lifter=zeros(1,nfft); lifter(1:50)=1; lifter(nfft-48:nfft)=1; xh4p=xh4.*lifter; X4mm=ifft(xh4p,NFFT)*NFFT; x5=(xin(m2:m2+nwin-1).*hamming(nwin)) ; x5=[x5 zeros(1,nfft-nwin)]; X5m=log(abs(fft(x5,NFFT))); xh5=fft(x5m,nfft)/nfft; lifter=zeros(1,nfft); lifter(1:50)=1; lifter(nfft-48:nfft)=1; xh5p=xh5.*lifter; 8

X5mm=ifft(xh5p,NFFT)*NFFT; % plot results for speech section--zero out first real cepstrum coefficient for plotting % colordef white; ptitle1=sprintf( cepstra for delayed impulse, NFFT: %d,nfft); ptitle2=sprintf( cepstra for sine wave, NFFT: %d,nfft); ptitle3=sprintf( cepstra for exponential, NFFT: %d,nfft); % plot signal and cepstra for 3 basic signals and for speech section figure; subplot(3,1,1),plot(n,x1),title(ptitle1),legend( delayed and scaled impulse,0),ylabel( subplot(3,1,2),plot(n,xhat1),legend( complex cepstrum,0),ylabel( amplitude ); subplot(3,1,3),plot(n,rhat1),legend( real cepstrum,0),ylabel( amplitude ); figure; subplot(3,1,1),plot(n,x2),title(ptitle2),legend( sinewave,0),ylabel( amplitude ); subplot(3,1,2),plot(n,xhat2),legend( complex cepstrum,0),ylabel( amplitude ); subplot(3,1,3),plot(n,rhat2),legend( real cepstrum,0),xlabel( sample ),ylabel( amplitud figure; subplot(3,1,1),plot(n,x3),title(ptitle3),legend( exponential,0),ylabel( amplitude ); subplot(3,1,2),plot(n,xhat3),legend( complex cepstrum,0),ylabel( amplitude ); subplot(3,1,3),plot(n,rhat3),legend( real cepstrum,0),xlabel( sample ),ylabel( amplitud % plot cepstra for voiced and unvoiced speech figure; xfreq=(0:nfft/2)*(fs/nfft); subplot(4,1,1),plot(x4(1:nwin)),title(stitle),ylabel( amplitude ); subplot(4,1,2),plot(xfreq,x4m(1:nfft/2+1)),ylabel( db ),legend( log magnitude spectrum, subplot(4,1,3),plot(1:nfft/2,xh4(2:nfft/2+1)),ylabel( value ),legend( real cepstrum,4); subplot(4,1,4),plot(xfreq,x4mm(1:nfft/2+1), r,xfreq,x4m(1:nfft/2+1), b ); xlabel( frequency ),ylabel( db ),legend( lowpass liftered log magnitude spectrum,4); % plot cepstra for voiced and unvoiced speech figure; subplot(4,1,1),plot(x5(1:nwin)),title(stitle),ylabel( amplitude ); subplot(4,1,2),plot(xfreq,x5m(1:nfft/2+1)),ylabel( db ),legend( log magnitude spectrum, subplot(4,1,3),plot(1:nfft/2,xh5(2:nfft/2+1)),ylabel( value ),legend( real cepstrum,1); subplot(4,1,4),plot(xfreq,x5mm(1:nfft/2+1), r,xfreq,x5m(1:nfft/2+1), b ), xlabel( frequency ),ylabel( db ),legend( lowpass liftered log magnitude spectrum,1); The following plots result (for the speech cepstra, the zeroth value was set to zero for plotting so as not to distort the scale): 9

10

11

12