code: def _compute_nccf(
      waveform: Tensor,
      sample_rate: int,
      frame_time: float,
      freq_low: int,
  ) -> Tensor:
      r"""
      Compute Normalized Cross-Correlation Function (NCCF).
  
      .. math::
          \phi_i(m) = \frac{\sum_{n=b_i}^{b_i + N-1} w(n) w(m+n)}{\sqrt{E(b_i) E(m+b_i)}},
  
      where
      :math:`\phi_i(m)` is the NCCF at frame :math:`i` with lag :math:`m`,
      :math:`w` is the waveform,
      :math:`N` is the length of a frame,
      :math:`b_i` is the beginning of frame :math:`i`,
      :math:`E(j)` is the energy :math:`\sum_{n=j}^{j+N-1} w^2(n)`.
      """
  
      EPSILON = 10 ** (-9)
  
      # Number of lags to check
      lags = int(math.ceil(sample_rate / freq_low))
  
      frame_size = int(math.ceil(sample_rate * frame_time))
  
      waveform_length = waveform.size()[-1]
      num_of_frames = int(math.ceil(waveform_length / frame_size))
  
      p = lags + num_of_frames * frame_size - waveform_length
      waveform = torch.nn.functional.pad(waveform, (0, p))
  
      # Compute lags
      output_lag = []
      for lag in range(1, lags + 1):
          s1 = waveform[..., :-lag].unfold(-1, frame_size, frame_size)[
              ..., :num_of_frames, :
          ]
          s2 = waveform[..., lag:].unfold(-1, frame_size, frame_size)[
              ..., :num_of_frames, :
          ]
  
          output_frames = (
              (s1 * s2).sum(-1)
              / (
                  EPSILON + torch.linalg.vector_norm(s1, ord=2, dim=-1)
              ).pow(2)
              / (
                  EPSILON + torch.linalg.vector_norm(s2, ord=2, dim=-1)
              ).pow(2)
          )
  
          output_lag.append(output_frames.unsqueeze(-1))
  
      nccf = torch.cat(output_lag, -1)
  
      return nccf
  
imports: import math
  import tempfile
  import warnings
  from collections.abc import Sequence
  from typing import List, Optional, Tuple, Union
  import torch
  import torchaudio
  from torch import Tensor
  from torchaudio._internal.module_utils import deprecated
  from .filtering import highpass_biquad, treble_biquad
label_desc: Use image node_id 21 for calling a global function with example usage: _compute_nccf(waveform, sample_rate, frame_time, freq_low) and returns: nccf