DSPRelated.com
Forums

Undersampling with inverted spectrum

Started by b2508 January 18, 2016
On 19.01.2016 17:00, b2508 wrote:

(snip)

> 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?
Sometimes you may need to accurately adjust frequency of a signal that occupies a large bandwidth. It's really application-dependent. In case BW occupies 80% of the fs/2 downconversion is not necessarily meaningless. And the entire discussion we had here still applies, but for a single detail. In that case shifting the signal by mixing it with a real sine would create an image occupying the spectral region of the useful signal. So you would do better if you multiply the signal by a complex exponent -- which does not produce images -- instead of a real sine. Perhaps care should be taken to leave a "guard region" between the signal and its image, but whether that is required depends on the application.
> 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?
There are pretty much no restrictions once you satisfy the conditions of the sampling theorem. However, if you intend to downconvert by mixing the signal with a real sine, you are limited to BWs strictly less than fs/4.
> 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?
You are not right and it's still possible. Regards, Evgeny.
On Tue, 19 Jan 2016 08:00:31 -0600, "b2508" <108118@DSPRelated> 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?
Whether it makes depends on what you're trying to do. What are you trying to ultimately do?
>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?
If you use a complex-valued mix you can move the spectrum anywhere you want with no worries about interference from mixing products. Is there a reason to not use a complex mix? It sounds like it would solve some of your problems.
>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?
It's not impossible and it depends on what you're trying to do. Eric Jacobsen Anchor Hill Communications http://www.anchorhill.com
On Mon, 18 Jan 2016 21:01:41 +0000, Eric Jacobsen wrote:

> 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 >>> >>> >>Quick answer, in two parts. >> >>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. ;)
That's why I told the OP to do the math -- I always have to sit down with pencil and paper to cypher that stuff out before I can be sure. -- www.wescottdesign.com
On Mon, 18 Jan 2016 21:01:41 +0000, Eric Jacobsen wrote:

> 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 >>> >>> >>Quick answer, in two parts. >> >>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. ;)
Wait. Signal frequency is f1, IF is f2, LO frequency is f1 + f2: cos(f1 + df) * cos(f1 + f2) = 1/2 * (cos((f1 + f2) - (f1 + df)) + cos((f1 + f2) + (f1 + df)) = 1/2 * (cos(f2 - df) + cos(2 * f1 + f2 + df)) So the image is centered around 2 * f1 + f2 (i.e, it's way high), and the desired IF has it's spectrum reversed (see the sign on df). Dangit, you made me do the math. -- www.wescottdesign.com
>On Tue, 19 Jan 2016 08:00:31 -0600, "b2508" <108118@DSPRelated> 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? > >Whether it makes depends on what you're trying to do. What are you >trying to ultimately do? > >>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? > >If you use a complex-valued mix you can move the spectrum anywhere you >want with no worries about interference from mixing products. Is >there a reason to not use a complex mix? It sounds like it would >solve some of your problems. > >>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? > >It's not impossible and it depends on what you're trying to do. > > >Eric Jacobsen >Anchor Hill Communications >http://www.anchorhill.com
I need to have/support both complex and real downconversion... --------------------------------------- Posted through http://www.DSPRelated.com
On 20.01.2016 11:27, b2508 wrote:

(snip)

> > I need to have/support both complex and real downconversion... > --------------------------------------- > Posted through http://www.DSPRelated.com >
I can think of two possible reasons to have both complex and real downconversion: 1) You are processing ADC output in software and wish to save CPU time when dealing with relatively narrow-bandwidth signals. 2) This is homework. Regards, Evgeny.
On 1/19/2016 9:00 AM, 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?
This bandwidth issue is a red herring. I have seen Graychip down converters do exactly this. The actual bandwidth of the signal is not important as long as it is within the bandwidth of the sampling technique. Your spectrum is not between 0 and fs/4. After the complex down-conversion it is complex and between -fs/4 and fs/4 or if you haven't done the complex down-conversion it is real and between fs/2 and fs. No need to do both conversions. Start with the real representation and convert it to where you want it. You need to multiply the signal by fs/2 which will, as you say, move the signal to the region between fs/2 and fs. However that is exactly what you want as the image of this signal will be frequency inverted again and lie between 0 and fs/2 restoring it to the original orientation. The images are always there at all multiples of fs/2 with every other one having an inverted spectrum. You can use them as you wish. -- Rick
>On 20.01.2016 11:27, b2508 wrote: > >(snip) > >> >> I need to have/support both complex and real downconversion... >> --------------------------------------- >> Posted through http://www.DSPRelated.com >> > >I can think of two possible reasons to have both complex and real >downconversion: > >1) You are processing ADC output in software and wish to save CPU time >when dealing with relatively narrow-bandwidth signals. > >2) This is homework. > >Regards, >Evgeny.
Not really :-) I am asked to provide both without knowing why :-) My intention is to do this in FPGA. --------------------------------------- Posted through http://www.DSPRelated.com
>On 1/19/2016 9:00 AM, b2508 wrote:
> >Your spectrum is not between 0 and fs/4. After the complex >down-conversion it is complex and between -fs/4 and fs/4 or if you >haven't done the complex down-conversion it is real and between fs/2 and
>fs. No need to do both conversions. Start with the real representation
>and convert it to where you want it. > >You need to multiply the signal by fs/2 which will, as you say, move the
>signal to the region between fs/2 and fs. However that is exactly what >you want as the image of this signal will be frequency inverted again >and lie between 0 and fs/2 restoring it to the original orientation. >The images are always there at all multiples of fs/2 with every other >one having an inverted spectrum. You can use them as you wish. > >-- > >Rick
I did not mean to do downconversion twice. I meant that when I do undersampling of real signal and it was initially in second Nyquist zone, it ends up between 0 and fs/4 or fs/4 and fs/2. After that I want to perform real downconversion and make spectrum oriented in the right way. --------------------------------------- Posted through http://www.DSPRelated.com
On 22.01.2016 13:04, b2508 wrote:

> Not really :-) I am asked to provide both without knowing why :-) > My intention is to do this in FPGA. > --------------------------------------- > Posted through http://www.DSPRelated.com >
Oops! I'm sorry then. Perhaps you could _imitate_ real conversion by (1) doing complex conversion then (2) doing low-pass filtering and (3) filtering out negative frequencies (which could involve a Hilbert transform filter), (4) then just leaving the real part of your output. Then you could pretend it's just a tricky implementation of real conversion for the case of signals with BW > fs/4. It's just a sketch of an idea. Hope it helps. Evgeny.