docstr: Check normalization and denormalization for range values and consistency 
docstr_tok: ["Check","normalization","and","denormalization","for","range","values","and","consistency"]
code: def test_normalize(self):
      """Check normalization and denormalization for range values and consistency"""
      print(" > Testing normalization and denormalization.")
      wav = self.ap.load_wav(WAV_FILE)
      wav = self.ap.sound_norm(
          wav
      )  # normalize audio to get abetter normalization range below.
      self.ap.signal_norm = False
      x = self.ap.melspectrogram(wav)
      x_old = x
  
      self.ap.signal_norm = True
      self.ap.symmetric_norm = False
      self.ap.clip_norm = False
      self.ap.max_norm = 4.0
      x_norm = self.ap.normalize(x)
      print(
          f" > MaxNorm: {self.ap.max_norm}, ClipNorm:{self.ap.clip_norm}, SymmetricNorm:{self.ap.symmetric_norm}, SignalNorm:{self.ap.signal_norm} Range-> {x_norm.max()} --  {x_norm.min()}"
      )
      assert (x_old - x).sum() == 0
      # check value range
      assert x_norm.max() <= self.ap.max_norm + 1, x_norm.max()
      assert x_norm.min() >= 0 - 1, x_norm.min()
      # check denorm.
      x_ = self.ap.denormalize(x_norm)
      assert (x - x_).sum() < 1e-3, (x - x_).mean()
  
      self.ap.signal_norm = True
      self.ap.symmetric_norm = False
      self.ap.clip_norm = True
      self.ap.max_norm = 4.0
      x_norm = self.ap.normalize(x)
      print(
          f" > MaxNorm: {self.ap.max_norm}, ClipNorm:{self.ap.clip_norm}, SymmetricNorm:{self.ap.symmetric_norm}, SignalNorm:{self.ap.signal_norm} Range-> {x_norm.max()} --  {x_norm.min()}"
      )
  
      assert (x_old - x).sum() == 0
      # check value range
      assert x_norm.max() <= self.ap.max_norm, x_norm.max()
      assert x_norm.min() >= 0, x_norm.min()
      # check denorm.
      x_ = self.ap.denormalize(x_norm)
      assert (x - x_).sum() < 1e-3, (x - x_).mean()
  
      self.ap.signal_norm = True
      self.ap.symmetric_norm = True
      self.ap.clip_norm = False
      self.ap.max_norm = 4.0
      x_norm = self.ap.normalize(x)
      print(
          f" > MaxNorm: {self.ap.max_norm}, ClipNorm:{self.ap.clip_norm}, SymmetricNorm:{self.ap.symmetric_norm}, SignalNorm:{self.ap.signal_norm} Range-> {x_norm.max()} --  {x_norm.min()}"
      )
  
      assert (x_old - x).sum() == 0
      # check value range
      assert x_norm.max() <= self.ap.max_norm + 1, x_norm.max()
      assert (
          x_norm.min() >= -self.ap.max_norm - 2
      ), x_norm.min()  # pylint: disable=invalid-unary-operand-type
      assert x_norm.min() <= 0, x_norm.min()
      # check denorm.
      x_ = self.ap.denormalize(x_norm)
      assert (x - x_).sum() < 1e-3, (x - x_).mean()
  
      self.ap.signal_norm = True
      self.ap.symmetric_norm = True
      self.ap.clip_norm = True
      self.ap.max_norm = 4.0
      x_norm = self.ap.normalize(x)
      print(
          f" > MaxNorm: {self.ap.max_norm}, ClipNorm:{self.ap.clip_norm}, SymmetricNorm:{self.ap.symmetric_norm}, SignalNorm:{self.ap.signal_norm} Range-> {x_norm.max()} --  {x_norm.min()}"
      )
  
      assert (x_old - x).sum() == 0
      # check value range
      assert x_norm.max() <= self.ap.max_norm, x_norm.max()
      assert (
          x_norm.min() >= -self.ap.max_norm
      ), x_norm.min()  # pylint: disable=invalid-unary-operand-type
      assert x_norm.min() <= 0, x_norm.min()
      # check denorm.
      x_ = self.ap.denormalize(x_norm)
      assert (x - x_).sum() < 1e-3, (x - x_).mean()
  
      self.ap.signal_norm = True
      self.ap.symmetric_norm = False
      self.ap.max_norm = 1.0
      x_norm = self.ap.normalize(x)
      print(
          f" > MaxNorm: {self.ap.max_norm}, ClipNorm:{self.ap.clip_norm}, SymmetricNorm:{self.ap.symmetric_norm}, SignalNorm:{self.ap.signal_norm} Range-> {x_norm.max()} --  {x_norm.min()}"
      )
  
      assert (x_old - x).sum() == 0
      assert x_norm.max() <= self.ap.max_norm, x_norm.max()
      assert x_norm.min() >= 0, x_norm.min()
      x_ = self.ap.denormalize(x_norm)
      assert (x - x_).sum() < 1e-3
  
      self.ap.signal_norm = True
      self.ap.symmetric_norm = True
      self.ap.max_norm = 1.0
      x_norm = self.ap.normalize(x)
      print(
          f" > MaxNorm: {self.ap.max_norm}, ClipNorm:{self.ap.clip_norm}, SymmetricNorm:{self.ap.symmetric_norm}, SignalNorm:{self.ap.signal_norm} Range-> {x_norm.max()} --  {x_norm.min()}"
      )
  
      assert (x_old - x).sum() == 0
      assert x_norm.max() <= self.ap.max_norm, x_norm.max()
      assert (
          x_norm.min() >= -self.ap.max_norm
      ), x_norm.min()  # pylint: disable=invalid-unary-operand-type
      assert x_norm.min() < 0, x_norm.min()
      x_ = self.ap.denormalize(x_norm)
      assert (x - x_).sum() < 1e-3
  
file_path: TTS/tests/test_audio.py
imports: import os
  import unittest
  from tests import get_tests_input_path, get_tests_output_path, get_tests_path
  from TTS.utils.audio import AudioProcessor
  from TTS.utils.io import load_config
label_desc: Use image node_id 3 for calling the TestAudio obj's underlying member method code with example usage: obj.test_normalize() without return types