The ferroelectric phase transition in pure and lightly doped barium titanate