Spin Waves in Periodic Media and Magnetic Textures