Reconstruction of univariate functions from directional persistence diagrams