OpenVibe & Matlab & Real-time

Come here to discuss about OpenViBE in general!
yrenard
Site Admin
Posts: 645
Joined: Fri Sep 01, 2006 3:39 pm
Contact:

Re: OpenVibe & Matlab & Real-time

Post by yrenard »

Dear Johann,

if the signal can be plot in Matlab, then it is actually sent from OpenViBE to Matlab. Therefore, I would find it weird if it could not go back from Matlab to OpenViBE. So I would like you to connect and EBML stream spy after the Matlab Filter box. Please chose a log level such as Information or Warning and execute your scenario for a few seconds. Then send your designer log file so I can have a look to it.

Yann

Johann
Posts: 9
Joined: Wed Jul 07, 2010 3:31 pm

Re: OpenVibe & Matlab & Real-time

Post by Johann »

Hi,

Well, Matlab doesn't plot anything, there's just a command window with nothing in it.

As for the EBML Stream Spy, I put one between the GDF File Reader and the Matlab Filter, and another one between the Matlab Filter and the GDF File Writer, but it doesn't work: no file is created.

yrenard
Site Admin
Posts: 645
Joined: Fri Sep 01, 2006 3:39 pm
Contact:

Re: OpenVibe & Matlab & Real-time

Post by yrenard »

Dear Johann,

indeed, the EBML stream spy does not create any file. Instead, it dumps some information in the log manager as text. You shoul be able to see that in the console. It is also dumped in the openvibe-designer.log file in the installation folder.

Hope this helps,
Yann

Johann
Posts: 9
Joined: Wed Jul 07, 2010 3:31 pm

Re: OpenVibe & Matlab & Real-time

Post by Johann »

Hi Yann,

OK, here is the log file. I hope you'll find something interesting in it.
Attachments
openvibe-designer.zip
(39.29 KiB) Downloaded 257 times

yrenard
Site Admin
Posts: 645
Joined: Fri Sep 01, 2006 3:39 pm
Contact:

Re: OpenVibe & Matlab & Real-time

Post by yrenard »

Dear Johann,

Indeed we have useful information in this file (however, I had to find out that it was a rar file myself. Please just zip it instead of rar it and rename it to .zip).

So the first part of the log (line 120-4541) show a normal stream structure with 2KHz signal, 8 channels, 100 samples per buffer and regular buffer updates.
The second part of the log (line 4542-10110) show abnormal stream structure as the first node of each chunk is unrecognized.

Based on your previous email, I'm not sure if you have one or two EBML stream spy boxes. So I suggest that if you have two, you rename each of them so I can have a clear distinction in the log file. Then send me a new zipped log file, attached with the scenario you are using.

Thank you,
Yann

Johann
Posts: 9
Joined: Wed Jul 07, 2010 3:31 pm

Re: OpenVibe & Matlab & Real-time

Post by Johann »

Hi Yann,


I'm sorry for the inconvenience, I renamed the file because I wasn't sure you had Winrar. I agree it was clumsy.

Here are two tests that I made:
- one with the EBML Stream Spy before the Matlab Filter
- one with the EBML Stream Spy after the Matlab Filter
I give you a schematic of the tests and the logs.

Hope it'll help finding a solution.
Attachments
Tests.zip
(97.95 KiB) Downloaded 248 times

yrenard
Site Admin
Posts: 645
Joined: Fri Sep 01, 2006 3:39 pm
Contact:

Re: OpenVibe & Matlab & Real-time

Post by yrenard »

Dear Johann,

thank you for the two scenarios examples you sent. The first one looks similar to the log you posted previoulsy. The second one shows that nothing comes out of the Matlab Filter box. Based on the two snapshots you attached, I note that you did not connect the first input of the Matlab Filter box. Connecting this input is mandatory, even if you don't want to ignore its content in the Matlab code. I suggest you connect a Clock Stimulator to this input, just so some (empty) content is sent.

However, I still wonder why in the first example, the stream content looks abnormal with unrecognized node id. This may reflect another bug.

Tell me if it helps,
Best regards,
Yann

Johann
Posts: 9
Joined: Wed Jul 07, 2010 3:31 pm

Re: OpenVibe & Matlab & Real-time

Post by Johann »

Thanks for the analysis

I connected a Clock Stimulator to the first input of the Matlab Filter and I repeated the experiment. Nothing changed much I'm afraid.

The Signal Display box that I added in the end is still blank.

The sampling frequency of my GDF File is 2000 Hz. I fixed the buffer size of the GDF File Reader to 100, because if I kept 32 (as it is originally set), I would've got a error message "The buffer size is not a multiple of the sampling frequency". I hope that it doesn't change anything.

Best regards,
Attachments
Tests2.zip
(42.94 KiB) Downloaded 254 times

yrenard
Site Admin
Posts: 645
Joined: Fri Sep 01, 2006 3:39 pm
Contact:

Re: OpenVibe & Matlab & Real-time

Post by yrenard »

Dear Johann,

Did you change the log level of the EBML stream spy boxes ? We don't have any log entry for those boxes anymore...

Also, I believe it is illegal to connect the Streamed Matrix output of the Matlab Filter to the Signal input of the GDF File Writer box. The designer still allows you to do it but the link appears in red. We have to discard this as it is confusing to most users I guess ;) Please use the CSV File Writer instead.

Yann

Johann
Posts: 9
Joined: Wed Jul 07, 2010 3:31 pm

Re: OpenVibe & Matlab & Real-time

Post by Johann »

Dear Yann,


After reevaluating the needs for our system, it turns out that the best solution is to send the data to Matlab via a TCP/IP server. We need the system to be as close as possible to real-time, that's why we can't use the Matlab Filter: it's too slow to use Matlab that way.

I appreciated your availability and your concern on the subject,


Johann

yrenard
Site Admin
Posts: 645
Joined: Fri Sep 01, 2006 3:39 pm
Contact:

Re: OpenVibe & Matlab & Real-time

Post by yrenard »

Dear Johann,

thank you for your feedback. Feel free to contribute any solution that fits your needs better. If you need this, then maybe other people in the community could benefit of your work as well.

Yann

jbrumberg
Posts: 5
Joined: Mon Jul 12, 2010 7:02 pm

Re: OpenVibe & Matlab & Real-time

Post by jbrumberg »

Hi All,

I am attempting to enable and configure the matlab box for OpenViBE running on an Ubuntu Linux installation. I have completed the steps suggested in the second post - and included my local path for matlab, mex, etc. in the linux-dependencies file. The Matlab filter box compiles correctly, but does not appear anywhere in the designer. Other "unstable" boxes do appear though. Has anyone managed to do this in Linux yet? If so, any suggestions?

Thanks,
Jon

yrenard
Site Admin
Posts: 645
Joined: Fri Sep 01, 2006 3:39 pm
Contact:

Re: OpenVibe & Matlab & Real-time

Post by yrenard »

Dear jbrumberg,

do you have any warning in the console while loading the plugin .so file (such as e.g. missing symbols) ? We had such issues recently on fedora. In such case, you may have to modify your LD_LIBRARY_PATH environment variable to point to the lib directory of Matlab.

Hope this helps,
Yann

Post Reply