Code covered by the BSD License
 Callbacks_lpc_vocoder_GUI...%SENSE COMPUTER AND SET FILE DELIMITER
 [A,G,a,r]=autolpc(x,p)
% function to computer the autocorrelation method solution
 [Afile,Gfile,nframes,excx...routine to perform autocorrelation method of lpc analysis on original
 [e]=create_excitation_sig...convert pitch period contour to excitation signal by appropriately
 [ex,exn,Gain]=normalize_e...appropriately normalize speech excitation signal based on measured Gain
 [p1m,pitch]=gen_pitch(xin...cepstral pitch detector used to generate pitch period contour
 [pd1,pd2,p1,p2]=pitch_det...% function to detect primary and secondary cepstral pitch period
 [pd1,pd2,p1,p2]=pitch_det...% function to detect primary and secondary cepstral pitch periods
 [s]=synthesize_speech(ss,...do synthesis via overlapadd method
 [ss1,es1]=plot_original_s...plot original speech waveform in top graphics Panel
 clear_all_graphics(graphi...clear all 4 graphicPanels for LPC Vocoder
 e=create_excitation(pitch...% create excitation function from pitch period array
 lpc_vocoder_GUI25
Modifiable runGUI file
 plot_excitation_signal(gr...plot unnormalized excitation signal in graphics Panel 2 (the second
 plot_pitch_period_contour...plot pitch period contour in graphics Panel 1 (which is actually the
 plot_synthetic_signal(gra...initialize graphics
 ppdf=smoothpitch(pp1,pp2,...% pitch period smoothing routine based on first and second candidates and
 save_excitations(ex,exn,f...save both unnormalized and normalized excitation signals in files
 setup_lpc_vocoder(xin,fs,...
 y1=medf(x1,L,N)
median filtering of sequence x1, of length N samples, with medians of
 y=highpass_filter(x,fs)
high pass filter recorded speeech to eliminate dc and hum
 y=record_speech(fs,nsec)
fs: sampling frequency
 pathnew_matlab_central.mpathnew_matlab_central

View all files
LPC Vocoder
by
Speech Processing
30 Jan 2014
(Updated
18 Apr 2014)
Builds an LPC vocoder, i.e., performs LPC analysis and synthesis on a speech file

[A,G,a,r]=autolpc(x,p)

function [A,G,a,r]=autolpc(x,p)
%
% function to computer the autocorrelation method solution
%
% Inputs:
% x is the signal frame (usually speech weighted by a window)
% p is the lpc model order
%
% Outputs:
% A is the denominator vector for the lpc solution, i.e.,
% A=1a1z^{1}a2z^{2}...apz^{p}
% G is the lpc model gain (rms prediction error)
% a is the lpc polynomial (without the 1 term)
% r is the vector of autocorrelation coefficients
% see also ATOK, KTOA, RTOA
% solve for the lpc polynomial using a simple matrix inversion method
L=length(x);
r=[];
for i=0:p
r=[r; sum(x(1:Li).*x(1+i:L))];
end
R=toeplitz(r(1:p));
a=inv(R)*r(2:p+1);
A=[1; a];
G=sqrt(sum(A.*r));
end


Contact us