Forums › General Discussions › MAX HOLD configuration using Python SDK
- This topic has 1 reply, 2 voices, and was last updated 10 months, 1 week ago by Andrew.
- AuthorPosts
PSkouParticipantI am trying to capture the MAX power value of a single SBAND ping, using the Python API.
I am able to do it using the Spike software (see attached) but I’m having problems configuring the BB60C the same way using the library.Can somebody help me reproduce the same spectrum analyzer behavior?
That would mean:
1-Configure SA w/ MAX HOLD feature
2-Send ping
3-Retrieve max value.Thanks.
Attachments:
You must be logged in to view attached files.
AndrewModeratorThe way that max hold works in Spike, is that each time a new sweep is performed, each bin in the sweep is max held with that same bin in the max held sweep.
Your algorithm might look like this,
1) Configure device
2) Capture first sweep and set as max hold sweep
3) Capture next sweep into variable “temp”. For each bin in the max hold sweep, set that bin to the max of either temp or max hold.// Pseudo-code for #3 for(int i = 0; i < sweepSize; i++) { maxHoldSweep[i] = (maxHoldSweep[i] > temp[i]) ? maxHoldSweep[i] : temp[i]; }
4) Repeat #3 until desired number of sweeps or time elapsed, or after ping has been sent.
5) To determine the peak value in the sweep, simply iterate over the max hold sweep and look for the max value.// Pseudocode for #5 int maxIndex = 0; for(int i = 1; i < sweepSize; i++) { if(maxHoldSweep[i] > maxHoldSweep[maxIndex]) { maxIndex = i; } } double maxValue = maxHoldSweep[maxIndex];
Hope this helps
- AuthorPosts
You must be logged in to reply to this topic.