Any MATLab DSP guys in the house?

GroupDIY Audio Forum

Help Support GroupDIY Audio Forum:

This site may earn a commission from merchant affiliate links, including eBay, Amazon, and others.

TomWaterman

Well-known member
Joined
Jun 4, 2004
Messages
1,151
Location
The Shire, UK
Hi!

A friend was showing me some stuff in MATLab today that I hadn't played with before.

Its a tool called SimuLink. It allows objects to be conifgured to create systems. I was wondering if this could be used to create a control architecture that could be converted to C+ and then dumped into a microprocessor like a PIC.

I thought it may be a way to quickly create advanced control systems and was wondering if anybody had any experience with this. Is it possible?

It seems to have object models for sliders, encoders, LED displays etc.

Cheers Tom
 
We use the Matlab for image processing on NMRI functional brain-scans.

Matlab can really do some pretty cool stuff - once you've learned programming it.

But expect a very steep learning curve..! :?

Jakob E.
 
That software is incredible - the things that it can do.....amazing.

I've played with it a bit, designed filters and created a convolution system.....interesting stuff but the very basics.

I just thought it might have its uses for a few DIY projects however so far I can't find much info on compiling MATLab code for use on a PIC.

I'll keep searching.....

Cheers Tom
 
It is possible to convert matlab code to C/C++ but the code you get is incredibly bulky and slow. Exactly what you don't want when you create embedded code.
I think you'd be better of just learning C.
I do a lot of dsp stuff in Matlab, but I use it just to try out ideas for VST-plugins and stuff. After that i hand-code it in C++ to make it usable. And that 's on a pentium proc. On a PIC you'd need even smaller/faster/smarter code.
 
[quote author="TomWaterman"]Oh well it was worth a try - thanks for the info Mendelt!

So what kinda VST plugs do you make? Synths or FX?

Cheers Tom[/quote]

I made a vocoder plugin with some code from a friend of mine. And I've got a synthesizer plugin and a compressor plugin that aren't quite ready. But since I've got a new hobby now i don't know If i"m gonna finish them at all :grin:

[quote author="clintrubber"]from Mendelt:
I'm Dutch. We kill babies

I'm Dutch as well but can't remember any killings on my side so far.... :roll:

Puzzled...[/quote]

I was asked by someone from America if we really kill babies in hospitals here. Seems there was a documentary on Fox about euthanasia on children without any life-expectancy in a hospital in groningen that they took waaaay out of proportion.. Maybe something for the Brewery..
 
ok so here's my bit of stupidity for the day.. I have no idea where to begin learning to code for MCUs.. is there any type of VISUAL program that allows you to drag and drop various things to come up with a program? i just want something to play with, nothing serious until i get the idea of how things work..

:thumb:
 
thanks tony, I was actually looking for something that would program regular microcontrollers to do various things though.. I don't even know if things like this exist.
 
I'm a Matlab guy...

I design control systems (linear and non-linear) using it, and do signal processing on flight test data. It's a great tool, but don't approach it like a regular programming language. Everything in Matlab is vectorized, and you really need to learn this in order to maximize computational efficiency. For example, I wrote a program in Matlab that converted Lattitude and Longitude data from a flight test into UTM format. When I wrote it as a giant FOR loop, it took about 20 min to execute on a 2.5 hour segment of data. When I converted all the operations to work in a vectorized format, I could process 2.5 hours worth of data in about 10 seconds.

Regarding Simulink, it's more oriented towards differential equation solving. Block diagrams for control systems, and modelling, and that sort of stuff. There is a real-time workshop plug-in that creates C/C++ code from the block diagrams, but like what's been said above it's not really optimized code. Most controller code is pretty simple though, and can be effectively hand coded in C. That's what I do...

Cheers,

Kris
 
For some basic understanding of microcontrollers you could start with programming Atmel microcontrollers. You can find midi projects for it on the net.

If you want to start programing audio stuff on more advanced µP , you could have a look at the Sound Art Chameleon. This is a 19" rackmodule with a motorola DSP inside. You can start programming audio stuff right away. They have a good website with lots of code examples for audio stuff. http://www.soundart-hot.com/english/index.htm
 
actually I'd like to start with power control stuff like pwm controllers and such, I figure this would be an easier place to start. but yeah the other engineers here use Atmel MCUs, ATmega8515/35 and the like, I always do the analog stuff but do see a future in microcontrollers that I don't see in analog parts since most of the parts I like using are now going the way of the dodo..
 
Thanks a lot for all fo your answers.

Mendelt - plugins sound cool. Is the compressor modelled on anything or it is entirely your own conception / algorithm / sound?

Svart - what your looking for, is what I'm looking for. I had hoped that Simulink could be used to create systems graphically, you know like Logic's environment? That would make the programming more interactive for me and less mundane, also a lot faster.

I guess it can be done but not too easily.

Kris, thanks for that - sounds like you do some kewl work. I had discovered the RTW plug-in online this morning. I guess its too hard to hand-optimise the code after its been complied by RTW into C?

Tony666 - I have looked at the Atmel stuff and downloaded their suite of programming software a while ago.

BUT

I have a project I'm trying to get off the ground + I have to use PICs for it. Its a university project and thats all they have, in terms of facilites like devlopment boards, debuggers etc.

Was going to use MPLab for programming the micros like you suggest Kris, but I just thought MATlab may be a cool thing to try out. Block diagram control systems are an appealing way to create. Imagine something like that for PICs - it would be like the DIY control systems version of Reaktor!

Thanks for all of your thoughts.

Cheers Tom
 
clintrubber wrote:
from Mendelt:
Quote:
I'm Dutch. We kill babies


I'm Dutch as well but can't remember any killings on my side so far....

Puzzled...


I was asked by someone from America if we really kill babies in hospitals here. Seems there was a documentary on Fox about euthanasia on children without any life-expectancy in a hospital in groningen that they took waaaay out of proportion.. Maybe something for the Brewery..
Right, I remember ! Yes, way out of...

Maybe something for the Brewery..
Right, better suited there - but I guess we're done about it - all clear: yes right we do that thing here in NL, and more...
 
I tried Labview last month for a couple of hours. The interface looks like Simulink, and a friend told me you can program pics with it.
I don't know how fast the generated code is but that's perhaps what you're looking for
 
Thanks tucdual!

Sounds interesting - I'll check it out.

I'm not planning on using the PICs for anything more then switching relays and something like an L.E.D display, so I don't think the code needs to be the fastest.

Cheers Tom
 

Latest posts

Back
Top