plenoptic.process.rectangular_to_polar_dict#

plenoptic.process.rectangular_to_polar_dict(coeff_dict, residuals=False)[source]#

Return the complex amplitude and the phase of each complex tensor in a dictionary.

Keys are preserved, with the option of dropping "residual_lowpass" and "residual_highpass" by setting residuals=False.

Parameters:
  • coeff_dict (dict) – A dictionary containing complex tensors.

  • residuals (bool (default: False)) – An option to include residuals in the returned energy dict.

Return type:

tuple[dict, dict]

Returns:

  • energy – The dictionary of torch.Tensor containing the local complex amplitude of coeff_dict.

  • state – The dictionary of torch.Tensor containing the local phase of coeff_dict.

See also

rectangular_to_polar

Same operation on tensors.

polar_to_rectangular_dict

The inverse operation.

local_gain_control_dict

The analogous function for real-valued signals.

Examples

>>> import plenoptic as po
>>> img = po.data.einstein()
>>> spyr = po.process.SteerablePyramidFreq(
...     img.shape[-2:], is_complex=True, height=3
... )
>>> coeffs = spyr(img)
>>> energy, state = po.process.rectangular_to_polar_dict(coeffs)
>>> po.plot.pyrshow(energy)
<PyrFigure size ...>
>>> po.plot.pyrshow(state)
<PyrFigure size ...>
../../_images/plenoptic-process-rectangular_to_polar_dict-1_00.png

Fig. 11 (png, hires.png, pdf)#

../../_images/plenoptic-process-rectangular_to_polar_dict-1_01.png

Fig. 12 (png, hires.png, pdf)#