Frequency-restrained structure-factor refinement, I : Histogram simulation