Skip to content

Commit

Permalink
Add the STFT class from pytftb
Browse files Browse the repository at this point in the history
  • Loading branch information
jaidevd committed Jun 18, 2015
1 parent 043e083 commit de852db
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
5 changes: 3 additions & 2 deletions docs/source/tutorials/introduction.rst
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,10 @@ time and frequency characteristics. Consider the signal obtained as follows::
>>> import matplotlib.pyplot as plt
>>> from tftb.generators import fmconst
>>> n_points = 128
>>> mode1, iflaw1 = fmconst(n_points, fnorm=0.2)
>>> mode2, iflaw2 = fmconst(n_points, fnorm=0.4)
>>> mode1, iflaw1 = fmconst(n_points, fnorm=0.1)
>>> mode2, iflaw2 = fmconst(n_points, fnorm=0.3)
>>> signal = np.r_[mode1, mode2]
>>> plt.plot(np.real(signal)), plt.grid(), plt.show()

.. plot:: tutorials/plots/intro_1.py
.. plot:: tutorials/plots/intro_2.py
11 changes: 11 additions & 0 deletions docs/source/tutorials/plots/intro_2.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import numpy as np
from tftb.generators import fmconst
from tftb.processing import ShortTimeFourierTransform
n_points = 128
mode1, iflaw1 = fmconst(n_points, fnorm=0.1)
mode2, iflaw2 = fmconst(n_points, fnorm=0.3)
signal = np.r_[mode1, mode2]

stft = ShortTimeFourierTransform(signal)
stft.run()
stft.plot()

0 comments on commit de852db

Please sign in to comment.