Dave Gomberg wrote:
At 12:50 4/29/2009, Bob McGwier wrote:
Dave Gomberg wrote:
At 10:01 4/29/2009, Bob McGwier wrote:
 the agc will begin to use approximations for sqrt(SUM (sample_mag)^2)
I kinda like writing high performance approximation code, what input range do you need to handle and what error fraction is acceptable? Do you mean sqrt(sum(samples**2))??? What you wrote is simply sum(samples) I believe.
I wrote what I meant. The samples are complex so sample_mag^2 is what is needed. This is best accomplished in "perfect code" by I^2+Q^2 where that is the real and imaginary part of the complex number.

OK, then what you are seeking is sqrt(sum(sample_magnitude^2)) ?? And you have I and Q a separate values now in the code? Or is there a complex datatype....
We have a complex struct data type but I and Q are accessible from the struct as the two float members of the struct.

10% error is completely acceptable. The range is variable and this is due to the "agc threshold" setting on the radio.

I understand the range varies, I am just trying to get an idea of the possible magnitudes. Is 10^7 possible?
10^7 is not possible

How about 10^-7??

Is possible.



20*log(1.1) < 1 dB error!

Actually, 20*log(1.1) is about 6.7 or about 8.2db, but it is less than one bel. Or am I not following you again???

I think you better try that calculator again. Log10( 1.1) is a number much smaller than 1. 10^0 = 1 and 10^1 = 10, so 10^x = 1.1 and solve for x (take log10 of both sides) gives 0.04..... and 20* that is 0.8.... dB. SO, 10% over the nominal value of 1 is off less than 1 dB.


This is audio presented to speaker/headphones. This is not metered, etc. So you can see we have been completely stupid in insisting on the ridiculous cost of full blown square roots, logarithms, sum(x^2) in these calculations.

If you want to propose a mechanism to compute sum(Mag(x)^2) with 10^-14 to 1, not including the multiplicative factor of the length of the sum,
There are two problems. Do the easy one first sum(mag_squared) is needed and so is sqrt(sum(mag_squared)) for different purposes. A -120 dBm to -130 dBm signal produces a very tiny number for the sample voltage and overload occurs just north of 0 dBm, so that is 130 dB of required dynamic range for the agc to operate properly. Most people set the agc threshold higher than -120 dBm so you don't tire yourself listening to amplified noise floor at full volume.

What happened to the sqrt? Are you saying the range of Mag(x) is tiny to about 1? What is the multiplicative factor, *1/n

Bob


--
(Co)Author: DttSP, Quiktrak, PowerSDR, GnuRadio Member: ARRL, AMSAT, AMSAT-DL, TAPR, Packrats,
NJQRP, QRP ARCI, QCWA, FRC.
"You don't need to see the whole staircase, just
take the first step.", MLK.
Twitter:rwmcgwier
Active: Facebook,Myspace,LinkedIn



_______________________________________________
FlexRadio Systems Mailing List
FlexRadio@flex-radio.biz
http://mail.flex-radio.biz/mailman/listinfo/flexradio_flex-radio.biz
Archives: http://www.mail-archive.com/flexradio%40flex-radio.biz/
Knowledge Base: http://kc.flex-radio.com/  Homepage: http://www.flex-radio.com/

Reply via email to