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 settingresiduals=False.- Parameters:
- Return type:
- Returns:
energy – The dictionary of
torch.Tensorcontaining the local complex amplitude ofcoeff_dict.state – The dictionary of
torch.Tensorcontaining the local phase ofcoeff_dict.
See also
rectangular_to_polarSame operation on tensors.
polar_to_rectangular_dictThe inverse operation.
local_gain_control_dictThe 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 ...>