Characterization of $H^{p}(R^{n})$ in terms of generalized Littlewood-Paley g-functions