def plot_power(self, high=None, **options): """Plots power vs frequency. high: frequency to cut off at """ if self.full: fs, amps = self.render_full(high) thinkplot.plot(fs, amps**2, **options) else: i = None if high is None else find_index(high, self.fs) thinkplot.plot(self.fs[:i], self.power[:i], **options)
def plot_power(self, low=0, high=None, expo=False, **options): """Plots the integrated spectrum. low: int index to start at high: int index to end at """ cs = self.cs[low:high] fs = self.fs[low:high] if expo: cs = np.exp(cs) thinkplot.plot(fs, cs, **options)
def plot(self, high=None, **options): """Plots amplitude vs frequency. Note: if this is a full spectrum, it ignores low and high high: frequency to cut off at """ if self.full: fs, amps = self.render_full(high) thinkplot.plot(fs, amps, **options) else: i = None if high is None else find_index(high, self.fs) thinkplot.plot(self.fs[:i], self.amps[:i], **options)
def plot(self, **options): """Plots the wave. """ xfactor = self.get_xfactor(options) thinkplot.plot(self.ts * xfactor, self.ys, **options)