OpenLoop Pitch (OLP) Search
Three functions are provided for openloop pitch (OLP) search. Use of these functions is mutually exclusive, that is, only one is appropriate for an application during any given frame type. The appropriate choice of an OLP search function depends upon the state of the discontinuous transmission ( DTX) and VAD modules. The OLP search functions should be applied as follows:
Encoder Mode 
Appropriate Function 

DTX disabled 
ippsOpenLoopPitchSearchNonDTX_GSMAMR 
DTX, VAD 1 enabled 
ippsOpenLoopPitchSearchDTXVAD1_GSMAMR 
DTX, VAD 2 enabled 
ippsOpenLoopPitchSearchDTXVAD2_GSMAMR 
The OLP search functions extract a pitch estimate from a weighted version of the input speech. For 5.15 and 4.75 kbps frames, the search is performed once per frame. For all other frame rates, the search is performed twice per frame. A unique search is employed for 10.2 kbps frames. The OLP search details are as follows:
If the transmission bit rate is 10.2 kbps, do the following:
 Compute a windowed autocorrelation of weighted speech, that is,
where the sequence sw(n) contains weighted speech, and w is the weighting function given by
In this weighting function, wl emphasizes low pitch, and is defined in terms of the table cw, while wn is a sequence of neighboring emphasis lag coefficients associated with the previous frame, that is
and the parameter T_{old} is the median filtered pitch lag of 5 previous voiced speech half frames.The estimated OLP lag is the value k that maximizes R(k). It is denoted by T_{op}.

Compute the optimal openloop gain using the relation
In addition,
andIf g > 0, the previous pitch lag buffer and v median pitch lag of the previous pitch lags are updated.
For rates other than 10.2 kbps, the following OLP search procedure is employed:

Three maximums are found in three different ranges for the correlations given by
For 5.15 and 4.75 kbps frames, length = 160.
For all other bit rates (except 10.2 kbps), length = 80.

Normalize the three maximum correlations according to

Determine the best openloop lag using the following rule:
T_{op} = T_{1}, M(T_{op}) = M_{1}, if M_{2} > 0.85 M(T_{op});
M(T_{op}) = M_{2}, T_{op} = T_{2}, if M_{3} > 0.85 M(T_{op});
T_{op} = T_{3}.
Each of the OLP search functions implements the ratedependent search algorithms described above. Next, details are given for nonDTX, VAD1, and VAD2 OLP search functions.