Time-frequency Resolution: Short Analysis WindowΒΆ

This example shows the effect of an analysis window which is short in time on the time-frequency resolution. Specifically, smaller windows have good time resolutions but poor frequency resolutions.

Figure 3.8 from the tutorial.

../_images/sphx_glr_plot_3_1_4_atoms_short_hamming_stft_001.png
import numpy as np
import matplotlib.pyplot as plt
from tftb.generators import atoms
from scipy.signal import hamming
from tftb.processing.linear import ShortTimeFourierTransform

coords = np.array([[45, .25, 32, 1], [85, .25, 32, 1]])
sig = atoms(128, coords)
x = np.real(sig)
window = hamming(17)
stft = ShortTimeFourierTransform(sig, n_fbins=128, fwindow=window)
stft.run()
stft.plot(show_tf=True, cmap=plt.cm.gray)

Total running time of the script: ( 0 minutes 0.369 seconds)

Gallery generated by Sphinx-Gallery