Generation of rectangular pulses in ytterbium-doped fiber laser based on a SnSe2 saturable absorber