Dear Roee,

I'd like to illustrate a bit how the USRP generates spectrum from the
signal you provide

1. get baseband samples from host with $f_\text{sample}$
2. upsample to $f_\text{master clock rate}$, suppressing aliases
3. shift digitally in frequency by multiplication with a complex
sinusoid $f_\text{offset}$: $y[n] = x[n] \cdot e^{n\,2\pi
\frac{f_\text{offset}}{f_\text{master clock rate}}}$
4. Digital-to-analog convert
(5. on daughterboard, mix with local oscillator generated by the
daughterboard.)

On Basic and LF, 5. doesn't happen -- these daughterboards don't have an
LO or a mixer. Hence, all the carrier frequency "mixing" happens in the
FPGA in step 3.

Your 26.5MHz sine happens in 2.:
Upsampling from $f_\text{sample}=\SI{25}{\mega\hertz}$ to
$f_\text{master clock rate}=\SI{100}{\mega\hertz}$ simply is padding the
incoming complex sample stream with three zeros after each sample
(resulting in (1+3) * 25 = 100 MHz rate); the result is very similar to
what you know as imaging from Digital-to-Analog-conversion:
$\frac{1}{4}$ of the spectrum represented at $f_\text{master clock
rate}$ is the original spectrum, the rest is images of it. Since we
don't want these images, we need to suppress them with a low pass
filter, ideally with a cut-off frequency exactly at the $\frac{1}{4}$ of
the output rate, infinite suppression above that frequency, and a
perfectly ripple-free, constant gain below.

Now, real-world filters that behave like that don't exist. Instead, the
USRP uses a cascade of three interpolators including anti-imaging
filters that are used/disabled as required by the upsampling factor,
which are concatenated in the following order:

 1. one large half band FIR interpolator (first factor of 2)
 2. one smaller half band FIR interpolator (second factor of 2)
 3. a CIC (cascaded integrator comb), which is a flexible
    filter/interpolator that has a FIR-like frequency response, but due
    to its adjustable IIR interpolation allows for nearly arbitrary factors

Since we're interpolating by 4, the CIC is disabled.
Filter 1 has the "best" (read: sharpest and flattest) frequency
response, and 2. is not so much worse [1].

For the first halfband interpolator, which interpolates from 25 to 50
MHz, the 11 MHz tone and its image are $\pm 0.06$ of
$\frac{f_\text{sample,higher side}}{2}$, for the second, it's only 0.03.
I hence take the freedom to claim that regarding that tone, the
difference of magnitude response for the second filter is insignificant
(it being "flatter" in that region, and the frequency distance being
half as large).

Now, roughly read from [1], the "passband-side" suppression of your tone
is -1.5dB, and the stopband side is approximately -18dB, leaving us with
a magnitude suppression of -16.5dB, which is pretty close to your
observed spectrum (-17.2dB). The remainder might just be measurement
error or the slight frequency selectivity of the analog components on
the LFTX.

Hope that explains this reasonably well!

As a recommendation: Don't try to work too close to your Nyquist band
edge. If necessary/applicable, just use the digital frequency shifter
(step 3. from my TX chain description above) to get your desired
frequency closer to what you want to see alias-free.

Best regards,
Marcus

[1] Ian Buckley's plots:
http://witestlab.poly.edu/~ffund/el9043/labs/images/lab2-filters.png
(which he made for the RX chain, but at least for the first halfband, I
know that the filter coefficients should be identical, and hence, the
response should be the same, too. I think the same applies for the small
half band filter.)


On 29.02.2016 22:31, Roee Bar wrote:
> I am observing aliasing on the spectrum analyzer in the following
> simple transmission scenario:
> sampling freq=25M, carrier freq=12.5MHz, and a sine wave freq=-11MHz
> at baseband.
> I use the following command:
>> uhd_siggen -s 25e6 -f 12.5e6 --sine -x -11e6
>
> I expect to see a delta at freq=1.5MHz, but there is another one
> freq=26.5MHz (see attached jpeg).
>
> It occurs on LFTX or BasicTX doughterboards. When I move the sine wave
> from -11MHz toward zero, the aliasing gradually disappears. It appears
> again when moving up toward +10MHz.
>
> Why does it happen? Can I avoid it?
>
> Thanks in advance.
>
>
>
>
>
> _______________________________________________
> Discuss-gnuradio mailing list
> Discuss-gnuradio@gnu.org
> https://lists.gnu.org/mailman/listinfo/discuss-gnuradio

_______________________________________________
Discuss-gnuradio mailing list
Discuss-gnuradio@gnu.org
https://lists.gnu.org/mailman/listinfo/discuss-gnuradio

Reply via email to