Compact wavelength-tunable actively Q-switched fiber laser in CW and pulsed operation based on a fiber Bragg grating