A different tool, and a new perspective

May 02, 2013 3 Replies

I needed a quick vector display to test my QPSK modulator...



Well, eh, that SEEMED simple, with the sdr_rtl USB sticks you can record IQ signals at almost any frequency... So just display...



When you do rtl_sdr -f 107200000 testfile.iq you get a VERY long (2.048 Msamples / second, or 4.096 MB/second) recording of that frequency.



So I thought I just hack some of my xpse spectrum analyzer code to display XY as IQ....



It did not work, and had a night sleep about it usually helps...



So this morning I wrote the few magical lines of code, you find at the bottom of this story, this uses 'idle_cb' in the xforms (libforms) GUI package;



It works very nice, and it is slow, and that is the magic. Once I appreciated that, I added an extra delay...



See it working on youtube:

formatting link
This shows a FM broadcast music signal recorded as IQ signal with rtl_sdr, piped to my xpvs (xpvs stands for Xwindows Panteltjes Vector Scope). You can see the little dot (probably have to set it full screen) showing the rotating phase of the FM signal:



This recording shows the error in my QPSK modulator I was after:

formatting link
the dots should jump around the CENTER, there is carrier leakage (phase offset), and the DACs output an extra zero (see previous posting).



The interesting new thing about this 'tool', is that



1) you can play slow motion.
2) you can start at any point in the recording using dd: dd if=my_recording.iq bs=1000000 skip=10 | xpvs That skips 10 MB, and shows what is happening there..

I really wonder if any tool like this even exists! Probably for a small fortune!



I will probably make xpve available under GPL later, it always takes some time to make a package.



I like this word: Probably', it reminds me of Feynman photons.


The magical lines of code I accidently wrote this morning: ;-)


int idle_cb(XEvent *ev, void *data) { int i, q; double di, dq;



// get I and Q from stdin i = fgetc(stdin); if(feof(stdin) ) return 0;



q = fgetc(stdin); if(feof(stdin) ) return 0;



// make signed di = i - 127.0; dq = q - 127.0;



// debug //fprintf(stderr, "i=%d q=%d\n", i, q); //fprintf(stderr, "di=%f dq=%f\n", di, dq);



/* w magical lines */ fx[0] = di; //


Seems youtube does not work normally anymore, FM phase could be here now(reposted);

formatting link

Site:

formatting link

Direct link:

formatting link

This is Linux software released under the GPL.

It says "C sour code" as part of the plot image (just beneath).

Hehehehe...

Your code is sour, dude! :-)

actually, it said "soure".

Join the Discussion

Have something to add? Share your thoughts — no account required.

Didn't find your answer?

Ask the community — no account required