We need to get real-time neural signal from Hitachi’s ETG4000. Hitachi provides a MatLab script “RealtimeOT” to get data from a parallel port and convert the binary data to float. Here is what they did:
fp=fopen('temp','w+');fwrite(fp,bindata);fseek(fp,-4,'cof'); floatdata =fread(fp,4,'float'); fclose(fp);delete('temp');
This piece of code will be called a few hundred times per second. Converting data using file is too slow. As a result, the signal we get is not real time at all (delay up to 10s). Indeed, there is a very simple way to do this (typecast):
Then the program runs very smoothly and there is no delay.