Design, fabrication and applications of porous silicon based optical devices