I have $e^{jk}$ and I want to take a logarithm from it, $\log(e^{jk})$ must be $jk$, right?
here some example I have tried to do with matlab.
$$\log(e^{j2})=j2$$
$$\log(e^{j3})=j3$$
but for $e^{j4}$ it gives me: $\log(e^{j4})=-j2.2832$, why it doesn't give me $j4$
note: $\log$ is natural logarithm
1 Answer
$\begingroup$See here.
Since $e^{i\theta} = e^{i(\theta+2n\pi)}$ for any $n \in \mathbb{Z}$, it doesn't have a well-defined inverse. That is, to define 'the' complex logarithm we need to restrict the domain of $z \mapsto e^z$. There's no single 'correct' way of doing this, so it amounts to choosing a 'branch' of the logarithm.
In general, $$\log(z) = \log|z| + i\arg(z)$$ for some choice of range of $\arg(z)$. (For a given $z$, $\arg(z)$ is only well-defined up to adding some integer multiple of $2\pi$.)
Notice that $−2.283184\dots = 4 - 2\pi$.
The long and short of it is: $\log z$ might take many different values, depending on the choice of branch implicit in writing '$\log$'. Yours may differ from MATLAB's.
$\endgroup$