  Two-particle rapidity (or pseudorapidity) correlation function $C(y_1, y_2)$
was used in analysing fluctuation of particle density distribution in rapidity
in high-energy heavy-ion collisions. In our research, we argue that for a
centrality window, some additional correlation may be caused by a centrality
span, when the mean two- and single-particle densities over a centrality window
are used directly in the calculation , just like $\left<N(y_1, y_2) \right> /
\left[\left<N(y_1)\right>\left<N(y_2)\right>\right]$. We concentrate on
removing the influence of collision-centrality span on correlation function,
and two calculation methods are raised. In one method, correlation coefficients
are considered to be the ratios of probabilities (not the particle density). In
the other method, a relative multiplicity is introduced to unity the events of
different centralities. For testing the methods, {\sc ampt} model is used and a
toy granular model is built to simulate the fluctuation of particle density in
rapidity.
