Generation of Q-switched Fiber Laser