code: def sptk_extract(
      x: np.ndarray,
      fs: int,
      n_fft: int = 512,
      n_shift: int = 256,
      mcep_dim: int = 25,
      mcep_alpha: float = 0.41,
      is_padding: bool = False,
  ) -> np.ndarray:
      """Extract SPTK-based mel-cepstrum.
  
      Args:
          x (ndarray): 1D waveform array.
          fs (int): Sampling rate
          n_fft (int): FFT length in point (default=512).
          n_shift (int): Shift length in point (default=256).
          mcep_dim (int): Dimension of mel-cepstrum (default=25).
          mcep_alpha (float): All pass filter coefficient (default=0.41).
          is_padding (bool): Whether to pad the end of signal (default=False).
  
      Returns:
          ndarray: Mel-cepstrum with the size (N, n_fft).
  
      """
      # perform padding
      if is_padding:
          n_pad = n_fft - (len(x) - n_fft) % n_shift
          x = np.pad(x, (0, n_pad), "reflect")
  
      # get number of frames
      n_frame = (len(x) - n_fft) // n_shift + 1
  
      # get window function
      win = pysptk.sptk.hamming(n_fft)
  
      # check mcep and alpha
      if mcep_dim is None or mcep_alpha is None:
          mcep_dim, mcep_alpha = _get_best_mcep_params(fs)
  
      # calculate spectrogram
      mcep = [
          pysptk.mcep(
              x[n_shift * i : n_shift * i + n_fft] * win,
              mcep_dim,
              mcep_alpha,
              eps=1e-6,
              etype=1,
          )
          for i in range(n_frame)
      ]
  
      return np.stack(mcep)
  
file_path: espnet/egs2/yesno/asr1/pyscripts/utils/evaluate_mcd.py
imports: import argparse
  import fnmatch
  import logging
  import multiprocessing
  import os
  from typing import Dict, List, Tuple
  import librosa
  import numpy
  import pysptk
  import soundfile
  from fastdtw import fastdtw
  from scipy import spatial
label_desc: Use image node_id 2 for calling a global function with example usage: sptk_extract(x, fs, n_fft, n_shift, mcep_dim, mcep_alpha, is_padding) and returns: np