# How do I convert a real baseband signal to a complex baseband signal?

I have radio telescope observations that have resulted in two real-valued signals (corresponding to the right- and left-handed circular polarizations).

The signals are sampled at rate $2B$, and provide a bandwidth of $B$.

I wish to get the full Stokes parameters from these signals, which requires me to convert these real signals into complex signals sampled at $B$ (half that of the real signals).

However, I don't know the procedure to do this. I just know that it is possible.

In general, how do I take a real-valued baseband signal and convert it to a complex-valued signal?

• I don't understand the problem. Why can't you do s_complex = s1_real + j*s2_real? – MBaz Aug 22 '17 at 23:09
• @Mbaz probably OP wants to get a Single Side Band representation of the given baseband real signals, hence reduce their sampling rate to B ? – Fat32 Aug 22 '17 at 23:13
• @Fat32 Could be, but I'm not a mind reader :D BTW, if you have an SSB signal that extends from 0 to $B$, the in-phase and quad components still need to be sampled at $2B$ real samples/sec. – MBaz Aug 22 '17 at 23:19
• @Mbaz Hopefully OP will clarify. OP could shift the SSB spectrum to the left, to fit in the $-B/2$ to $B/2$ band for the baseband complex signal to be sampled at $B$ ? I'm not sure about I , Q components though. – Fat32 Aug 22 '17 at 23:23
• @NikhilMahajan It is OK; we can try to figure things out. I think one way to clarify your question would be to add some math to it. It'd be useful if you could write down equations (or just some precise description, either in time and/or in frequency) for the signals, both what you have and what you want. – MBaz Aug 23 '17 at 0:11

To convert a real signal sampled at rate $2B$ to its complex baseband representation (sampled at rate $B$), you want to map the frequency content in the range $[0, B)$ in the real signal to the range $[-\frac{B}{2}, \frac{B}{2})$ in the resulting complex signal. This can be done in a couple different ways:

1. Design a linear filter to approximate a Hilbert transform. Run your real signal $r[n]$ through the filter to yield the transformed signal $\tilde{r}[n]$. Use this to form the analytic signal: $$r_a[n] = r[n] +j\tilde{r}[n]$$ $r_a[n]$ will contain only the positive frequency components of the original real signal $r[n]$; all of the negative frequencies will be zero (assuming a perfect Hilbert transformer; in practice, the effect will not be perfect). Thus, you have isolated the desired frequency band $[0, B)$.

Multiply $r_a[n]$ by $e^{-j\frac{\pi}{2}n}$ to effect a frequency shift of $-\frac{B}{2}$, shifting the desired frequency content to the range $[-\frac{B}{2}, \frac{B}{2})$. Then, decimate the signal by 2 by discarding every other sample. The result is a complex baseband signal sampled at rate $B$.

2. My preferred approach is a more straightforward implementation of the shift that you're looking for:

• Multiply $r[n]$ by $e^{-j\frac{\pi}{2}n}$ to effect a frequency shift of $-\frac{B}{2}$, shifting the desired frequency content to the range $[-\frac{B}{2}, \frac{B}{2})$. The result is a complex signal that is centered in the appropriate place (the center of the band is at zero frequency).
• Apply a lowpass filter to pass only the content in the range $[-\frac{B}{2}, \frac{B}{2})$ (to the extent required while meeting your application's antialiasing requirements).
• Decimate the signal by 2 by discarding every other sample. The result is a complex signal sampled at rate $B$.

In practice, I always use some variant of strategy #2. You can make it even more computationally efficient by implementing the decimation as part of the lowpass filtering process, for instance with a polyphase filter.

• I have some questions. Are these methods effectively equivalent to taking the Fourier Transform, setting the negative frequencies to zero and shifting the Fourier Domain to sit on $[-B/2,B/2)$? – XYZT Aug 23 '17 at 6:36
• Conceptually, it is similar, but in practice, you almost never want to just zero out the region of the spectrum that you don't want. If you don't have some transition band in the filter mask that you apply, it causes some nasty effects on the resulting signal in the time domain (e.g. excessive ringing due to the very sharp filter response). Direct spectral modification can be done, but it requires a more complicated transform than just a DFT (a suitable structure, for instance, would be a transmultiplexer). – Jason R Aug 23 '17 at 13:01
• Maybe nitpicking, but worth pointing out that the resulting complex signal is sampled at $B$ complex samples per second. IOW, you're still taking $2B$ real samples per second. – MBaz Aug 24 '17 at 0:38
• @MBaz Indeed. There is no data rate benefit to be had by using complex versus real format. However, in many applications, complex is just more convenient from a mathematical standpoint. – Jason R Aug 24 '17 at 0:47
• Oh, absolutely. I just felt that making explicit the difference between real and complex sampling might be useful to @NikhilMahajan. – MBaz Aug 24 '17 at 1:37