function [pitch] = pitch_detect(x)
%PITCH_DETECT	Performs pitch detection on a speech waveform
%
%       p = pitch_detect(x);
%	x is vector containing frame of speech data
%       p is scalar containing pitch of frame in Hz or 0 if unvoiced

Fs = 8000;

%  First, remove the dc value of the frame by subtracting the mean . . .

x = x-mean(x);

%  Then find the minimum and maximum samples and center clip to 
%  75% of those values (`cclip') . . .

%  Compute the autocorrelation of the frame . . .


%  Find the maximum peak following Rx[0] (`peak') . . .

% Determine if the segment is unvoiced based on the 'voicing strength' 
% (the ratio of the autocorrelation function at the peak pitch lag 
% to the autocorrelation function lag=0) . . .

% If voicing strength is less than 0.25, call it unvoiced and set pitch = 0,
% otherwise compute the pitch from the % index of the peak . . .





