Residual periodograms for choosing regularization parameters for ill-posed problems