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:
- Return type:
- Returns:
x_mod – Phase-modulated complex tensor.
- Raises:
TypeError – If
xis 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 ...>
Note how the white and black streaks have changed between original and modulated.