A writing technique for long fiber Bragg gratings with complex reflectivity profiles