11-07-2011 09:22 PM
Greetings,
My final year thesis project would be to develop a wireless EMG device via Bluetooth using an Arduino and an Amplifier Circuit. I could be using LabVIEW 2010 for the software to receive and process the EMG signal. So far I've been able to save the received data in LVM(without header) format.
What I want to achieve next would be to open the LVM file and perform analysis on it. But there seems to be a problem with opening the file since there is no time information that goes along with the files. Basically, the file is just a series of Y(amplitude) values. The problem is resolved by saving the file again, but this time placing header, and then changing the delta_X on the header to 0.001 and the time on the header to "Relative" instead of "Absolute". This saving and changing of the information on the header is done manually and not in LabVIEW.
Can anyone teach me how to properly open the LVM file to be read as a waveform with a delta_x of 0.001 so the waveform would have the proper frequencies.
Attached is a sample data in LVM format, and the vi that I want to use for the analysis. But I think there's still work to be done in properly reading the file
11-07-2011 09:54 PM
Hi ArvinB,
how you are saving your data? are you using the "write meas files" VI ?
I've change a little few your VI.... try to open it, using my attached signal.
Look the notes i write in front and back painel.... and compare your "read meas file" from mine.....
try to post your "SaveLVM.vi"......
good luck.
Ramon Campos
11-08-2011 07:29 AM
To recap, the file you posted does not contain timing information. You correctly determined how to modify the Write To Measurement File Express VI so it saves timing information. However, you are still getting the wrong timing information. This is probably due to not feeding the Write To Measurement File Express VI the proper timing information. This is very easy to do, since the input data type (dynamic data type or DDT) can handle data which does not contain timing information. If you post the code which writes the file, we can give you definite answers. However, I would guess that you are using a simple array of DBLs as the input to the file. You can fix this easily enough by converting your array of DBLs to a waveform and setting the dt and t0 before writing to the file. Drop a Build Waveform node and expand it to show the t0, dt, and Y inputs. Wire your array of DBLs to the Y input and set the t0 and dt appropriately. Use this to write to the file and your values should be correct.
If this is not the problem, please post your writing code and we can take a look.
11-08-2011 09:09 AM
Greetings RamonCampos,
Yes, I'm using the "Write to Measurement File" vi to save the data received from the serial port.
I've attached the vi that I'm using to receive and save the data.
How did you manage to place time stamps in your "signal-01" LVM file?
I'm interested to do the same in my files to be able to read and anaylze them properly.
11-08-2011 09:15 AM
Hello Sir DFGray,
I believe you have understood my problem correctly. I tried doing your suggestion on using the Build Waveform vi but I am not confident that I am implementing it correctly. Can you show me how to implement it?
I've attached here my Receive and Save vi. Basically the vi simply receives the values from the com port and saves them in a LVM file with no headers and no timing information.
How can I have the correct timing information of dt(or delta_x) = 0.001 to read the file correctly by the OpenLVM vi I posted earlier.
Thank you.
11-08-2011 10:59 AM
Saving LVM using the express VI does not work well for your particular application (logging single points at a time). In addition, your timing is somewhat uncertain, since it is driven totally by software. I would suggest you use the file I/O primitives to do this yourself.
For Write:
For Read (assumes a number of points in the few thousand or less range):
If your file is huge, you can read it from disk in chunks and append to a DBL array to save space. You can also add a further line at the beginning of the file to save the timestamp.
Let us know if you need more help.
11-08-2011 10:25 PM
Hi ArvinB,
double click in your "Write To Measurement File", in X value (time) Columns option, choose one column per channel.
try to save your signal again..... and read it in OpenLVM-02.vi
probably it will work fine!
Ramon Campos