Gradient of Total Variation of Magnitude of Complex Function for Denoising Say I have a complex function $f^*$ (e.g. a MRI image) that has a near piece-wise constant magnitude, but a non constant phase.

If I have an optimization problem to find $f^*$ and set up an objective function with a total variation term (e.g. for denoising or compressed sensing) it usually has the following form:

$$  
obj_1(f) = \ldots + \text{TV}(f)
$$

However, since I assume that $f$ has a piece-wise constant magnitude, I think it might be better to use:

$$
  obj_2(f) = \ldots + \text{TV}(|f|)
$$

However, for a gradient based solver, one would have to know the gradient of obj2. The gradient for $obj_1(f)$ is: $\text{TV}'\left(TV(f)\right)$. What is the gradient of $obj_2(f)$?

Update:

Intuitively I would assume something like the following (since the phase has no influence on $obj_2$, leave the phase "untouched"):

$$
\text{TV}'\left(TV(|f|)\right)* e^{i \arg(f)}
$$

However, my knowledge in complex analysis is very limited and I am not sure if this makes sense.
The problem with $\left|f\right|$ is that since is not analytic the standard definition of complex derivative does not apply. A solution is to use Wirtinger derivatives:

http://en.wikipedia.org/wiki/Wirtinger_derivatives

A detailed account of Wirtinger calculus for signal processing problems is

http://arxiv.org/abs/0906.4835

Another (probably simpler) option is to treat the complex image as a two-channel (real,imag) image and use the definition of derivative for vector fields. This paper has a very clear explanation on how to do this:

Lee, H.-C.; Cok, D.R.; "Detecting boundaries in a vector field" (IEEE Transactions on Signal Processing, vol.39, no.5, pp.1181-1194, May 1991)