Hi Samuel,
Thanks for your examples and data, it was really clear now. I'm convinced this must be an issue with the way the binary file is being interpreted by matlab. I'm attaching a new version of your workflow where the only modification was adding a MatrixWriter at the end to write all the raw data to a file.
I don't have access to matlab, but I wrote the following python equivalent to plot the entire data, both continuously in time, and ordered by trials, and the results look quite sensible given your description (see below). I have two possibilities:
1) can you check whether you are reading the file into matlab as 64-bit floats, rather than 32-bit floats? I know matlab has a preference for double matrices, so it tends to do that unless you tell it otherwise;
2) another possibility is the matrix representation is transposed from what matlab likes (i.e. rows are columns, etc).
The data should be a 1D array of 32-bit floats, so in this case I wouldn't expect the memory layout to be ambiguous, but sometimes the plotting functions require specific orientations to represent the data properly.
Hope this helps!
Script:
import numpy as np
import matplotlib.pyplot as plt
# import raw data stored as 32-bit floats
data = np.fromfile('power.bin',dtype=np.float32)
# plot raw data
plt.figure()
plt.plot(data)
plt.xlabel('time (samples)')
# reshape data as 1D of 1024 columns and plot each row buffer w/ offset
plt.figure()
power_rows = data.reshape((-1,1024))
[plt.plot(row + i * 5e7) for i,row in enumerate(power_rows)]
plt.xlabel('samples')
Figures: