4
$\begingroup$

Most likely a very simple question, but I haven't been able to find a good answer.

When working with analytical signals in general, and software defined radio in particular, a common operation is to take the sum real(z) + imag(z). Is there a technical term for this sum?

$\endgroup$
  • 3
    $\begingroup$ Must admit haven't seen that used very often! $\endgroup$ – Marcus Müller Dec 21 '18 at 12:31
  • $\begingroup$ Google "weaver modulator" for one example... $\endgroup$ – Albin Stigo Dec 21 '18 at 12:33
  • $\begingroup$ ah, to generate single side band, makes sense. $\endgroup$ – Marcus Müller Dec 21 '18 at 12:43
  • $\begingroup$ Exactly, but what is a good name for it? Trying to come up with a name for a libvolk kernel. $\endgroup$ – Albin Stigo Dec 21 '18 at 13:14
  • $\begingroup$ If this is for a VOLK kernel name: the complex numbers for these are just real and imaginary part one after another, so your operation is effectively volk_32f_sum_pair_32f, I'd say :) $\endgroup$ – Marcus Müller Dec 21 '18 at 14:24
2
$\begingroup$

This can be implemented, without needing to access the real and imaginary parts of $z$ individually, by writing

$$\operatorname{Re}(z) + \operatorname{Im}(z) = \frac{(1 + i)(z^* - iz)}{2},$$

where $i$ is the imaginary unit and $z^*$ is complex conjugation.

Factoring out a complex constant, $\xi = 1/2 + i/2$, turns this into a slightly tidier expression,

$$\operatorname{Re}(z) + \operatorname{Im}(z) = \xi(z^* - iz).$$

These expression can be derived by applying the trigonometric identities

$$\cos(x) = \operatorname{Re}(e^{ix}) = \frac{{e^{ix} + e^{-ix}}}{2}$$ $$\sin(x) = \operatorname{Im}(e^{ix}) = \frac{{e^{ix} - e^{-ix}}}{2i}.$$

Perhaps this will give you some inspiration for choosing a good function name.

| improve this answer | |
$\endgroup$
1
$\begingroup$

There's no specific term, as far as I know, but it's a very common operation with quadrature mixing. It's the result of taking the real part of an analytic signal.

You have a complex baseband signal $x(t)$, you modulate it with a complex carrier resulting in an analytic band pass signal, and then you take the real part to obtain the real-valued band pass signal that can be transmitted over a channel:

$$\begin{align}x(t)&=x_R(t)+j\cdot x_I(t)&\textrm{complex baseband signal}\\ y(t)&=x(t)e^{j\omega_ct}&\textrm{analytic band pass signal}\\ s(t)&=\textrm{Re}\{y(t)\}&\textrm{real-valued band pass signal}\\&=x_R(t)\cos(\omega_ct)-x_I(t)\sin(\omega_ct)\end{align}$$

| improve this answer | |
$\endgroup$
  • $\begingroup$ Thanks Matt! Well this is what I'm doing... Just pondering what to name a SIMD optimized function I'm writing. $\endgroup$ – Albin Stigo Dec 21 '18 at 16:39
  • $\begingroup$ @AlbinStigo: Does the function just add real and imaginary parts, or does it also do the modulation? $\endgroup$ – Matt L. Dec 21 '18 at 16:44
  • $\begingroup$ result = real(z) + imag(z). For example f(2+5i)=7. $\endgroup$ – Albin Stigo Dec 21 '18 at 17:34
  • $\begingroup$ But $s(t)$ is neither the sum of the real and imaginary parts of $x(t)$ nor the sum of the real and imaginary parts of $e^{j\omega_ct}$ which sum would be $\cos \omega_ct + \sin\omega_ct$, The $s(t)$ you show is actually the dot product of $[x_r(t), x_i(t)]$ and $[\cos\omega_ct, -\sin\omega_ct]$. $\endgroup$ – Dilip Sarwate Dec 22 '18 at 5:21
  • $\begingroup$ @DilipSarwate: That's true, of course. But what appears to be the case is that the OP generates a complex signal $x_R(t)\cos(\omega_ct)-jx_I(t)\sin(\omega_ct)$, which, when adding its real and imaginary parts, results in the desired real-valued band pass signal. $\endgroup$ – Matt L. Dec 22 '18 at 13:18
1
$\begingroup$

This sounded as an odd concept to me, until I saw the recent Matlab code contest at MatlabCentral on this issue: Problem 2554. Sum the real and imaginary parts of a complex number (Last Solution submitted on May 12, 2020). On SE Maths, there is a question on Standard notation for sum of vector elements?.

So, complex numbers can be interpreted as vectors (but remember their algebraic structure is much richer). If a complex number $z=z_r+iz_i$ is written as $(z_r,z_i)$, and $\mathbb{I}=(1,1)$, then your sum writes $(z_r,z_i)\cdot\mathbb{I}^T =(z_r,z_i)^T\cdot\mathbb{I}$. The quantity can be translated into the complex scalar product, defined as:

$$ x.y = \frac{1}{2}(\overline{x}y+x\overline{y}).$$

Then, if $\mathbf{1}=1+i$ (an analog of $\mathbb{I}$), the sum of the real and imaginary parts is $z.\mathbf{1}=\mathbf{1}.z$. $\mathbf{1}=1+i$ is known as the smallest Gaussian integer being a prime number, or Gaussian prime. I don't know whether it has another name. Until then, you could call it ZdotI.

Finally, @Andy Walls was partly right in his answer: norms usually are non-negative, but some have defined signed measures. They are cumbersome to use, but if one wants a unique pedantic code, your can try ComplexSignedDistance to define this quantity. I have seen seldom cases of Signed L1 norm, but I would not recommend it.

| improve this answer | |
$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.