Continuous-wave and giant-pulse operations of a single-frequency erbium-doped fiber laser