Skip to content

Commit

Permalink
Merge pull request #133 from jaidevd/jd-doc-nonstat
Browse files Browse the repository at this point in the history
Add documentation / tutorials for nonstationary signals
  • Loading branch information
jaidevd committed Apr 1, 2016
2 parents 2675879 + 320648a commit cad7874
Show file tree
Hide file tree
Showing 17 changed files with 512 additions and 309 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ coverage.xml

# Sphinx documentation
doc/_build/
doc/apiref/*.rst

# PyBuilder
target/
Expand Down
7 changes: 0 additions & 7 deletions doc/apiref/modules.rst

This file was deleted.

69 changes: 0 additions & 69 deletions doc/apiref/tftb.generators.rst

This file was deleted.

62 changes: 0 additions & 62 deletions doc/apiref/tftb.generators.tests.rst

This file was deleted.

102 changes: 0 additions & 102 deletions doc/apiref/tftb.processing.rst

This file was deleted.

31 changes: 0 additions & 31 deletions doc/apiref/tftb.rst

This file was deleted.

30 changes: 0 additions & 30 deletions doc/apiref/tftb.tests.rst

This file was deleted.

1 change: 1 addition & 0 deletions doc/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ Contents:
:maxdepth: 2

introduction
nonstationary_signals
auto_gallery
api

Expand Down
10 changes: 10 additions & 0 deletions doc/misc_plots/nonstationary_phase_plot.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
from tftb.generators import fmlin, amgauss
import numpy as np
import matplotlib.pyplot as plt

y_nonstat, _ = fmlin(2048) # Already analytic, no need of Hilbert transorm
y_nonstat *= amgauss(2048)
plt.plot(np.real(y_nonstat), np.imag(y_nonstat))
plt.xlabel("Real part")
plt.ylabel("Imaginary part")
plt.show()
17 changes: 17 additions & 0 deletions doc/misc_plots/stationary_phase_plot.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import numpy as np
import matplotlib.pyplot as plt
from scipy.signal import hilbert

fs = 32768
ts = np.linspace(0, 1, fs)
y1 = np.sin(2 * np.pi * 697 * ts)
y2 = np.sin(2 * np.pi * 1336 * ts)
y = (y1 + y2) / 2


y = y[:(fs / 16)]
y_analytic = hilbert(y)
plt.plot(np.real(y_analytic), np.imag(y_analytic))
plt.xlabel("Real part")
plt.ylabel("Imaginary part")
plt.show()
25 changes: 25 additions & 0 deletions doc/misc_plots/touchtone.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#! /usr/bin/env python
# -*- coding: utf-8 -*-
# vim:fenc=utf-8
#
# Cube26 product code
#
# (C) Copyright 2015 Cube26 Software Pvt Ltd
# All right reserved.
#
# This file is confidential and NOT open source. Do not distribute.
#

"""
"""
import numpy as np
import matplotlib.pyplot as plt
fs = 32768
ts = np.linspace(0, 1, fs)
y1 = np.sin(2 * np.pi * 697 * ts)
y2 = np.sin(2 * np.pi * 1336 * ts)
y = (y1 + y2) / 2
plt.plot(ts, y)
plt.xlim(0, 0.1)
plt.show()
Loading

0 comments on commit cad7874

Please sign in to comment.