A direct method for unfolding the resolution function from measurements of neutron induced reactions