This document presents research on using a photorefractive crystal to create an all-optical tunable switch and filter. It describes using a potassium niobate crystal and adjusting the transmission grating period or incident angle to tune the filter. It analyzes signal beam propagation and diffraction efficiency using a simulation. The results show maximum diffraction towards the c-axis is preferable. Adjusting the control beam intensity can vary the diffraction efficiency and bandwidth. Both transmission and reflection grating configurations are investigated, with reflection offering narrower bandwidth below 0.1nm. In conclusion, the crystal allows selecting and controlling signal wavelengths by adjusting the grating properties.