class_docstr: Constructs a Whisper feature extractor.
  
  This feature extractor inherits from [`WhisperFeatureExtractor`] which contains most of the main methods. Users
  should refer to this superclass for more information regarding those methods.
  
  This class extracts mel-filter bank features from raw speech using a custom numpy implementation of the `Short Time
  Fourier Transform` which should match pytorch's `torch.stft` equivalent.
  
  Args:
      feature_size (`int`, defaults to 80):
          The feature dimension of the extracted features.
      sampling_rate (`int`, defaults to 16000):
          The sampling rate at which the audio files should be digitalized expressed in Hertz per second (Hz).
      hop_length (`int`, defaults to 160):
          Length of the overlaping windows for the STFT used to obtain the Mel Frequency coefficients.
      chunk_length (`int`, defaults to 30):
          The maximum number of chuncks of `sampling_rate` samples used to trim and pad longer or shorter audio
          sequences.
      n_fft (`int`, defaults to 400):
          Size of the Fourier transform.
      padding_value (`float`, *optional*, defaults to 0.0):
          Padding value used to pad the audio. Should correspond to silences.
code: def get_mel_filters(self, sr, n_fft, n_mels=128, dtype=np.float32):
      # Initialize the weights
      n_mels = int(n_mels)
      weights = np.zeros((n_mels, int(1 + n_fft // 2)), dtype=dtype)
  
      # Center freqs of each FFT bin
      fftfreqs = np.fft.rfftfreq(n=n_fft, d=1.0 / sr)
  
      # 'Center freqs' of mel bands - uniformly spaced between limits
      min_mel = 0.0
      max_mel = 45.245640471924965
  
      mels = np.linspace(min_mel, max_mel, n_mels + 2)
  
      mels = np.asanyarray(mels)
  
      # Fill in the linear scale
      f_min = 0.0
      f_sp = 200.0 / 3
      freqs = f_min + f_sp * mels
  
      # And now the nonlinear scale
      min_log_hz = 1000.0  # beginning of log region (Hz)
      min_log_mel = (min_log_hz - f_min) / f_sp  # same (Mels)
      logstep = np.log(6.4) / 27.0  # step size for log region
  
      # If we have vector data, vectorize
      log_t = mels >= min_log_mel
      freqs[log_t] = min_log_hz * np.exp(
          logstep * (mels[log_t] - min_log_mel)
      )
  
      mel_f = freqs
  
      fdiff = np.diff(mel_f)
      ramps = np.subtract.outer(mel_f, fftfreqs)
  
      for i in range(n_mels):
          # lower and upper slopes for all bins
          lower = -ramps[i] / fdiff[i]
          upper = ramps[i + 2] / fdiff[i + 1]
  
          # .. then intersect them with each other and zero
          weights[i] = np.maximum(0, np.minimum(lower, upper))
  
      # Slaney-style mel is scaled to be approx constant energy per channel
      enorm = 2.0 / (mel_f[2 : n_mels + 2] - mel_f[:n_mels])
      weights *= enorm[:, np.newaxis]
  
      return weights
  
file_path: H2O/h2o_flexgen/benchmark/third_party/transformers/src/transformers/models/whisper/feature_extraction_whisper.py
imports: from typing import List, Optional, Union
  import numpy
  from numpy.fft import fft
  from ...feature_extraction_sequence_utils import SequenceFeatureExtractor
  from ...feature_extraction_utils import BatchFeature
  from ...utils import TensorType, logging
label_desc: Use image node_id 2 for calling the WhisperFeatureExtractor obj's underlying member method code with example usage: obj.get_mel_filters(sr, n_fft, n_mels, dtype) and returns: weights