| 1840 | return |
| 1841 | |
| 1842 | def plot_func(ax, h): |
| 1843 | if kind == "ir": |
| 1844 | ax.plot(np.arange(len(h)) / float(self.fs / 1000), h) |
| 1845 | elif kind == "tf": |
| 1846 | H = 20.0 * np.log10(abs(np.fft.rfft(h)) + 1e-15) |
| 1847 | freq = np.arange(H.shape[0]) / h.shape[0] * (self.fs / 1000) |
| 1848 | ax.plot(freq, H) |
| 1849 | elif kind == "spec": |
| 1850 | rng = random.get_rng() |
| 1851 | h = h + rng.normal(size=h.shape) * 1e-15 |
| 1852 | ax.specgram(h, Fs=self.fs / 1000) |
| 1853 | else: |
| 1854 | raise ValueError("The value of 'kind' should be 'ir', 'tf', or 'spec'.") |
| 1855 | |
| 1856 | if select is None: |
| 1857 | fig, axes = plt.subplots( |