Studying the effects of noise correlations on population coding using a sampling method