code: def chroma_features(signal, sampling_rate, num_fft):
      # TODO: 1 complexity
      # TODO: 2 bug with large windows
  
      num_chroma, num_freqs_per_chroma = chroma_features_init(
          num_fft, sampling_rate
      )
      chroma_names = [
          "A",
          "A#",
          "B",
          "C",
          "C#",
          "D",
          "D#",
          "E",
          "F",
          "F#",
          "G",
          "G#",
      ]
      spec = signal**2
      if num_chroma.max() < num_chroma.shape[0]:
          C = np.zeros((num_chroma.shape[0],))
          C[num_chroma] = spec
          C /= num_freqs_per_chroma[num_chroma]
      else:
          I = np.nonzero(num_chroma > num_chroma.shape[0])[0][0]
          C = np.zeros((num_chroma.shape[0],))
          C[num_chroma[0 : I - 1]] = spec
          C /= num_freqs_per_chroma
      final_matrix = np.zeros((12, 1))
      newD = int(np.ceil(C.shape[0] / 12.0) * 12)
      C2 = np.zeros((newD,))
      C2[0 : C.shape[0]] = C
      C2 = C2.reshape(int(C2.shape[0] / 12), 12)
      # for i in range(12):
      #    finalC[i] = np.sum(C[i:C.shape[0]:12])
      final_matrix = np.sum(C2, axis=0).reshape(1, -1).T
  
      spec_sum = spec.sum()
      if spec_sum == 0:
          final_matrix /= eps
      else:
          final_matrix /= spec_sum
  
      #    ax = plt.gca()
      #    plt.hold(False)
      #    plt.plot(finalC)
      #    ax.set_xticks(range(len(chromaNames)))
      #    ax.set_xticklabels(chromaNames)
      #    xaxis = np.arange(0, 0.02, 0.01);
      #    ax.set_yticks(range(len(xaxis)))
      #    ax.set_yticklabels(xaxis)
      #    plt.show(block=False)
      #    plt.draw()
  
      return chroma_names, final_matrix
  
imports: from __future__ import print_function
  import math
  import numpy
  import sys
  from scipy.fftpack import fft
  import matplotlib.pyplot
  from scipy.signal import lfilter
  from scipy.fftpack.realtransforms import dct
  from tqdm import tqdm
label_desc: Use image node_id 13 for calling a global function with example usage: chroma_features(signal, sampling_rate, num_fft) and returns: chroma_names,  final_matrix