public class LPC extends Object
| Modifier and Type | Field and Description |
|---|---|
protected int |
order
The order of this LPC calculation
|
protected double[] |
rawCoefficients
The coefficients as calculated by the LPC algorithm
|
protected double |
rawError
The error calculated by the LPC algorithm
|
| Constructor and Description |
|---|
LPC(int order)
Constructor creates an LPC object of the given order.
|
| Modifier and Type | Method and Description |
|---|---|
static void |
calculate(LPC lpc,
long[] R)
Calculate an LPC using the given Auto-correlation data.
|
static void |
calculateFromPrior(LPC lpc,
long[] R,
LPC priorLPC)
Calculate an LPC using a prior order LPC's values to save calculations.
|
static void |
createAutoCorrelation(long[] R,
int[] samples,
int count,
int start,
int increment,
int maxOrder)
Create auto-correlation coefficients(up to a maxOrder of 32).
|
double[] |
getCoefficients()
Get the calculated LPC Coefficients as an array.
|
double |
getError()
Get the error for this LPC calculation
|
int |
getOrder()
Get this LPC object's order
|
static void |
window(int[] samples,
int count,
int start,
int increment,
int[] windowedSamples)
Apply a window function to sample data
|
protected double rawError
protected double[] rawCoefficients
protected int order
public LPC(int order)
order - Order for this LPC calculation.public int getOrder()
public double getError()
public double[] getCoefficients()
public static void calculate(LPC lpc, long[] R)
lpc - LPC to calculateR - Autocorrelation data to usepublic static void calculateFromPrior(LPC lpc, long[] R, LPC priorLPC)
lpc - LPC to calculateR - Auto-correlation data to use.priorLPC - Prior order LPC to use(may be any order lower than our
target LPC)public static void createAutoCorrelation(long[] R,
int[] samples,
int count,
int start,
int increment,
int maxOrder)
R - Array to put results in.samples - Samples to calculate the auto-correlation for.count - number of samples to usestart - index of samples array to start atincrement - number of indices to increment between valid samples(for
interleaved arrays)maxOrder - maximum order to calculate.public static void window(int[] samples,
int count,
int start,
int increment,
int[] windowedSamples)
samples - Samples to apply window to. Values in this array are left
unaltered.count - number of samples to usestart - index of samples array to start atincrement - number of indices to increment between valid samples(for
interleaved arrays)windowedSamples - array containing windowed values. Return values
are packed(increment of one).Copyright © 2017. All rights reserved.