Homework #5 LPC
S702 D. Kewley-Port  W. Su 02/18/02

The purpose of this lab is to learn some of the basics about linear prediction analysis (often called 'LPC' for linear prediction coding).  Two software tools, Dr. Speech and specsynt.m (from TrackDraw) offer LPC but not much flexibility.  You will do two short assignments with them, and spend more time in Matlab with the spectral tool, sptool.m.

Load all the files: from "LPC folder" under class files in on course. The file names end with 'm' (ehm, ohm) and 'tellsam' are from a male talker and the file names end with 'f' (ehf, ohf) are from a female talker.  These are the syllable /bVt/ and a sentence (listen to it).

1) LPC in Dr. Speech.  Use ohf.wav (female /bot/) that has large formant change. The analysis is done by positioning the green box on the waveform and the LPC   will be done for the first n point from the left side.  The number of points, n, is set under Options->Analysis Parameters.  Both the length of the FFT (n) and the order of the LPC (m) can be changed.  To execute the analysis, use the far right button for 'Power & LPC spectra).  Swap back and forth from waveform button to the LPC button to update display when parameters are changed.

** The assignment is to print one analysis frame of /bot/ from 'ohf. wav' and write on the print out about which part of the phoneme you position the green box on, and what your n and m parameters were set too.

2) In TrackDraw, specsynt.m and cepf0.m have been updated so that it can calculate LPC for a n=512 window.  To see how this works, bring up Matlab.

Type
> y = wavread('tellsam.wav');
> rate = 11025;  (You can input any .wav file, one at a time and use specsynt, but you much use 'clear all' inbetween each process).
> specsynt  (when the GUI window comes up, you will see the spectrogram.)

You are not going to synthesize the spectrogram this time. So, it's not neccessary to use the drawline feature to match the formant tracks. Use button 'slice'' to see a 512 point LPC section of this spectrogram.

** The assignment is to print an LPC spectrum for one of the /s/ phonemes in the sentence. You can save your specsynt workspace as 'save tell.mat'. Otherwise   always 'clear all' before going on.

3)  sptool.m in Matlab. To examine how the LPC smoothed spectra change with the m and n parameters, we will use sptool.m in Matlab.

a) Use wavread to input the four /bVt/ files.  My example is: ehm = wavread('ehm.wav');
b) The spectra in sptool calculate an LPC over a whole variable.  Therefore,  select parts of the waveforms to look just 256 points using the colon operator.  Here is my example:

plot(ehm);
e1 = ehm(400:656);
plot(e1)
e2 = ehm(1800:2056);
plot(e2);

c) Now type: sptool to launch the GUI interface.  You must 'import' each variable to get the spectrum.
    File->import e1 (highlight)>'data'.   (In the import window, make sure you set the sample rate=11025, and the Name = e1.  Import e2 too).

d) To calculate spectra, highlight e1 and select button 'create'.   In the 'Spectrum Viewer' , use 'Method' button to select 'Burg'. The order can be changed from the   default '10' (type number and return) and Nfft means nothing.  Press button 'Apply' and the LPC spectra appears. Now highlight e2, and create a spectrum for it.  Note a different color appears.  You can highlight as many spectra as you want in the SPTool window to display simultaneously.

** The LPC assignment is to change the order parameter m and (1) compare the male and female /eh/ spectra; and (2) compare the formants from the initial and    final portions of ohf.wav. You can easily read off the formant values in detail. Print out the formant values, F1, F2 and F3 from the sptool gui window.  In case you  have a hard time print out from the sptool gui window, you can print it out from Dr. Speech and note on the Dr. Speech  print out what formant values you got in the sptool  GUI window.

What to hand in? Please hand in the three print outs from each assignment (from the 3 spectra tools for the LPC) by the following Thursday.