Dear Greg,
We have an NDF file M1691072178.ndf, size 125 MByte that is the result of two Neurorecorders writing to the same file. Each Neurorecorder is downloading from its own ALT the signals from three 256 SPS SCTs. The recording took place on a Windows machine. Our hope was that the two Neurorecorders would take turns writing to the files, each writing a valid block of data to the file without corrupting the date written by the other Neurorecorder.
But we find that most of the data in the file has been corrupted by over-writing by the two Neurorecorders. The corruption is so severe that we cannot even see individual four-byte SCT message headers in a hexadecimal dump of the corrupted data. The best we can do is extract all intact messages from the SCT channels we know to belong to a particular Neurorecorder. Thus we are able to extract the un-corrupted data.
At the link below is Signal_Separator.tcl, a LWDAQ Toolmaker Script. To run, cut and paste into the LWDAQ Toolmaker execution window and press Execute.
Before execution, make sure the "ids_A" and "ids_B" strings specify the SCT channels you want extracted from the original combined NDF file. These two sets of channels will be written to two new NDF files, Part A and Part B. The new files will have the same name as the original, but be written to directories A and B within the same directory as the original file. The script creates directories A and B if they don't exist.
We run this script on M1691072178.ndf and we get two output files. They are 762 s and 775 s long. In the Neuroplayer Overview, they look like this:
- Part_A_Overview.gif (44.78 KiB) Viewed 8789 times
- Part_B_Overview.gif (45.53 KiB) Viewed 8789 times
Of the six channels, five look as if they have survived the extraction without corruption. But No193 does not look right: it undergoes a step down of 32768 counts half-way through Part B, which suggests that somehow the top bit of the sixteen-bit samples has been corrupted. Even without the top bit, however, the signal still looks like EEG.
This appears to be the best we can do for now. The script takes a minute to separate each file, but it will do all your files. In the future, we will avoid this problem because the Neurorecorder will raise an error if the file it wants to create has already been created by another Neurorecorder.
Best Wishes, Kevan