(frames, nfft)
return numpy.absolute(complex_spec)
Compute the magnitude spectrum of each frame in frames. If frames is an NxD matrix, output will be Nx(NFFT/2+1).

    :param frames: the array of frames. Each row is a frame.
    :param NFFT: the FFT length to use. If NFFT > frame_len, the frames are zero-padded.
    :returns: If frames is an NxD matrix, output will be Nx(NFFT/2+1). Each row will be the magnitude spectrum of the corresponding frame.
Compute the magnitude spectrum of each frame in frames. If frames is an NxD matrix, output will be Nx(NFFT/2+1).
Compute the magnitude spectrum of each frame in frames . If frames is an NxD matrix output will be Nx ( NFFT / 2 + 1 ) .
def magspec(frames, nfft):
  """Compute the magnitude spectrum of each frame in frames. If frames is an NxD matrix, output will be Nx(NFFT/2+1).

    :param frames: the array of frames. Each row is a frame.
    :param NFFT: the FFT length to use. If NFFT > frame_len, the frames are zero-padded.
    :returns: If frames is an NxD matrix, output will be Nx(NFFT/2+1). Each row will be the magnitude spectrum of the corresponding frame.
    """
  if numpy.shape(frames)[1] > nfft:
    logging.warning(
        'frame length (%d) is greater than FFT size (%d), frame will be truncated. Increase NFFT to avoid.',
        numpy.shape(frames)[1], nfft)
  complex_spec = numpy.fft.rfft(frames, nfft)
  return numpy.absolute(complex_spec)
def magspec ( frames , nfft ) : if numpy . shape ( frames ) [ 1 ] > nfft : logging . warning ( 'frame length (%d) is greater than FFT size (%d), frame will be truncated. Increase NFFT to avoid.' , numpy . shape ( frames ) [ 1 ] , nfft ) complex_spec = numpy . fft . rfft ( frames , nfft ) return numpy . absolute ( complex_spec )