0% found this document useful (0 votes)
20 views2 pages

LPC Coding

1. The speech signal is read from a file and divided into frames of 30ms. 2. Each frame is analyzed using a for loop to extract the filter coefficients, pitch period, and gain. 3. The Levinson-Durbin algorithm is used to calculate the filter coefficients from the autocorrelation function of the frame. 4. The pitch period is found by searching within a range based on the minimum and maximum periods for a female or male voice. 5. The gain is calculated as the root mean square of the estimation error within a multiple of the pitch period.

Uploaded by

Hitesh Baheti
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
20 views2 pages

LPC Coding

1. The speech signal is read from a file and divided into frames of 30ms. 2. Each frame is analyzed using a for loop to extract the filter coefficients, pitch period, and gain. 3. The Levinson-Durbin algorithm is used to calculate the filter coefficients from the autocorrelation function of the frame. 4. The pitch period is found by searching within a range based on the minimum and maximum periods for a female or male voice. 5. The gain is calculated as the root mean square of the estimation error within a multiple of the pitch period.

Uploaded by

Hitesh Baheti
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

First the speech is being red.

fs=8000; file = 'hbspeech'; [x, fs] =wavread(file); plot(x);

M=10; b=1; Now speech is divided into frames, each frames of size 30ms. fsize = 30e-3; frame_length = (fs .* fsize); N=frame_length-1; Then each frames are being analised through for-loop for getting the parameters that are : 1.Filter coefficients , 2.Pitch_period and 3.gain. for b=1 : frame_length : (length(x) - frame_length), y1=x(b:b+N); y = filter([1 -.9378], 1, y1); a=[zeros(10):zeros(10)]; Levinson-Durbin Algorithm: This algorithm is used to solve for filter coefficient.

z=xcorr(y); %Auto-correlation Function R=z( ( (length(z)+1) ./2 ) : length(z)); i=1; E(1)=R(1); for i=2:M+1 k(i)=0; for j=1:i-1 k(i)=k(i)+(a(j,i-1).*R(i-j+1))-R(i)./E(i-1); end a(i,i)=k(i); for j=1:i-1 a(j,i)=a(j,i-1)+(k(i).*a(i-j,i-1)); end E(i)=(1-(k(i).*k(i))).*E(i-1); end arra=a((2:i),i); count=length(arra); est_y = filter((-arra(2:end)),1,y); e = y - est_y;

Finding of pitch_period
period_min =fs.*2e-3; period_max =fs.*20e-3; %min period of a female voice frame = 2ms

%max period of a male voice frame = 20ms

[R_max , R_mid]=max(R); pitch_per_range = R ( R_mid + period_min : R_mid + period_max ); [R_max, R_mid] = max(pitch_per_range); pitch_period = R_mid + period_min;

Finding of Gain
temp= ( floor( length(e)./pitch_period ) .* pitch_period ); gain(b) = sqrt( sum(e(1:temp).^2 ));

end

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy