The determination of diffusion length and surface barrier width from surface photovoltage measurements in CdSe and amorphous Si films