# Fast/efficient way to turn real passband samples to complex baseband

I have real-valued samples of a bpsk signal i am receiving (see frequency spectrum in figure A), that I want to turn into complex samples for further processing.

However when I just use the received signal as the real part of my complex symbols, I get a mirrored version of the original (like in figure B) with two times the bandwidth of A. By shifting the signal to baseband, and then downsampling it to half the samplerate I get something like in figure C.

Question: Is there a more efficient way to get directly, i.e. in one step from A to C? • I have real samples of a bpsk signal do you mean real-valued or real-world? Is the figure A the spectrum of the received BPSK signal? Or the signal itself?
– Peter K.
Jul 8 '16 at 21:13
• real-valued, like from a sound card, not I-Q samples. The figures are the frequency spectrums. I changed the question, to clearify that. Jul 8 '16 at 21:18
• OK... then there is no difference between A and B. A will have the spectrum reflected in the negative frequencies too. Or do you mean you have a complex signal (which has spectrum A) but you are only collecting the real part?
– Peter K.
Jul 8 '16 at 21:23
• Well, there was a complex signal at the transmitter, but i am only receiving real valued samples, as my receiver is a soundcard. Jul 8 '16 at 21:30
• taffer, there aren't really imaginary quantities that we measure at the transmitter. you have real samples, that means both positive and negative frequencies. you can bump down the positive bandpass portion of your spectrum by multiplying be $e^{-j 2 \pi f_0 t}$ and then you need to get rid of the effect of the negative frequency components (that are bumped to the negative direction even further) with a LPF in both the real and imaginary portion of your complex baseband. then you're done. Dec 16 '16 at 5:50

In the particular case of BPSK transmitted over wireline, there is no quadrature component, so the equivalent low-pass representation (the complex envelope) is real. You can get the complex envelope simply by downcoverting the signal from the carrier frequency down to DC.

For general baseband signals, or over the wireless channel, the process can be outlined as follows:

1. Find the analytic signal. Say the passband signal is $r(t)$. Then, $r_+(t)=r(t)+j\hat{r}(t)$ has no negative frequencies ($\hat{r}(t)$ is the Hilbert transform of $r(t)$).

2. Downcovert $r_+(t)$. The signal $x(t)=r_+(t)e^{-j2\pi f_c t}$ is the complex envelope.

Note that implementing this algorithm is not necessarily trivial. In practice, you almost always want to downconvert $r(t)$ to some intermediate frequency before attempting the Hilbert transform.

An alternative procedure is as follows:

1. Center the positive part of the spectrum around DC, by calculating $y(t)=r(t)e^{-j2\pi f_c t}$. Note that the resulting signal is complex even in the BPSK case.

2. Get rid of the negative part of the spectrum by low-pass filtering $y(t)$.

The downside of the second procedure is that it doubles the maximum frequency of the signal. Mathematically both procedures are identical (up to a constant amplitude factor).

• I think there is a slight difference: the signal obtained by the second method has half the energy than that of the first.
– vaz
Jul 10 '16 at 10:38
• There is no way to do it in one step? Jul 10 '16 at 11:24

Even though generally, I would agree with MBaz, I read an interesting blog post by Rick Lyons the other day that applies directly to this question. It is in fact possible to do what you want as long as you are willing to increase the number of coefficients of your filter significantly (i.e., the memory requirement is much larger) and to dynamically alter the coefficients of your filter while processing (i.e., the trickiness of implementation is larger and no out-of-the-box software packages for this).

To summarize the idea in my own words. You basically want to demodulate your tap delay line while filtering. To accomplish this, you can use multiple coefficient sets, each based on the same prototype filter but with a different modulation applied. Then after each output sample computation you rotate the coefficients that you are using. In doing this, the downconversion to baseband occurs while filtering out the high frequency components.

The one constraint noted in the blog post is that the ratio of the sampling frequency to the carrier frequency needs to be an integer. I want to reiterate that the solutions explained by MBaz are the ones I have used for my own modem designs in the past. They are much simpler to implement and require far less memory. Still, I'll probably experiment with the idea from the blog post some day, just because it is interesting. In this case, it allows me to answer yes to your question. It is possible to do it in one step.