In this paper, we present a simple method to detect the number of states in a stochastic trajectory. The method quantifies the degree of correlations in stochastic trajectories, computes the correlation function with two variables (the three-point correlation function), then finds the rank of the computed matrix (the method identifies the signal singular values, those that are beyond the noise). The computed rank is the number of states in the discrete trajectory, yet meaningful also in continuous trajectories; in such cases, the rank is compiled with the number of terms in the correlation function to determine the number of fluctuating independent potential profiles in the approximated discrete representation of the process.