Semi‐empirical analysis of Sloan Digital Sky Survey galaxies – I. Spectral synthesis method