<div dir="ltr">Hi all,<div><br></div><div style>I recently got a Raspberry Pi and an RTL2832 USB card and have been successful in compiling rtl-sdr and running the associated examples, piping the data up into LabVIEW for analysis with their Demodulation Toolkit. I'm a little weak on the signal processing math knowledge here, so I was wondering if someone could explain the math behind the offset tuning code in rtl_fm's optimal_settings() function.</div>
<div style><br></div><div style>It looks like the function takes the desired center tuning frequency and calculates an integer decimation ratio based on a "capture rate" near 1 MHz and the desired final sampling rate. Then the center frequency is offset by a quarter of the capture rate, and this and the capture rate are used to program the radio. Then in the receive callback, the I/Q data is shifted 90 degrees in rotate_90(). At this point, the I/Q data represents (I presume!) the spectrum around the original desired center frequency and at the original sample rate.</div>
<div style><br></div><div style>How do I get, mathematically speaking, from the oversampled I/Q data centered at the offset frequency to *my* desired center frequency and sample rate? I'm especially curious as to the effect of the frequency offset using that particular value (capture rate/4) and what role the rotation plays in the transformation.</div>
<div style><br></div><div style>Thanks,</div><div style>Aaron</div></div>