docs: def plot_PSD(self, xlim=None, units="kHz", show_fig=True, timeStart=None, timeEnd=None, *args, **kwargs):
          """
          plot the pulse spectral density.
  
          Parameters
          ----------
          xlim : array_like, optional
              The x limits of the plotted PSD [LowerLimit, UpperLimit]
              Default value is [0, SampleFreq/2]
          units : string, optional
              Units of frequency to plot on the x axis - defaults to kHz
          show_fig : bool, optional
              If True runs plt.show() before returning figure
              if False it just returns the figure object.
              (the default is True, it shows the figure)
  
          Returns
          -------
          fig : matplotlib.figure.Figure object
              The figure object created
          ax : matplotlib.axes.Axes object
              The subplot object created
          """
          #        self.get_PSD()
          if timeStart == None and timeEnd == None:
              freqs = self.freqs
              PSD = self.PSD
          else:
              freqs, PSD = self.get_PSD(timeStart=timeStart, timeEnd=timeEnd)
              
          unit_prefix = units[:-2]
          if xlim == None:
              xlim = [0, unit_conversion(self.SampleFreq/2, unit_prefix)]
          fig = _plt.figure(figsize=properties['default_fig_size'])
          ax = fig.add_subplot(111)
          ax.semilogy(unit_conversion(freqs, unit_prefix), PSD, *args, **kwargs)
          ax.set_xlabel("Frequency ({})".format(units))
          ax.set_xlim(xlim)
          ax.grid(which="major")
          ax.set_ylabel("$S_{xx}$ ($V^2/Hz$)")
          if show_fig == True:
              _plt.show()
          return fig, ax