Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to reduce the center frequency spike? #84

Open
JSzut opened this issue Jun 14, 2018 · 9 comments
Open

How to reduce the center frequency spike? #84

JSzut opened this issue Jun 14, 2018 · 9 comments

Comments

@JSzut
Copy link

JSzut commented Jun 14, 2018

Is there a way to reduce the center frequency spike using the library itself?

@nocarryr
Copy link
Collaborator

Is your question related to spectral analysis? There shouldn't necessarily be a "spike" at the center frequency for the raw IQ samples read from the device.

You may be seeing that in an FFT or PSD, depending on the methods used. Can you provide a code example?

@JSzut
Copy link
Author

JSzut commented Jun 14, 2018

Sure thing, here's the code:

import pylab as plt
from rtlsdr import *

sdr = RtlSdr()
sdr.sample_rate = 2.4e6
sdr.center_freq = 101.1e6
sdr.gain = 7.7

samples = sdr.read_samples(256 * 1024)
plt.psd(samples, NFFT=1024, Fs=sdr.sample_rate / 1e6, Fc=sdr.center_freq / 1e6)

plt.show()

This is the graph with the spike (it is even on the real peak at 101.1 MHz):
image

@itdaniher
Copy link
Contributor

You can see some excellent discussion here - the spur at 0Hz relative to your tune frequency is a fact of the mismatch between the in-phase and quadrature (I&Q) branches of the (rtl)sdr - besides modeling and subtracting the offset, there's not much you can do.

@nocarryr
Copy link
Collaborator

Great answer itdaniher I always thought that was an issue with the 0 Hz frequency bin of the Fourier transfer. Never knew it had to do with the LO down mix on the device itself, so thanks again for taking me to school, lol

@michelp
Copy link

michelp commented Jun 15, 2018

Thanks @itdaniher ! great info

@nocarryr
Copy link
Collaborator

@itdaniher @michelp @roger-
This topic inspired me to put together a list for information like this on the wiki.

Take a look if you get the chance, I'd love to hear your feedback.

@JSzut
Copy link
Author

JSzut commented Jun 15, 2018

Thank you for your involvment guys. Special thanks to @itdaniher for his answer.

@pinhodb
Copy link

pinhodb commented Nov 12, 2019

While IQ imbalance is caused by mismatches in the two paths, RX DC offset is mainly caused by 3 factors:

  • LO signal self mixing due to finite isolation between mixer ports
  • LO signal (self or interfering) re-radiation from the antenna
  • Interfering signal and circuit generated second-order nonlinearities

I suggest the following article which explains these fenomena in more detail http://venividiwiki.ee.virginia.edu/mediawiki/images/9/93/DCR_Raman.pdf.
Most commercial grade integrated solutions, include DACs in the Rx front end path, to perform a calibration (to null the DC offset presented at the ADC).
You can in software calculate the average of the signal and subtract it, but it's a non-ideal solution.

@RobCoding
Copy link

RobCoding commented Dec 11, 2022

I suggest the following article which explains these fenomena in more detail http://venividiwiki.ee.virginia.edu/mediawiki/images/9/93/DCR_Raman.pdf.

That website no longer exists, try: https://web.archive.org/web/20170808211704/http://venividiwiki.ee.virginia.edu/mediawiki/images/9/93/DCR_Raman.pdf

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants