| 1 |
(* |
| 2 |
Platform independent loading of biosignal data |
| 3 |
Copyright 2011,2012,2016 Alois Schloegl, IST Austria |
| 4 |
This file is part of the "BioSig for C/C++" repository |
| 5 |
|
| 6 |
BioSig is free software; you can redistribute it and/or |
| 7 |
modify it under the terms of the GNU General Public License |
| 8 |
as published by the Free Software Foundation;either version 3 |
| 9 |
of the License,or (at your option) any later version. |
| 10 |
|
| 11 |
This program is distributed in the hope that it will be useful, |
| 12 |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 13 |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 14 |
GNU General Public License for more details. |
| 15 |
|
| 16 |
You should have received a copy of the GNU General Public License |
| 17 |
along with this program. If not, see <http://www.gnu.org/licenses/>. |
| 18 |
|
| 19 |
*) |
| 20 |
|
| 21 |
mySLOAD[filename_, sweeps_] := Module [{link, data}, |
| 22 |
(* mySLOAD: makes it platform independent *) |
| 23 |
|
| 24 |
link = Install[$SystemID<>"/biosig.exe"]; |
| 25 |
data = Sload[filename, sweeps]; |
| 26 |
Uninstall[link]; |
| 27 |
data (* return data *) |
| 28 |
]; |
| 29 |
|
| 30 |
(* This demonstrates the usage of the above module mySLOAD |
| 31 |
On Windows platform the directory separators must be either |
| 32 |
a single forward slash "/" or double backward slashes "\\" |
| 33 |
*) |
| 34 |
|
| 35 |
filename = "AP100427b.dat"; |
| 36 |
data = mySLOAD[filename, {1, 0, 0}]; |
| 37 |
signal = data[[1]] (* sampled data *) |
| 38 |
t = data[[2]] (* sampling time points *) |
| 39 |
hdrinfo = data[[3]] (* header information *) |