code: def fit_freq_std_dev(self, training_signal):
          
  
          window_length = len(self.window)
          window_weight = sum(self.window)
          num_of_windows = len(training_signal) - window_length - 1
          mean = np.zeros(int(window_length / 2) + 1)
          pow = np.zeros(int(window_length / 2) + 1)
          temp = np.zeros(int(window_length / 2) + 1)
          rfft = np.fft.rfft(training_signal[0:0 + window_length] * self.window)
          max = np.abs(rfft) / window_weight
          min = max
  
          for i in range(0, num_of_windows):
              rfft = np.fft.rfft(training_signal[i:i + window_length] * self.window)
              temp = np.abs(rfft) / window_weight
              max = np.maximum(temp, max)
              min = np.minimum(temp, min)
              mean = mean + temp
              pow = pow + np.power(temp, 2)
  
          mean = mean / num_of_windows
          pow = pow / num_of_windows
          std_dev = np.sqrt(pow - np.power(mean, 2))
          self.mask_top = mean + self.gain * std_dev
          self.mask_bottom = np.maximum(mean - self.gain * std_dev,
                                        np.zeros(int(window_length / 2) + 1))
docs: Defines a spectral mask based on training data using the standard deviation values of
               each frequency component
  
          Args:
              training_signal: Training data