plenoptic.process.modulate_phase#

plenoptic.process.modulate_phase(x, phase_factor=2.0)[source]#

Modulate the phase of a complex signal.

Doubling the phase of a complex signal allows you to, for example, take the correlation between steerable pyramid coefficients at two adjacent spatial scales.

Parameters:
  • x (Tensor) – Complex tensor whose phase will be modulated.

  • phase_factor (float (default: 2.0)) – Multiplicative factor to change phase by.

Return type:

Tensor

Returns:

x_mod – Phase-modulated complex tensor.

Raises:

TypeError – If x is not complex-valued.

Examples

>>> import plenoptic as po
>>> import torch
>>> img = po.data.einstein()
>>> spyr = po.process.SteerablePyramidFreq(img.shape[-2:], is_complex=True)
>>> # let's only look at 1 scale and 1 orientation
>>> coeff = spyr(img)[3][:, :, 0]
>>> mod_coeff = po.process.modulate_phase(coeff, 2)
>>> po.plot.imshow([coeff, mod_coeff], title=["original", "modulated"], zoom=8)
<PyrFigure ...>

(png, hires.png, pdf)

../../_images/plenoptic-process-modulate_phase-1.png

Note how the white and black streaks have changed between original and modulated.