Slow capturing of traces

I have set scope.adc.samples = 90000 and whenever I record more than 7k traces, the scope starts to record it in intervals, like it records 20 traces then it stops for almost a second and records 20 traces again. This makes the capture a lot slower, is it a hardware issue or why is that the case?

After it overcomes 10k traces, it starts to record at normal speed, then again when its at 7k(17k total) it starts recording in intervals…

The ChipWhisperer project format doesn’t handle huge datasets very well and this can cause captures to slow down in a manner similar to what you’re describing, if I’ve understood you correctly.

One way to deal with this is by using multiple projects, e.g. create project 1, capture and save X traces, close the project, then create project 2, resume the capture, etc…

Another thing you can do that should help is to store the ADC samples as integers instead of floats; each sample will be stored as a np.uint16 instead of a np.float64. There is no loss of precision with this since the ADC samples are obtained as 10-bit integers in the first place.
You can do this by adding a as_int=True argument to your cw.capture_trace() call.


why do we save it as float64 if uint16 is easier to process?

Just historical reasons: people liked to see the power measurements as floats, and for most of our demos and courses where you’re attacking AES with a few hundred traces at the most, it didn’t matter.

when does the format matter?

In cases like yours where you have a very large number of power samples.
What I meant is that in our typical AES attack, storing and processing ~100 traces of ~20k samples each as floats doesn’t make much difference to most users.

how do I force the cw project to split the 100k traces I gather into 5k chunks each? I know it automatically splits it into 10k chunks, but how to force it to do it over 5k or even 3k?

This isn’t supported and some things may break if you do this, but you can try this:

proj = cw.create_project("project_name", overwrite=True)
proj.traces.seg_len = 3000
proj.traces.seg_ind_max = proj.traces.seg_len -1