Reply To: Spike version 3.7.2

Forums General Discussions Spike version 3.7.2 Reply To: Spike version 3.7.2

#241880
mcline
Participant

Andrew, I have noticed effects on the measurements when calculating channel power with the following code:
//Calculate total/Channel power
double TotalSpecPower = 0;
double linearpower = 0;
double minbinsize = RBW / 3.2;
double minFFT = 80e6 / minbinsize;
double order = Math.Ceiling(Math.Log(minFFT, 2)); //Log, base 2, of minFFT
double fftSize = Math.Pow(2, order); // 2^order
var nWindowBW = (RBW * fftSize) / 80e6;

for (int i = 0; i < FFTBIN.Length; i++)
{
linearpower = linearpower + Math.Pow(10, ((FFTBIN[i]) / 10));

}
ChannelPower = Math.Round(10 * Math.Log10((linearpower / nWindowBW)), 2);

When using version 3.5.16 or earlier, the channel power from the code above matches Spike, but when I use version 3.6 or later, the channel power from the code above does not match the Spike channel power. I see about a 2.5 to 3db difference.
Am I missing something in the channel power calculation code?

Thanks
Michael