Adapted and expanded from R. Moore's LPC analysis code from Computer Music.
path |
The path for a mono sound file to analyze. |
nPoles |
the number of poles for the all-pole filter (default: 35, must be less the 200) |
frameSize |
the number of samples to use for each from of analysis (default: 400) |
hop |
a percentage of the frameSize to skip for the next window (default: 0.5) |
channel |
the channel to analyze if the file at 'path' is multi-channel (default: 0) |
minFreq |
a minFreq to search for in pitch tracking (defautl: 70) |
maxFreq |
a maxFreq to search for in pitch tracking (default: 200) |
check |
Attempts to check poles for stability. WARNING: Somewhere in this code, I've made a terrible mistake. It actually CAUSES instabilities rather then getting rid of them... but I can't, for the life of me, see where the error is. Don't use it. Moore's basic algorithm is pretty good, and the filters seems fairly stable. If you have problems, try increasing the number of poles (default: 0). |
conditionSignal |
Default: 0, 1 works well, choose 2 if you want exploding filters that might (?) be interesting.
|
completion |
A function to evaluate when the analysis is finished. Handy for bulk analyzing files, and auto saving them. |
low pass the error signal numTurns times
numTurns |
low pass the overall rms signal numTurns times
numTurns |
Low pass the pchcps signal numTurns times
numTurns |
save file to an LPC file usable by LPCFile, LPCSynth and LPCVals.
path |
Save file to an LPC file usable by LPCFile, LPCSynth and LPCVals, as well as a floating point .aif data file for use in NRT.
path |
a | |
m | |
x | |
eps | |
p |
theseCoefs | |
check |
a |
check | |
conditionSignal |
argNPoles | |
argFrameSize | |
argHop | |
argChannel | |
argMinFreq | |
argMaxFreq |
a = LPCAna.new(Platform.resourceDir +/+ "sounds/a11wlk01.wav"); a.ana(50, 400, 0.5, 0, 70, 300); // low pass an aspect of the analysis a.err.plot a.lperr; a.err.plot; a.pchcps.plot; a.lppch; a.pchcps.plot;