Skip to content

Commit c49aafc

Browse files
committed
Adding sampling rate and units to the CSV file
1 parent 37c38fb commit c49aafc

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

java/br/unb/biologiaanimal/edf/EDF.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -183,11 +183,12 @@ public void toCsv(String filePath)
183183
writer.write("recorded:" + (String) header.get("startdate") + " " +
184184
(String) header.get("starttime") + ";");
185185
// TODO Get sampling
186+
writer.write("sampling:" + Integer.toString(getSamplingRate()) + ";");
186187
writer.write("subject:" + (String) header.get("patient") + ";");
187188
// TODO Get labels
188189
writer.write("chan:" + (String) header.get("numbersignals") + ";");
189190
// TODO Get units
190-
writer.write("\n");
191+
writer.write("units:uV\n");
191192

192193
// Getting records
193194
for (int i = 0; i < labels.length; ++i)
@@ -208,7 +209,7 @@ public void toCsv(String filePath)
208209
if (j != reader.getAnnotationsChannelIndex()) {
209210
double[] signal = signals[j];
210211
double value = (signal.length > i)? signal[i] : 0;
211-
writer.write(((j == 0)? "" : "; ") + value);
212+
writer.write(((j == 0)? "" : "; ") + Double.toString(value));
212213
}
213214
}
214215
writer.write("\n");

target/edf.jar

70 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)