[hpsdr] AGC on writing my first waterfall project - what am I missing?

Erik Anderson erikba at odysseus.anderson.name
Sat Jun 8 11:26:26 PDT 2013


I've been working on a receiver project for HPSDR for... a while now.  I've
managed to get a waterfall display starting to work, I'm just trying to
figure out the proper means of showing something useful to the user.

If there is any context needed as to what level I am at this, before
reviewing KK source I had a completely blank waterfall (rounding down to
zero on all pixels), as I didn't realize the waterfall was measured in
decibels, not by magnitude or magnitude-squared.

I'm currently getting numbers between -150 and -200.  I have identified at
least two, possibly three places in KK where the numbers are multiplied by
some constant where I am not so (at least before any calibration gain is
added in) I don't expect any numbers I come up with to be comparable to KK.
 The range of numbers I'm seeing I suspect is limited to -10240 (limit of
double) through +30 (I haven't scaled the FFT by my window size yet).

My current goal is to take these range of numbers and somehow scale them to
the range of colors (0.0 - 1.0) that make up the waterfall.  Note that at
this point I am primarily measuring noise floor.  This means my intended
output is a nice blue differentiated waterfall.  The naïve approach in my
mind would be to just take the minimum and maximum values over the last N
seconds and use them as the bounds; this would cause the noise floor to be
measured as almost clipping, which doesn't really sound right.

KK appears to use a hardcoded upper bound of -80 and a discovered lower
bound.  That upper bound may work once calibrations start translating my dB
values into dBm, but before calibration is written in that -80 would need
to be adjusted to account for the multiplications that I am not doing in
the code.

Working through this email I do see possible approaches as (1) just take
the min and max and don't care that the noise floor maxes out the display,
(2) try to remove the multiplication factors and see what that -80 means to
me, (3) point the receiver at 10MHz or something and start making my own
magic numbers (4) borrow a signal generator from someone and follow the
instructions to calibrate the receiver

I'm virtually certain that at least a few people here have worked through
similar issues, and there likely is something very obvious that I'm still
missing here (realizing I didn't know to take the logarithm to have a
readable display was a reality check for me).  I would appreciate any
pokes, if nothing else to show that I'm going in about the right direction.

Erik
KM2G
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openhpsdr.org/pipermail/hpsdr-openhpsdr.org/attachments/20130608/e325a0ad/attachment-0003.htm>


More information about the Hpsdr mailing list