Feature Request: Reduce sampling_frequency to 10 Hz with min/max/avg per sample

Need guidance on reducing the effective sampling_frequency to 10 Hz while still capturing meaningful current trends. Specifically, I’m looking to obtain min, max, and average statistics for each 10 Hz interval, Is it possible to get it in a csv.

Hi @Vaishali and welcome to the Joulescope forum!

Have you considered recording statistics? First, configure statistics for 10 Hz:

Then, click Statistics recording:

It records to a CSV file like you want. While the Joulescope UI does not support loading CSV files (only JLS files), you can use this with external tools.

Does this do what you want?

Hi ,
thank you for the quick response.
yes and I am also looking to log the data for a week in csv.

1 Like

Is it possible to downsample at 10Hz?

I am using this script to downsample at 10 Hz but looks like for js110: ‘The base collection frequency in Hz. Fixed to 2 for JS110.’
Is it fixed?

The JS220 allows you to specify other on-instrument statistics rates. The JS110 only supports 2 Hz statistics rate on instrument. You can specify other JS110 rates when streaming full-rate data, but the downsample_logging script explicitly avoids this.

If you want to capture 10 Hz statistics from a single JS110, you have other options. For example, this command:

python -m pyjoulescope_driver statistics --js110_host --frequency 10 > out.csv

If this works for you, great! If not, can you please provide more details about what you are trying to accomplish? Include Joulescope model, host computer OS, command line or UI, etc…

  • Raw sampling at 2 MHz
  • Downsampling to 10 Hz for stats
  • Stats include min, max, avg current
  • Timestamped output in CSV
  • Long-duration logging(1.5 week)
  • Windows OS
  • Open to UI or CLI methods
  • JS110

Thanks for the additional information. In all cases, you need to prepare the host computer. See Performing long-term captures on Windows.

You have options:

  1. The downsample_logging script is made for this purpose, but it only supports 2 Hz for the JS110. You would need to upgrade to the JS220 to use it at 10 Hz.

  2. The Joulescope UI should work with the instructions provided above. For best reliability, do not have a Waveform widget in the active view you use while performing this recording. While it should work, it exercise a LOT more code that can only reduce reliability.

  3. The command line as shown above should work. It will record more statistics than you want.

  4. You can write your own python script to do exactly what you want. For maximum reliability, use pyjoulescope_driver. You can use the statistics entry point as an example.

Do one of these options work for you?

I just realized that (1) downswample_logging.py and (2) the UI only output average current. You would need to modify the code to output min & max.

(3) includes i_avg, i_min, and i_max:

#device,sampled_id,i_avg,i_std,i_min,i_max,v_avg,v_std,v_min,v_max,p_avg,p_std,p_min,p_max,charge,energy

You can write (4) to output exactly what you want.

Thanks
If I want the sampling every 100ms, then I would get the complete raw samples and would have to compute min,max,avg sample on the host machine?

The Joulescope software computes the statistics for you. You just have to use host-side computation for the JS110 to adjust the frequency. Please try this command:

You have to install Python and then install the joulescope packages:

python -m pip install -U joulescope

That’s it!

Hi Team,
THank you for your response. IT was helpful. I am running into one more issue where I have a battery connected to the Joulescope(In) and my sensor is connected on the (out). The power supply stops after an hour or two to the sensor from Joulescope. Any reasons and suggestions to fix that?

Hi @Vaishali - Your JS110 does have the ability to disconnect IN+ from OUT+. It is disconnected when the JS110 is not powered, not yet opened by the host, current range is set to off, or if it resets. The most common cause of reset is if the host stops servicing it.

Is your battery dead? What did you measure that tells you “the power supply stops”? The JS110 does not include a power supply, so I presume you mean that you measured voltage across JS110 IN but no voltage across JS110 OUT. What host software are you running? Still Windows 11 and JS110? Is the host software still running? Did you host computer go to sleep? Did you host computer do something else and stop communicating with your JS110? Did the host computer reboot?