code: public BufferedImage renderSpectrogram(Spectrogram spectrogram) {
  
      double[][] spectrogramData = spectrogram.getNormalizedSpectrogramData();
  
      int width = spectrogramData.length;
      int height = spectrogramData[0].length;
  
      BufferedImage bufferedImage = new BufferedImage(width, height, BufferedImage.TYPE_INT_RGB);
      for (int i = 0; i < width; i++) {
        for (int j = 0; j < height; j++) {
          int value;
          value = (int) (spectrogramData[i][j] * 255);
          bufferedImage.setRGB(i, j, value << 16 | value << 8 | value);
        }
      }
  
      return bufferedImage;
  
    }
docs: Render a spectrogram of a wave file
  
  @param spectrogram spectrogram object