Giter Site home page Giter Site logo

Comments (6)

misterskel avatar misterskel commented on July 29, 2024

Just found the part of the dual tuner code which writes the data... don't know how I missed it before. I see now that it is written as short interleaved I/Q data, which I have tried importing it... the problem is probably on the Matlab end then.

from dual-tuner-experiments.

fventuri avatar fventuri commented on July 29, 2024

@misterskel - as you correctly inferred from the source code, the output is just raw signed 16 bits interleaved I/Q samples, exactly as they come out from the SDRplay API receive callback functions.

If you have GNU Radio there, a quick way to make sure those files are correct is to run the attached GNU Radio flowgraph, which will display the frequency spectrum of the I/Q stream stored in the file; I also thought that by looking at the blocks in this GNU Radio Companion file, you might be able to figure out how to read them in Matlab.

Franco

check_iq16.zip

from dual-tuner-experiments.

misterskel avatar misterskel commented on July 29, 2024

I was able to resolve this, but I'm not 100% why it works. For context, I am testing out the code in the HF band, collecting a sample chirp from 15 - 15.5 MHz. What ultimately worked was:

./dual_tuner_recorder -r 6000000 -i 1620 -b 500 -l 3 -f 15250000 -x 4 -o RSP-%c.iq16

The confusing thing to me is the IF frequency. I would have expected a zero IF frequency to be what I want in order to see my 0.5 MHz centered on 0 Hz, but ultimately it only worked with the 1620 setting. But it was still seemingly centered at zero IF with that setting? I don't see an obvious cause for this in the code, which leaves me wondering if I misunderstand how the IF stage of this SDR works.

from dual-tuner-experiments.

fventuri avatar fventuri commented on July 29, 2024

@misterskel - a good document to understand how the RSPduo works is the 'Introduction to the RSPduo', which you can download from SDRplay here: https://www.sdrplay.com/wp-content/uploads/2018/05/RSPduo-Introduction-V3.pdf
On page 2 it explains why the RSPduo needs a non-zero IF frequency to operate in dual-tuner (or master/slave) mode (usually this mode of operation is referred to as 'Low IF' or 'LIF').

Also only very specific combinations of the sample rate, IF frequency, and IF bandwidth support the down-conversion used when the RSPduo is in dual-tuner mode. They are listed in the SDRplay API Specification guide (https://www.sdrplay.com/docs/SDRplay_API_Specification_v3.09.pdf) on page 26.
When down-conversion is enabled the SDRplay API takes care of shifting the signal by the amount of the IF frequency, as you already observed in your experiments.

For instance the choice of sample rate, IF frequency, and IF bandwidth in your example falls in this row from that table in the SDRplay API Specification guide:

    (fsHz == 6000000) && (bwType <= sdrplay_api_BW_1_536) && (ifType == sdrplay_api_IF_1_620)

with these settings the SDRplay API will perform down-conversion using a down-conversion decimation factor of 3, which means that the output sample rate will be 6000000 / 3 = 2000000 (you can then further divide this sample rate by a power of two using the standard decimation factor available with the '-d' parameter).

One last thing (which is not in the README but you might have noticed in the source code): the latest version of dual_tuner_recorder allows the user to control many of the settings of the two tuners independently; for instance if you were to run something like this:

    ./dual_tuner_recorder -r 6000000 -i 1620 -b 500 -l 3,5 -f 15250000,7100000 -x 4 -o RSP-%c.iq16

you would have the first tuner with a center frequency of 15.250MHz and a LNA state set to 3, while the second tuner would have a a center frequency of 7.100MHz and a LNA state set to 5.

Franco

from dual-tuner-experiments.

misterskel avatar misterskel commented on July 29, 2024

Hi Franco,

This was tremendously helpful - thank you for taking the time to explain these things! It all makes perfect sense now.

And of course, thank you for creating this repo in the first place. I am an antenna engineer who is a bit outside of his wheelhouse, so this has been perfect.

from dual-tuner-experiments.

fventuri avatar fventuri commented on July 29, 2024

@misterskel - glad you found the repo! I just threw the code together over a weekend to play around with the RSPduo settings myself and I am glad it is useful to others.

I thought that being an antenna engineer you may also be interested in the 'RSPduo Technical Information' document (https://www.sdrplay.com/wp-content/uploads/2018/06/RSPDuo-Technical-Information-R1P1.pdf), which contains detailed tables about sensitivity, gain, noise figure, linearity, and plots of the frequency response of the filters for each band and for each of the two tuners.

Franco

from dual-tuner-experiments.

Related Issues (1)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.