Beam hardening artefacts in x-ray computed tomography (CT) result from energy-dependent attenuation of x-rays in matter and cause inaccuracies in reconstructed 3D volume data. Effects due to beam hardening can easily be corrected if the detected spectrum of x-rays is known after having passed through an object. Conventional scintillator x-ray detectors, however, are incapable of measuring spectral information directly. The innovative idea of this paper is to extract information about the detected spectrum from image noise statistics and to estimate the spectrum using a new semi-empirical model function for a partially absorbed x-ray spectrum depending on a single unknown variable. The beam hardening correction factor is thus determined for each image pixel prior to the 3D reconstruction, does not require knowledge of the material of the CT-scanned object and is determined by modelling physical effects directly, without relying on an iterative approach or elaborate image processing.