Terahertz generation and detection using femtosecond mode-locked Yb-doped fiber laser