Programmer Guide/Command Reference/EVAL/lpc: Difference between revisions

From STX Wiki
Jump to navigationJump to search
m (1 revision: Initial import)
No edit summary
Line 1: Line 1:
{{DISPLAYTITLE:{{SUBPAGENAME}}}}
{{DISPLAYTITLE:{{SUBPAGENAME}}}}
=====lpc=====
Compute the linear prediction coefficients using the autocorrelation method ("Linear Prediction of Speech", Markel & Gray).
 
;Usage:<code>lpc(<var>x</var>, <var>m</var>, <var>p</var> {, <var>type</var> {, <var>lfft</var>}})</code>
Compute the linear prediction coefficients using a Hamming window.
:;<var>x</var>the signal vector; this should be a speech signal without windowing function (because the hamming-window is applied to ''x'' by this the function)
 
:;<var>m</var>:number of coefficients
=====Usage:=====
::rule of thumb: ''m'' ~ samplingrate / 1000 * 1.25
 
:;<var>p</var>differentiation factor; 0 <= ''p'' <= 1 (default=0)
<code>lpc(<var>x</var>, <var>m</var>, <var>p</var> {, <var>out</var>, <var>lfft</var>})</code>
:;<var>type</var>:output selector; 0 <= ''type'' <= 4 (default=0)
 
:;<var>lfft</var>:the length of the fft to be used for the computation of the transfer function (amplitude spectrum) of the inverse filter; ''m+1'' < ''lfft''
=====Function:=====
;Description:
 
:# apply differentiation to signal ''x''
Computes the linear prediction coefficients or the lpc smoothed spectrum of the signal vector x using the auto-correlation method.
:# apply hamming window to signal ''x''
 
:# use the autocorelation method to compute the inverse filter coefficients ''ai'', the reflection coefficients ''rc'' and the error (or residual) energy ''alpha''
=====Parameters:=====
:# convert coefficients to the selected result
 
;Result:A vector ''y'' containing the result of the function.
;<var>x</var>
:{|class="einrahmen"
 
!''type'' !! ''y'' !! nrow(''y'') !! description
:An unwindowed signal vector.
|-
 
|'''0'''
;<var>m</var>
|amplitude spectrum of the inverse filter
 
|''lfft''/2+1
:The number of coefficients.
|this function can be used in speech analysis to compute the ''transfer function of the vocal tract'' (e.g. for formant extraction)
 
|-
;<var>p</var>
|'''1'''
 
|<code>''y''[0]=''alpha''</code><BR><code>''y''[1..M+1]=''ai[0..''m'']
:The pre-emphasis factor (<code>0 <=</code> <var>p</var> <code><= 1</code>).
|''m''+2
 
|the error energy (''alpha'') and the ''m''+1 inverse filter coefficients ''ai''
;<var>out</var>
|-
 
|'''2'''
:The output selector. See the result for details.
|<code>''y''[0]=''alpha''</code><BR><code>''y''[1..M]=''rc[0..''m''-1]
 
|''m''+1
;<var>lfft</var>
|the error energy (''alpha'') and the ''m'' reflection coefficients ''rc''
 
|-
:The fft length for smoothed spectrum.
|'''3'''
 
|<code>''y''[0]=''alpha''</code><BR><code>''y''[1..M+1]=''ar[0..''m'']
=====Result:=====
|''m''+2
 
|the error energy (''alpha'') and the ''m'' area coefficients ''ar''<BR>(''ar''[i] ~ area of section i)
A vector <code>y</code>. The type of vector depends on the parameter <var>out</var>:
|-
 
|'''4'''
<code>0</code> - A smoothed linear amplitude spectrum where <code>length =</code> <var>lfft</var><code>/2+1</code> and <code>y[0 ..</code> <var>lfft</var><code>/2]</code>.
|<code>''y''[0]=''alpha''</code><BR><code>''y''[1..M+1]=''lar[0..''m'']
 
|''m''+2
<code>1</code> - The error energy and inverse filter coefficients where <code>length =</code> <var>m</var><code>+2</code> and <code>y[0] = alpha</code> and <code>y[1 ..</code> <var>m</var><code>+1] = AI[0..</code><var>m</var><code>]</code>.
|the error energy (''alpha'') and the ''m'' log. area coefficients ''lar''<BR>(''lar''[i] ~ diameter of section i)
 
|}
<code>2</code> - The error energy and reflection coefficients where <code>length =</code> <var>m</var><code>+1</code>, <code>y[0] = alpha</code> and <code>y[1..</code><var>m</var><code>] = RC[0..</code><var>m</var><code>-1]</code>.
;See also: [[Programmer_Guide/Command_Reference/EVAL/fft|fft]], [[Programmer_Guide/Command_Reference/EVAL/ifft|ifft]], [[Programmer_Guide/Command_Reference/EVAL/dct|dct]], [[Programmer_Guide/Command_Reference/EVAL/cepstrum|cepstrum]], [[Programmer_Guide/Command_Reference/EVAL/lpc|lpc]], [[Programmer_Guide/Command_Reference/EVAL/complex arithmetic|complex arithmetic]]
 
<code>3</code> - The error energy and area coefficients where <code>length =</code> <var>m</var><code>+1</code>, <code>y[0] = alpha</code> and <code>y[1..</code><var>m</var><code>] = AR[0..</code><var>m</var><code>-1]</code>.
 
<code>4</code> - The error energy and log. area coefficients where <code>length =</code> <var>m</var><code>+1</code>, <code>y[0] = alpha</code> and <code>y[1..</code><var>m</var><code>] = sqrt(AR[0..</code><var>m</var><code>-1])</code>.

Revision as of 14:12, 12 April 2011

Compute the linear prediction coefficients using the autocorrelation method ("Linear Prediction of Speech", Markel & Gray).

Usage
lpc(x, m, p {, type {, lfft}})
xthe signal vector; this should be a speech signal without windowing function (because the hamming-window is applied to x by this the function)
m
number of coefficients
rule of thumb: m ~ samplingrate / 1000 * 1.25
pdifferentiation factor; 0 <= p <= 1 (default=0)
type
output selector; 0 <= type <= 4 (default=0)
lfft
the length of the fft to be used for the computation of the transfer function (amplitude spectrum) of the inverse filter; m+1 < lfft
Description
  1. apply differentiation to signal x
  2. apply hamming window to signal x
  3. use the autocorelation method to compute the inverse filter coefficients ai, the reflection coefficients rc and the error (or residual) energy alpha
  4. convert coefficients to the selected result
Result
A vector y containing the result of the function.
type y nrow(y) description
0 amplitude spectrum of the inverse filter lfft/2+1 this function can be used in speech analysis to compute the transfer function of the vocal tract (e.g. for formant extraction)
1 y[0]=alpha
y[1..M+1]=ai[0..m]
m+2 the error energy (alpha) and the m+1 inverse filter coefficients ai
2 y[0]=alpha
y[1..M]=rc[0..m-1]
m+1 the error energy (alpha) and the m reflection coefficients rc
3 y[0]=alpha
y[1..M+1]=ar[0..m]
m+2 the error energy (alpha) and the m area coefficients ar
(ar[i] ~ area of section i)
4 y[0]=alpha
y[1..M+1]=lar[0..m]
m+2 the error energy (alpha) and the m log. area coefficients lar
(lar[i] ~ diameter of section i)
See also
fft, ifft, dct, cepstrum, lpc, complex arithmetic

Navigation menu

Personal tools