An ultraminiaturized spectrometer