05-12-2011 11:50 PM
Hi Zj,
My group has recently started working on the biosignal acquisition and signal processing. I would need your help in the following:
1. How can we retrieve the data files (ASCII format) sequentially saved in a particular folder for analysis?
2. We would like to save the various extracted features from the sequentially read data files in an CSV file. The columns (A, B, C...) should represent the different features extracted and rows (1, 2, 3...) should represent the file number (i.e. the biosignals from different files).
I have been able to get the features individually from each file using LabVIEW.
My group has developed a program in MATLAB, which implements the above requirement. Is it possible to implement the same in LabVIEW without using the MATLAB Program that my group has deveoped? I will really appreciate if you can provide a sample LabVIEW program for implementing the same.
Also, is it possible to do the same for online recording of the features. I mean, suppose we are acquiring ECG signals from 10 subjects and as we sequentially record the ECG of the volunteers, the features are stored in the subsequent rows?
I am using either NI-6008 for data acquisition.
Thanks,
KP
05-13-2011 07:22 AM
LabVIEW should have no problems doing any of the things you mention. To help you, however, we will need more details, such as a sample file, how you sequentially save the files (i.e. name format), exactly what data you are going to extract and/or write, etc.
In general, you can manipulate file names using the string and path functions. This will allow you to select which file name of a series you want to read/write. Use a FOR or WHILE loop to loop over the names of interest.
Please give us more info so we can help you.
05-13-2011 10:41 AM
Hi Mr. Gray,
Thanks for your kind reply. I have attached the MATLAB program for your kind perusal. I am not able to attach the sample files as they are too large to attach. The files are saved as 1. txt, 2.txt and so on. If you provide me your email, I will forward you the files.
The ECGs are decomposed using db6 wavelet. The coefficients from D7 and/or D8 levels are used to calculate the features. These features are then saved into .xl files, which are used for signal classification in Statistica software.
Thanks again,
KP
05-14-2011 11:19 AM
Hi Dr. Gray,
Can you kindly help in modifying the 1.vi for sequential processing of the files?
Thanks,
KP
05-15-2011 09:05 PM
Hi KP,
You could use "Number to Decimal String" to generate a series of file name, then process one by one use you 1.vi.
Thanks!
ZJ Gu
05-16-2011 02:43 AM
Hi ZJ,
Thanks for your reply. Can you please send me a sample program(s) or tutorial(s) on this? I am not able to find how to use the same for continuous file calls and/or writing in .xl file. I am uploading the modified VI which I tried.
Thanks,
KP
05-16-2011 07:53 AM
Your modified program will only give you one file (over and over). The change to the file name should be inside the loop. Use the loop iterator (the "i" in a square) for your file number. You will probably have to add something to it, since the iterator starts at zero.
You should probably be using a FOR loop instead of a WHILE loop. The FOR loop will stop after processing all your files (provided you give it the correct number of iterations). The WHILE loop will stop when you hit your stop button, although you could also program it to stop when it tries to open a file which does not exist (error 7 from the file open).
Keep working at it. Let us know when you run into problems.
05-16-2011 03:23 PM
Hi Dr. Gray/ Dr. ZJ,
I have updated the file "1 modified with numerical to decimal string.vi". It is showing an error (Error -42405 occurred at error in NI_AdvSigProcTSA.lvlib:tsa_series check.vi --> NI_AdvSigProcTSA.lvlib:TSA Mean (Array).vi --> NI_AdvSigProcTSA.lvlib:TSA Mean (Waveform).vi --> 1 modified with numerical to decimal string.vi) during feature extraction.
I have also attached a screen shot of the same.
The program is running fine when I am not using the string palettes.
Kindly advice.
KUNAL
05-19-2011 03:57 PM
Hi Dr. Gray/ Dr. ZJ,
I am still waiting for your response on this....
Regards,
KP
05-20-2011 03:38 AM
kunalpal wrote:
My group has recently started working on the biosignal acquisition and signal processing.
This is no doubt school work. And if you depend on other you will not learn anything. I guess this assignment is related to some engineer school or technical school class. And an important part of that education. Is to learn how to navigate in unknown water. Not just sit as hungry nestling. Waiting for mama to feed you. Also an important part of programming is debugging. A programmer is useless unless he/she know how to debug code. And Labview do not at all lack such functions. So then an error like this come into being. You first read the necessary documentation. And then you use the debug tools to find the error.
I am sure Labview has some free online tutorials on the art of debugging. I am not sure how to find them. But I am sure Dr. Gray/ Dr. ZJ. Can point you in the correct direction here