Preparation of nitrogen oxides using a plasma or an electric discharge