Sorry Martin, for the delayed response. Which file should I send you, .set files are OK?
I have attached the photo how I export into edf, may be am doing it in a wrong way?
Thanks
The way you’re showing is the correct way to export it to EDF. I think sending me one file of the group will be fine, for example: “sb10S4_bthermode | band | time (#1)”. Right click on the first trial (#1) and select File -> Export to File, and choose the Brainstorm matrix (timeseries.mat) format.
Yes, please send me your problematic file if possible. Can you briefly explain what you're doing to reproduce this issue? Are you simply right clicking on the file in Brainstorm and going to File -> Export to file -> EEG: .edf?
Thanks for the help!
Now I could export but I got weird behaviour when I try to read exported files.
When I try to read edf file in Python mne I am getting the following error
ValueError: could not convert string to float: '-7.247e-'
It could be error on mne side (on EEGLAB I am getting this warning for all channels
WARNING SOPEN(GDF/BDF/EDF): Scaling factor is not defined in following channels:
But this is not that important and probably related how those libraries solve this ambiguity (so this should be not solved on brainstorm side)
But what is stranger, when I read exported file using EEGLAB, the sample has 1875 frames per epoch what gives end of the epoch at 3,123s, while orginal matlab files have length 1801 samples, which should give 3s
Could it be related to newly introduced round operation?
For the extra samples at the end of the file, this is not a bug but rather a limitation of the EDF format. This format needs to be broken into small data records (blocks) of the same length. Because your original file had an indivisible (prime) number of samples (1801), Brainstorm cannot find a record size that fits perfectly with your data. In your case, it was chosen to split the data in blocks of 75 samples. Because of the last 1801th sample, an extra block was needed for that single sample, resulting in 74 empty samples appended at the end of your file to fill that last block.
So either remove these last 74 samples when importing that file in another software or export your file in a better format such as Fieldtrip (EDF is not a great format...)
In general, exporting processed data as EDF files is a not a good choice.
EDF can only save 16bit integers, while your processed data is available in 64bit floating-point values. Converting back to 16bit integers causes a lot of precision to be lost, and doing this multiple times to exchange data between programs can end up damaging the signals and introduce unexpected artifacts.
Always prefer using file formats that can store floating point values instead (anything Matlab-based, or the BrainVision format.