Automatic energy reference peak position detection for Au(4f) and Si(2p)