Another Lab.  This one uses LPC (Linear Predictive Coding).

Basic LPC ! ---------------------------------

cd into the LPCFun directory in a terminal, and type

> fitlpc 20 1024 128 Spechs16.wav Spechs16.lpc Spechs16.res
> lpcresyn Spechs16.lpc Spechs16.float
> float2wv Spechs16.float Spechs16LPC.wav -s 16000  -g 0.0 
> sndplay Spechs16.wav
> sndplay Spechs16LPC.wav

you just did lpc analysis, parameterization, and resynthesis!!

> lpcresyn

this will show you the possibilities on resynthesis.

Try a time stretch of 3.0:

> lpcresyn Spechs16.lpc stretch3.float -t 3.0 
> float2wv stretch3.float stretch3.wav -s 16000 -g 0.0
> sndplay stretch3.wav

now do a pitch transformation:

> lpcresyn Spechs16.lpc pitchUp.float -p 1.7 
> float2wv pitchUp.float pitchUp.wav -g 0.0 -s 16000
> sndplay pitchUp.wav

try a pitch of 0.0 (noise-only resynthesis)
try a pitch of -1.0 (pitch-only resynthesis)

look at and listen to the residual (error file):

> float2wv Spechs16.res residual.wav -s 16000
> snd residual.wav &

you can resynthesize using the residual and get
back darn close to the original.  If we were 
really careful about things, you could get back
exactly the original.

> lpcresyn Spechs16.lpc identity.float -s Spechs16.res 
> float2wv identity.float identity.wav -s 16000 -g 0.0
> sndplay identity.wav

Cross Synthesis!!! ---------------------------

> fitlpc 40 4000 1000 Love.wav Love.lpc Love.res
> fitlpc 40 4000 1000 Lion.wav Lion.lpc Lion.res
> lpcresyn Love.lpc LoveLion.float -s Lion.res 
> float2wv LoveLion.float LoveLion.wav -s 22050 -g 0.0 
> sndplay LoveLion.wav

Some sounds you can just substitute directly for
the excitation, like the flute sound:

> wv2float Fluta.wav Fluta.float
> lpcresyn Love.lpc LoveFlute.float -s Fluta.float 
> float2wv LoveFlute.float LoveFlute.wav -s 22050
> sndplay LoveFlute.wav

or extract the residual, and resynth with some time modification

> fitlpc 20 2048 512 Fluta.wav Fluta.lpc Fluta.res
> lpcresyn Love.lpc LoveBriteFlute.float -t 0.66 -s Fluta.res 
> float2wv LoveBriteFlute.float LoveBriteFlute.wav -s 22050 -g 0.0 
> sndplay LoveBriteFlute.wav

----------------------------------------------

Suggested transformations and cross-syntheses:

Try to model the flute using parametric LPC.  What order is required
to capture the pitch?  You might need to set the window size small
enough so that the pitch detector fails.  Or just force noise-only
resynthesis using the -p 0.0 option.  

Time and pitch stretch the lion.

Become Dr. Moreau:  
   Find some other cool sounds to cross synthesize.
   Create unholy creatures which are part human, 
   	part other beast, or part instrument, part
   	lawnmower, or ... worst of all, part Bill
	Gates, and part Steve Jobs...

----------------------------------------------
