Hough-Wigner Transform of Two Simultaneous ChirpsΒΆ

Compute the Hough transform of the Wigner-Ville distribution of a signal composed of two chirps. Two peaks corresponding to the two chirps can be seen.

Figure 5.6 from the tutorial.

plot 5 4 2 hough simultaneous chirp
/home/docs/checkouts/readthedocs.org/user_builds/tftb/checkouts/stable/doc/_gallery/plot_5_4_2_hough_simultaneous_chirp.py:34: MatplotlibDeprecationWarning: Calling gca() with keyword arguments was deprecated in Matplotlib 3.4. Starting two minor releases later, gca() will take no keyword arguments. The gca() function should only be used to get the current axes, or if no axes exist, create new axes with default keyword arguments. To create a new axes with non-default arguments, use plt.axes() or plt.subplot().
  ax = fig.gca(projection='3d')

from tftb.generators import fmlin, sigmerge
from tftb.processing.cohen import WignerVilleDistribution
from tftb.processing.postprocessing import hough_transform
import numpy as np
from mpl_toolkits.mplot3d import Axes3D
import matplotlib.pyplot as plt

N = 64
sig = sigmerge(fmlin(N, 0, 0.4)[0], fmlin(N, 0.3, 0.5)[0], 1)
tfr, _, _ = WignerVilleDistribution(sig).run()

ht, rho, theta = hough_transform(tfr, N, N)
theta, rho = np.meshgrid(theta, rho)
fig = plt.figure()
ax = fig.gca(projection='3d')
ax.plot_wireframe(theta, rho, ht)
ax.set_xlabel('Theta')
ax.set_ylabel('Rho')
plt.show()

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

Gallery generated by Sphinx-Gallery