MATLAB - Speech Recognition
ELEC-COMP 404/504: Digital Speech and Audio Processing
Project #1: Speech Coding
Phase 1 due by March 29, Tuesday Phase 2 due by April 8, Friday
You will develop a parametric speech coder in this project. It will include two phases: LPC analysis and synthesis phase and coding phase. Please refer to the speech files from MTR, which are sampled at 8 kHz and available under resources section of the course web site.
Phase 1: LPC Analysis and Synthesis
(a) LPC Inverse Filter (b) LPC Synthesis
Figure 1: LPC Analysis and Synthesis
In Phase 1 you will construct encoder and decoder parts of your speech codec without quan- tization.
Your Encoder shall perform,
• Take speech signal recording from any wav file with sampling frequency 8 KHz as input, • Perform frame processing with a frame duration of 20 msec and frame shift of 10 msec, • Compute 10th order PARCOR representation of the LP filter using the autocorrelation
method (this should be your implementation, do not use any MATLAB function) for each frame,
• Inverse filter speech frame to get the excitation signal e[n] as in Fig. 1(a), • Find the LPC gain G for the frame, • Output a stream of LPC parameters, namely PARCOR parameters, LPC gain G and
excitation signal e[n].
Your Decoder shall perform,
• Take the output parameter stream of the Encoder as input, • Synthesize speech signal for each frame as in Fig. 1(b) to construct the original speech
signal, which is the input of the Encoder,
• Plot the original and synthesized speech signals together with the excitation signal. Listen the synthesized speech signal and ensure that there is no processing degrada- tion. Compute and report segmental SNR for one selected speech recording using the segmental SNR metric as defined below in (1).
Phase 2: Speech Coding
You can pick one of the LPC Vocoder or Parametric Coder structures and design quantizers to quantize the output stream of your Encoder.
LPC Vocoder: LPC Vocoder represents the excitation signal as an impulse train for voiced speech and as white noise for unvoiced speech. Note that the impulse train excitation has to be periodic with the pitch period, hence pitch estimation should be performed for the LPC Vocoder.
You should be designing quantizers for the following sets of parameters to translate output of your Encoder into a binary stream. You can use the speech files from the MTR to design related quantizers. You may use the kmeans() MATLAB function for quantization design.
Update your Encoder and Decoder to support the following set of quantization bit allocations. Plot the original and synthesized speech signals together with the excitation signal. Listen the synthesized speech signal. Compute and report segmental SNR for one selected speech recording using the segmental SNR metric as defined below in (1). Discuss perceptual quality of each codec.
Bit Allocations per Frame Parameters Codec 1 Codec 2 Codec 3 Codec 4 PARCORS 40 40 20 20
Pitch and Voicing 7 4 7 4 LPC Gain (G) 6 3 6 3
Parametric Coder: You should be designing quantizers for the following sets of parameters to translate output of your Encoder into a binary stream. You can use the speech files from the MTR to design related quantizers. You may use the kmeans() MATLAB function for quantization design.
Update your Encoder and Decoder to support the following set of quantization bit allocations. Plot the original and synthesized speech signals together with the excitation signal. Listen the synthesized speech signal. Compute and report segmental SNR for one selected speech recording using the segmental SNR metric as defined below in (1). Discuss perceptual quality of each codec.
Bit Allocations per Frame Parameters Codec 1 Codec 2 Codec 3 Codec 4 PARCORS 40 40 20 20
Excitation signal e[n] 480 240 480 240
The segmental SNR metric can be defined as,
SegSNR = 1
N
N∑ n=1
10 log10
( ∑L−1 k=0 (sn[k])
2∑L−1 k=0 (sn[k] − ŝn[k])2
) (1)
where sn and ŝn are the original and synthesized speech signals for frame n, L is the number of samples in a frame, and N is the number of frames in the speech recording.