# Undersampling with inverted spectrum

Started by January 18, 2016
```Hi,

I undersample signal of bandwidth BW that is completely in second Nyquist
zone. It ends up folded to some frequency between 0 and new fs/2.  This
spectrum is inverted. If I now downconvert this signal to baseband by
multiplying it with complex sine, I can obtain "right" spectrum by
swapping I and Q axes afterwards.

However, I would like to downconvert this signal by multiplying with real
sine and not all the way to baseband but to BW/2 (so that it goes from 0
to BW-bandwidth). How can I invert the spectrum of real downconverted
signal?

Thank you all.

---------------------------------------
Posted through http://www.DSPRelated.com
```
```On 18.01.2016 12:31, b2508 wrote:
> Hi,
>
> I undersample signal of bandwidth BW that is completely in second Nyquist
> zone. It ends up folded to some frequency between 0 and new fs/2.  This
> spectrum is inverted. If I now downconvert this signal to baseband by
> multiplying it with complex sine, I can obtain "right" spectrum by
> swapping I and Q axes afterwards.
>
> However, I would like to downconvert this signal by multiplying with real
> sine and not all the way to baseband but to BW/2 (so that it goes from 0
> to BW-bandwidth). How can I invert the spectrum of real downconverted
> signal?
>
> Thank you all.
>
>
> ---------------------------------------
> Posted through http://www.DSPRelated.com
>

Hi.

First, a sideways but closely related issue is that once you sample the
signal with an ADC, the output of the ADC is real. Which means that
besides the spectrum of the signal you wish to obtain, you also get its
mirror image in the region of negative frequences. Usually that mirror
image is unwanted and is filtered out at some point.

Now back to your question. I assume (perhaps I am wrong) that the
spectrum of your signal is relatively narrowband, i.e. BW << fs/2,
that's why you may want to downconvert it after sampling.

The problem is that once you downconvert the signal it might be hard to
invert its spectrum _within its bandwidth BW_.

So, perhaps the right sequence in your case would be to:

(1) (Under)sample the signal,
(2) Invert the spectrum of the resulting real signal [*],
(3) Downconvert the signal,
(4) Suppress the unwanted image by filtering.

[*] Now I will explain the step (2). Inverting the spectrum of a real
signal can be done by multiplying the signal by a sequence of
alternating ones and minus ones: {+1, -1, +1, -1 ...} which is just
exp(j*pi*n) for integer n's. This topic is treated in more detail e.g.
in "Understanding Digital Signal Processing" by Lyons.

Also I recommend that book for its general treatment of complex
downconversion. There's more usable knowledge in it than could be
squeezed into an Usenet post.

Regards,
Evgeny.

```
```On Mon, 18 Jan 2016 03:31:46 -0600, "b2508" <108118@DSPRelated> wrote:

>Hi,
>
>I undersample signal of bandwidth BW that is completely in second Nyquist
>zone. It ends up folded to some frequency between 0 and new fs/2.  This
>spectrum is inverted. If I now downconvert this signal to baseband by
>multiplying it with complex sine, I can obtain "right" spectrum by
>swapping I and Q axes afterwards.
>
>However, I would like to downconvert this signal by multiplying with real
>sine and not all the way to baseband but to BW/2 (so that it goes from 0
>to BW-bandwidth). How can I invert the spectrum of real downconverted
>signal?
>
>Thank you all.

This article may be useful to you, as it does cover how spectral
inversion happens with a real-valued mixer.

http://www.dsprelated.com/showarticle/51.php

Also, for real-valued signals there is always a mirror image of the
positive frequencies on the negative-frequency side of the spectral
plane.   Once you've done your real-valued conversion, if the spectrum
is not alread inverted where you want it, you can use a complex-valued
mix to move the negative-frequency spectrum to baseband rather than
the positive-frequency version, and it will be inverted relative to
the positive-frequency spectrum.

If you're careful with the real-valued mixing, the low-side of the
mixed product spectrum is always inverted, as is described in the

Eric Jacobsen
Anchor Hill Communications
http://www.anchorhill.com
```
```"b2508" <108118@DSPRelated> Wrote in message:
> Hi,
>
> I undersample signal of bandwidth BW that is completely in second Nyquist
> zone. It ends up folded to some frequency between 0 and new fs/2.  This
> spectrum is inverted. If I now downconvert this signal to baseband by
> multiplying it with complex sine, I can obtain "right" spectrum by
> swapping I and Q axes afterwards.
>
> However, I would like to downconvert this signal by multiplying with real
> sine and not all the way to baseband but to BW/2 (so that it goes from 0
> to BW-bandwidth). How can I invert the spectrum of real downconverted
> signal?
>
> Thank you all.
>
>
> ---------------------------------------
> Posted through http://www.DSPRelated.com
>

First, be ready to play with the math. You'll get a lot farther of
you understand what you're doing.

Second, if you want to translate a signal at f1 down to f2,
mixing
by sin (f1-f2) will do it with no spectral reversal, while mixing
by sin (f1+f2) will mix it down with spectral reversal. Do check
my math on that.
--
www.wescottdesign.com

http://usenet.sinaapp.com/
```
```>Second, if you want to translate a signal at f1 down to f2,
mixing
> by sin (f1-f2) will do it with no spectral reversal, while mixing
> by sin (f1+f2) will mix it down with spectral reversal. Do check
> my math on that.
>--
>www.wescottdesign.com
>

if (f1+f2) > folds back there will be inversion. However given real signal
this mixing will also move both signal and its mirror image and is not
what original post wanted.

Kaz

---------------------------------------
Posted through http://www.DSPRelated.com
```
```On Mon, 18 Jan 2016 10:57:46 -0800 (PST), Tim Wescott
<Tim@seemywebsite.com> wrote:

>"b2508" <108118@DSPRelated> Wrote in message:
>> Hi,
>>
>> I undersample signal of bandwidth BW that is completely in second Nyquist
>> zone. It ends up folded to some frequency between 0 and new fs/2.  This
>> spectrum is inverted. If I now downconvert this signal to baseband by
>> multiplying it with complex sine, I can obtain "right" spectrum by
>> swapping I and Q axes afterwards.
>>
>> However, I would like to downconvert this signal by multiplying with real
>> sine and not all the way to baseband but to BW/2 (so that it goes from 0
>> to BW-bandwidth). How can I invert the spectrum of real downconverted
>> signal?
>>
>> Thank you all.
>>
>>
>> ---------------------------------------
>> Posted through http://www.DSPRelated.com
>>
>
>
>First, be ready to play with the math. You'll get a lot farther of
> you understand what you're doing.
>
>Second, if you want to translate a signal at f1 down to f2,
mixing
> by sin (f1-f2) will do it with no spectral reversal, while mixing
> by sin (f1+f2) will mix it down with spectral reversal. Do check
> my math on that.

It's the other way around if the LO freq is greater than the signal
freq.  The difference inverts, the sum does not.   You can sort that
out intuitively by looking at where the band edges will land, i.e.,
f1+BW/2 and f1-BW/2.   If the LO is > f1, then LO-(f1+BW/2) is a
smaller number (resulting freq) than LO+(f1-BW/2).

If the LO is less than f1, it doesn't invert.   I didn't mention that
case, although I probably should have.   Actually, it does invert to
the negative frequency side, but the image on the positive frequency
side is not inverted.     ;)

>--
>www.wescottdesign.com
>
>
>http://usenet.sinaapp.com/

Eric Jacobsen
Anchor Hill Communications
http://www.anchorhill.com
```
```On 18.01.2016 23:54, kaz wrote:
>> Second, if you want to translate a signal at f1 down to f2,
> mixing
>> by sin (f1-f2) will do it with no spectral reversal, while mixing
>> by sin (f1+f2) will mix it down with spectral reversal. Do check
>> my math on that.
>> --
>> www.wescottdesign.com
>>
>
> if (f1+f2) > folds back there will be inversion. However given real signal
> this mixing will also move both signal and its mirror image and is not
> what original post wanted.
>
> Kaz
>
> ---------------------------------------
> Posted through http://www.DSPRelated.com
>

The idea is that instead of two separate operations -- mixing and
spectrum inversion -- the same end result could be accomplished with a
single mixing operation.

Regards,
Evgeny.

```
```On 18.01.2016 23:54, kaz wrote:
>> Second, if you want to translate a signal at f1 down to f2,
> mixing
>> by sin (f1-f2) will do it with no spectral reversal, while mixing
>> by sin (f1+f2) will mix it down with spectral reversal. Do check
>> my math on that.
>> --
>> www.wescottdesign.com
>>
>
> if (f1+f2) > folds back there will be inversion. However given real signal
> this mixing will also move both signal and its mirror image and is not
> what original post wanted.
>
> Kaz
>
> ---------------------------------------
> Posted through http://www.DSPRelated.com
>

Like, spectral inversion is multiplication by cos(pi*n), whereas (real)
mixing is multiplying by sin((f/fs)*2pi*n), for integer values of n.

Doing spectral inversion and mixing is equivalent to a single mixing
operation, where you multiply samples of the signal by

sin(pi*n + (f/fs)*2pi*n) = cos(pi*n) * sin((f/fs)*2pi*n)

for integer values of n.

Regards,
Evgeny.

```
```>On 18.01.2016 12:31, b2508 wrote:
>> Hi,
>>
>> I undersample signal of bandwidth BW that is completely in second
Nyquist
>> zone. It ends up folded to some frequency between 0 and new fs/2.
This
>> spectrum is inverted. If I now downconvert this signal to baseband by
>> multiplying it with complex sine, I can obtain "right" spectrum by
>> swapping I and Q axes afterwards.
>>
>> However, I would like to downconvert this signal by multiplying with
real
>> sine and not all the way to baseband but to BW/2 (so that it goes from
0
>> to BW-bandwidth). How can I invert the spectrum of real downconverted
>> signal?
>>
>> Thank you all.
>>
>>
>> ---------------------------------------
>> Posted through http://www.DSPRelated.com
>>
>
>Hi.
>
>First, a sideways but closely related issue is that once you sample the
>signal with an ADC, the output of the ADC is real. Which means that
>besides the spectrum of the signal you wish to obtain, you also get its
>mirror image in the region of negative frequences. Usually that mirror
>image is unwanted and is filtered out at some point.
>
>Now back to your question. I assume (perhaps I am wrong) that the
>spectrum of your signal is relatively narrowband, i.e. BW << fs/2,
>that's why you may want to downconvert it after sampling.
>
>The problem is that once you downconvert the signal it might be hard to
>invert its spectrum _within its bandwidth BW_.
>
>So, perhaps the right sequence in your case would be to:
>
>(1) (Under)sample the signal,
>(2) Invert the spectrum of the resulting real signal [*],
>(3) Downconvert the signal,
>(4) Suppress the unwanted image by filtering.
>
>[*] Now I will explain the step (2). Inverting the spectrum of a real
>signal can be done by multiplying the signal by a sequence of
>alternating ones and minus ones: {+1, -1, +1, -1 ...} which is just
>exp(j*pi*n) for integer n's. This topic is treated in more detail e.g.
>in "Understanding Digital Signal Processing" by Lyons.
>
>Also I recommend that book for its general treatment of complex
>downconversion. There's more usable knowledge in it than could be
>squeezed into an Usenet post.
>
>Regards,
>Evgeny.

Thank you very much, I think this will be very helpful.
However, I do not neccessarily have BW << fs/2, sometimes BW is quite
close to fs/2 (takes almost 80% of the fs/2). I suppose downconversion
would not make sense in that case?
How can I know if I have set of available bandwidths, for which of those I
can downconvert and "how much" meaning how much can I move signal towards
0 Hz?
I notice if my spectrum was between 0 and fs/4 and I do this real
inversion, it moves to the range between fs/4 and fs/2. This seems to make
it impossible to move signal to center frequency of BW/2, am I right?

---------------------------------------
Posted through http://www.DSPRelated.com
```
```On 19.1.16 16:00, b2508 wrote:
>> On 18.01.2016 12:31, b2508 wrote:
>>> Hi,
>>>
>>> I undersample signal of bandwidth BW that is completely in second
> Nyquist
>>> zone. It ends up folded to some frequency between 0 and new fs/2.
> This
>>> spectrum is inverted. If I now downconvert this signal to baseband by
>>> multiplying it with complex sine, I can obtain "right" spectrum by
>>> swapping I and Q axes afterwards.
>>>
>>> However, I would like to downconvert this signal by multiplying with
> real
>>> sine and not all the way to baseband but to BW/2 (so that it goes from
> 0
>>> to BW-bandwidth). How can I invert the spectrum of real downconverted
>>> signal?
>>>
>>> Thank you all.
>>>
>>>
>>> ---------------------------------------
>>> Posted through http://www.DSPRelated.com
>>>
>>
>> Hi.
>>
>> First, a sideways but closely related issue is that once you sample the
>> signal with an ADC, the output of the ADC is real. Which means that
>> besides the spectrum of the signal you wish to obtain, you also get its
>> mirror image in the region of negative frequences. Usually that mirror
>> image is unwanted and is filtered out at some point.
>>
>> Now back to your question. I assume (perhaps I am wrong) that the
>> spectrum of your signal is relatively narrowband, i.e. BW << fs/2,
>> that's why you may want to downconvert it after sampling.
>>
>> The problem is that once you downconvert the signal it might be hard to
>> invert its spectrum _within its bandwidth BW_.
>>
>> So, perhaps the right sequence in your case would be to:
>>
>> (1) (Under)sample the signal,
>> (2) Invert the spectrum of the resulting real signal [*],
>> (3) Downconvert the signal,
>> (4) Suppress the unwanted image by filtering.
>>
>> [*] Now I will explain the step (2). Inverting the spectrum of a real
>> signal can be done by multiplying the signal by a sequence of
>> alternating ones and minus ones: {+1, -1, +1, -1 ...} which is just
>> exp(j*pi*n) for integer n's. This topic is treated in more detail e.g.
>> in "Understanding Digital Signal Processing" by Lyons.
>>
>> Also I recommend that book for its general treatment of complex
>> downconversion. There's more usable knowledge in it than could be
>> squeezed into an Usenet post.
>>
>> Regards,
>> Evgeny.
>
> Thank you very much, I think this will be very helpful.
> However, I do not neccessarily have BW << fs/2, sometimes BW is quite
> close to fs/2 (takes almost 80% of the fs/2). I suppose downconversion
> would not make sense in that case?
> How can I know if I have set of available bandwidths, for which of those I
> can downconvert and "how much" meaning how much can I move signal towards
> 0 Hz?
> I notice if my spectrum was between 0 and fs/4 and I do this real
> inversion, it moves to the range between fs/4 and fs/2. This seems to make
> it impossible to move signal to center frequency of BW/2, am I right?

Do you have a strict pre-sampling filter passing only the intended range
(fs/2 to fs, or maybe 3fs/2 to 2fs)?

--

-TV

```