# Re: mirrored spectrum around tuning freq

**URL:** <https://www.ruby-forum.com/t/re-mirrored-spectrum-around-tuning-freq/242969>\
**Category:** GNU Radio\
**Created:** [August 11, 2015, 6:39pm UTC](https://www.ruby-forum.com/t/re-mirrored-spectrum-around-tuning-freq/242969 "2015-08-11T18:39:50Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sadaf\_N](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/858c86/32.png) [@Sadaf\_N](https://www.ruby-forum.com/u/Sadaf_N)\
**Post date:** [August 11, 2015, 6:39pm UTC](https://www.ruby-forum.com/t/re-mirrored-spectrum-around-tuning-freq/242969/1 "2015-08-11T18:39:50Z")

</div>

Hi Martin, Marcus,

I am using a N200 + WBX.  
Gain set on the USRP is equal to 5 dB.  
Changing the power of the input signal does not change anything.  
Moreover  
the output of the signal generator is sent (via a 2way power divider) to  
a  
spectrum analyzer and the input signal is ok.

I made some other test.  
I always have the two replica also with a LO different from zero.  
Anyway playing a bit with the LO value one of the two replica disappear  
probably because it goes outside the IF band.  
In any case I can’t understand why the replica is there (?).

Concerning IQ imbalance … how can I measure and compensate ? Using  
the  
calibration utility ?

ciao  
Luca

---

<div class="post-metadata">

**Author:** ![lucapette](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/58f4c7/32.png) [@lucapette](https://www.ruby-forum.com/u/lucapette)\
**Post date:** [August 11, 2015, 7:41pm UTC](https://www.ruby-forum.com/t/re-mirrored-spectrum-around-tuning-freq/242969/2 "2015-08-11T19:41:11Z")

</div>

Hi Luca,

just to get a feeling

> Changing the power of the input signal does not change anything.

In your received signal, there seem to be high-power peaks. How large is  
the digital signal amplitude during these?

Since the mirrored peak seems to be just a bit weaker, my suspicion  
still is too high input power.

> In any case I can’t understand why the replica is there (?).  
> /If, and only if/ my suspicion is correct the problem is the inherent  
> nature of semiconductor amplifiers, and the awesomeness that is math:

Your amplifier has the job of taking the input signal amplitude x and  
map it to the output y, effectively making it a function $y$  
mathematically

$y\_\text{ideal} = a x$,  
$a$ being the amplification.

In reality, $y$ is better represented as an exponential function.  
However, using the power of Taylor, and a bit of analysis, without loss  
of generality, we can represent that as a power series:

$y\_\text{real} = a\_0 x^0 + a\_1 x^1 + a\_2 x^2 + a\_3 x^3 + a\_4 x^4\dots$

Amplifier producers try to keep $a\_n, , n\>1$ as small as technically  
possible.

Obviously, we want all $a\_n$ to be as close to 0 as possible, but for  
$n= 1$, where it represents the linear amplification we want;  
$y\_\text{real}$ would then collapse into the function we want. Hence, we  
want to truncate the series after the 2nd element.

$a\_0$ usually isn’t as bad for RF signals, it’s “just” DC offset,  
something relatively easy to cancel (e.g. by capacitive coupling or  
other means of high-pass filtering).

Remember that I mentioned that we need to apply Taylor’s Theorem to the  
exponential, which develops the original function into a series /around  
a specific point/, ie. if we truncate the series for $n \> 1$, because we  
trust the manufacturer and want to use the amplifier just as it was  
/actually /(instead of /approximately/) linear, that’s only a valid  
thing to do if we don’t drive the amplifier with $x$ that are larger  
than what the manufacturer promised to amplify linearly; obviously, for  
sufficiently large $x$, $x^2$ and higher powers can get substantially  
bigger than $a\_1 x^1$, and then you see interesting behaviour. (you’ll  
notice that when looking at amplifier datasheets, their functions  
typically look a bit like a quadratic with negative coefficient for  
$x^2$ – that’s actually the case for semiconductors, usually).

Now, that will distort your ampitude, but you see _frequency_ magic.  
That’s only natural, however: If you look at this, $y$ contains a $x^2$  
term. Assume furthermore that $x=\cos(ft)$. Trigonometrics has it that  
$\cos^2(ft) = \frac 12 \left( 1+ \cos(2ft)\right)$  
so that’s where a component with twice the frequency comes into your  
$y$, additional to the “regular” amplified original signal, so we can  
say:  
$y(t) = \alpha \cos(ft) + \beta\cos(2ft) + \epsilon$,  
subsuming all the third order and above terms as well as DC in  
$\epsilon$.

Now, the signal with the “fake” 2f component gets fed into a mixer. A  
mixer is just an amplifier where the manufacturer did his best to keep  
all $a\_n$ small but $a\_2$, so to enable people to use the squaring to  
produce its output $z$; in our case, we get funky frequencies. Remember  
that $f$ is our input frequency, and let $f\_{LO}$ be our local  
oscillator, ie. the center frequency that becomes 0Hz in baseband:

$z(t) = \left(y(t) + \cos(f\_{LO} t) \right)^2 =\left(\alpha \cos(ft) +  
\beta\cos(2ft) + \cos(f\_{LO} t) \right)^2$

That formula is going to be fun to expand, calculate the powers of the  
trigonometric functions etc.  
However, the gist is that you’ll simply have to assume that now all  
frequencies mix with their multiple, so the result doesn’t only contain  
$f$, and $f-f\_{LO}$ (that being what we want to have in baseband!), but  
also $2f - f\_{LO}$ and $2f\_{LO}-2f$, which is possibly the mirror you’re  
seing in complex baseband.

Best regards,  
Marcus

---

<div class="post-metadata">

**Author:** ![lucapette](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/58f4c7/32.png) [@lucapette](https://www.ruby-forum.com/u/lucapette)\
**Post date:** [August 11, 2015, 11:26pm UTC](https://www.ruby-forum.com/t/re-mirrored-spectrum-around-tuning-freq/242969/3 "2015-08-11T23:26:43Z")

</div>

On 11.08.2015 09:38, Luca P. wrote:

> Concerning IQ imbalance … how can I measure and compensate ? Using  
> the calibration utility ?

Try running uhd\_cal\_rx\_iq\_balance and see if that helps.

Cheers,  
Martin
