Characteristic Functions Of Path Signatures And Applications