Author |
Message |
phoenix

Joined: Dec 09, 2005 Posts: 33 Location: munich, germany
G2 patch files: 1
|
Posted: Mon Oct 30, 2006 10:11 am Post subject:
Matlab/Simulink and Audio/Midi Subject description: Realtime rapid prototyping using rtw or rtai |
 |
|
Hello my friends,
Is anyone into analyzing or synthesizing MIDI/Audio signals using Matlab/Simulink realtime workshop (rtw)?
Or did anyone do it WITHOUT rtw? (As a simulation?)
How did you do it? Is it possible to access ASIO in realtime, has anyone built a Simulink block or written a matlab driver function which does this?
Greetings phoenix _________________ www.myspace.com/birdflame
talk to me per skype: electrobias
(My real name is Tobias  |
|
Back to top
|
|
 |
jksuperstar

Joined: Aug 20, 2004 Posts: 2503 Location: Denver
Audio files: 1
G2 patch files: 18
|
Posted: Mon Oct 30, 2006 7:42 pm Post subject:
|
 |
|
Are you an RTW user?!!!
I think the cost of the system is just generally prohibitive for your typical audio user My last (cancelled) project was designing & developing an PCI/FPGA card for RTW, which I had working, and still have all the code & drivers I wrote  |
|
Back to top
|
|
 |
phoenix

Joined: Dec 09, 2005 Posts: 33 Location: munich, germany
G2 patch files: 1
|
|
Back to top
|
|
 |
jksuperstar

Joined: Aug 20, 2004 Posts: 2503 Location: Denver
Audio files: 1
G2 patch files: 18
|
Posted: Tue Oct 31, 2006 12:38 pm Post subject:
|
 |
|
I haven't used rtai before, it seems similar to Simulink, but I wonder how common the drivers are? I have no idea, but I've heard RTW is based on something other than windows, dos, or linux (I'm speaking of the target, not the host).
Anyway, on an RTW target, using a very fast system, I was able to get down to 33usec timing resolution, running little code. My aim was to run 40kHz servo loops, but obviously couldn't get there. Still, it was very useable. I wonder how close RTAI can get to that. I suppose it depends on how much of a kernel & linux system you are running. |
|
Back to top
|
|
 |
jksuperstar

Joined: Aug 20, 2004 Posts: 2503 Location: Denver
Audio files: 1
G2 patch files: 18
|
|
Back to top
|
|
 |
phoenix

Joined: Dec 09, 2005 Posts: 33 Location: munich, germany
G2 patch files: 1
|
Posted: Wed Nov 01, 2006 10:03 am Post subject:
|
 |
|
Quote: |
I have no idea, but I've heard RTW is based on something other than windows, dos, or linux (I'm speaking of the target, not the host).
|
RTW can have as target all sorts of systems: PCs, Embedded controllers etc.
RTAI is a Linux specific realtime-interface which has to be compiled as module into the kernel. RTAI considers Linux as a background task running when no real time activity occurs.
Simulink can compile code that uses RTAI as realtime communication interface (Simulink models can be compiled and run outside Matlab/Simulink in realtime using RTAI and RTW).
I think I could use linux' JACK as audio/midi interface, connected to my audio/midi card. If an interface from Jack to RTAI exists, I think I could code synthesis and analysis tools quickly using matlab/simulink. Has anyone done this? _________________ www.myspace.com/birdflame
talk to me per skype: electrobias
(My real name is Tobias  |
|
Back to top
|
|
 |
phoenix

Joined: Dec 09, 2005 Posts: 33 Location: munich, germany
G2 patch files: 1
|
Posted: Wed Nov 01, 2006 10:14 am Post subject:
|
 |
|
I think that is a very interesting idea. We should discuss this. RTAI is spreading in control engineering where the realtime affordances are very tight. And it is open source. If you want to turn your linux-PC into a no-nonsense realtime system, it might be the best choice. _________________ www.myspace.com/birdflame
talk to me per skype: electrobias
(My real name is Tobias  |
|
Back to top
|
|
 |
jksuperstar

Joined: Aug 20, 2004 Posts: 2503 Location: Denver
Audio files: 1
G2 patch files: 18
|
Posted: Wed Nov 01, 2006 5:06 pm Post subject:
|
 |
|
I was speaking of compiling RTW in "stand alone" mode, where you boot up a PC with the special RTW floppy/CD, then a seperate PC running the simulink/rtw host connects & controls it. The other methods of running under windows, linux, etc, don't come close to the performance of stand-alone mode (as would be expected).
I did a fair amount of research, and the preemption and low-latency patches (now almost entirely part of the kernel source from 2.6.18 on) offer basically the same performance as RTAI does. Rather than bury linux proper on a layer "beneath" RTAI, the PREEMPT_RT patches modify the kernel to allow all the necessary spinlocks and preemption to hit a very low latency, real-time target. This allows one to use the same Linux API, rather than a seperate API like RTAI has.
I am already running this kernel, and can get below 2ms latency on a system that couldn't get below 12ms on Windows or standard Linux kernels. I think this is very good, and on a newer system (or PPC) would have even better IRQ response.
So, really, this type of effort may be a serious waste of time.  |
|
Back to top
|
|
 |
|