Resync Split traces

Hello,

I am trying to resync my traces. This is working just fine when using the captured traces and using Resync_SAD.

I am now trying to resync this synced traces on specific locations with a second Resync_SAD.
Therefore I slice my waves into 200 pieces and put them into an array. Like this:

import numpy as np

i = 0
j = 5

tempTraces_split = np.empty(len(new_proj.waves[i]), dtype=object)
tempTraces_split[i] = np.array_split(new_proj.waves[i],200)
tempTraces_split[j] = np.array_split(new_proj.waves[j],200)

Now I want to Resync_SAD only the 3rd piece.
My reference wave is wave[0][3]
My to_sync wave is wave[5][3]

Because the resync script needs a trace as input and not a wave this is not working.
How can I save the waves as individual traces as a new project?
Or is there another way to do this?

The splitted wave at position [3] looks like this:

Google Photos

Hi,

You can create a trace object as follows:

import chipwhisperer as cw
trace = cw.Trace(wave, textin, textout, key)

Alex

Hi Alex,

thank you for the reply.

I did try what you suggested but it does not work as intended.
If I print out the trace of a project I have the following structure:

for trace in project.traces:
print(trace.wave, trace.textin, trace.textout, trace.key)

[98. 98. 99. … 29. 28. 28.] [166 68 151 42 49 178 30 179 34 173 201 174 144 30 39 192] None [ 43 126 21 22 40 174 210 166 171 247 21 136 9 207 79 60]

When I generate the trace as you specified with just one input of the split trace i get this:

textin = [None]
textout = [None]
key = [None]
trace = cw.Trace(tempTraces_split[0][0], textin, textout, key)

Trace(wave=array([98., 98., 99., …, 87., 87., 87.]), textin=[None], textout=[None], key=[None])

I can see that this generates some kind of a list. Why are the two traces different? How can I adjust the structure to match?

If I print out the trace:

print(trace.wave, trace.textin, trace.textout, trace.key)

I get:

[98. 98. 99. … 87. 87. 87.] [None] [None] [None]

I would need [98., 98., 99., …, 87., 87., 87.] None None None

Thanks.

-e

Hi,

I did get the structure right by using None in the cw.trace command.

trace = cw.Trace(wave, none, none, none)