Modal filtering for flexible beams using optical fibers