lpc

Files: lpc.h, lpc.c

A linear predictive coding filter. This module is a wrapper for the open source library openlpc, which implements the LPC10 audio codec optimized for speech signals. This module takes in an input signal, downsamples it, and produces a decoded LPC10 audio signal, which has a similar sound to that of a speak and spell. In this context, the LPC signal is meant to be more of a audio effect rather than a utility for communication.
Because the LPC10 encoder relies on frames for encoding, the output signal has a few milliseconds of delay. The delay can be calculated in seconds as (framesize * 4) / samplerate.
In addition to using the LPC as a decoder/encoder, this module can also be set to synth mode. Instead of reading from an input signal, the LPC can instead read from parameters set directly in a scaled ftable.

Functions

sp_lpc_create(sp_lpc **lpc)
sp_lpc_init(sp_data *sp, sp_lpc *lpc, int framesize)
sp_lpc_compute(sp_data *sp, sp_lpc *lpc, SPFLOAT *input, SPFLOAT *output)
sp_lpc_destroy(sp_lpc **lpc)

Mandatory Parameters

framesize: Sets the frame size for the encoder.
(Recommended value: 512)

Optional Parameters


Inputs

input: Input signal to be processed with LPC.

Outputs

output: LPC encoded signal.

Other Functions:

sp_lpc_synth(sp_data *sp, sp_lpc *lpc, sp_ftbl * ft)
Toggle synth mode. Instead of reading an input, manipulate the parameters in a scaled ftable.
ft: ftable of size 7
(Suggested default: N/A)