Determination of background doping polarity of unintentionally doped semiconductor layers