Spectral filters are key components for many applications of integrated photonics, from optical communications to astronomy. In this PhD thesis, we propose a new technique to achieve filters with an arbitrary spectral shape using integrated Bragg gratings in the silicon on insulator platform. The design of filters with different spectral specifications is carried out, including multichannel flat-top filters for DWDM applications and multinotch filters for OH emission line suppression in astronomical observations. The proposed concept is validated through fabrication and experimental characterization of these designs.