Defect spectroscopy from electrical measurements: A simulation based technique