DSPRelated.com
Forums

Simulink+(PC or DSP) for real time?

Started by MA February 11, 2009
Dear all,

I need to implement a real-time feedback ANC (active noise control)
algorithm, and I'd like to know what you experts think, should I try to run
it on a PC with Simulink and a RME soundcard, or on a C6711 DSP board with
code generated by Simulink? Latency is critical for the performance of the
algorithm. I have made a new .dll with ASIO drivers for the "From Audio
Device" block in Simulink, but the latency is still unacceptable. Is this a
problem which can be solved, or do a *need* to use a DSP? 

This whole thing is going to be a lab for the students of a course in
adaptive signal processing, I have very little experience with real-time
systems and the same probably goes for the students.

Any help is much appreciated!

Have a great day!

/ M
"MA" <oooncs@yahoo.se> writes:

> Dear all, > > I need to implement a real-time feedback ANC (active noise control) > algorithm, and I'd like to know what you experts think, should I try to run > it on a PC with Simulink and a RME soundcard, or on a C6711 DSP board with > code generated by Simulink? Latency is critical for the performance of the > algorithm. I have made a new .dll with ASIO drivers for the "From Audio > Device" block in Simulink, but the latency is still unacceptable. Is this a > problem which can be solved, or do a *need* to use a DSP? > > This whole thing is going to be a lab for the students of a course in > adaptive signal processing, I have very little experience with real-time > systems and the same probably goes for the students. > > Any help is much appreciated!
Latency is going to be much easier to minimize on a DSP like the C6711. There are too many unknowns and/or uncontrollables (or "not practically controllables") like the operating system interrupt latencies, interrupt priorities, multiple levels of buffering, etc., under something like Windows. If latency is a big issue, the choice is clear. -- % Randy Yates % "The dreamer, the unwoken fool - %% Fuquay-Varina, NC % in dreams, no pain will kiss the brow..." %%% 919-577-9882 % %%%% <yates@ieee.org> % 'Eldorado Overture', *Eldorado*, ELO http://www.digitalsignallabs.com
On 11 Feb, 17:19, Randy Yates <ya...@ieee.org> wrote:
> "MA" <ooo...@yahoo.se> writes: > > Dear all, > > > I need to implement a real-time feedback ANC (active noise control) > > algorithm, and I'd like to know what you experts think, should I try to run > > it on a PC with Simulink and a RME soundcard, or on a C6711 DSP board with > > code generated by Simulink? Latency is critical for the performance of the > > algorithm. I have made a new .dll with ASIO drivers for the "From Audio > > Device" block in Simulink, but the latency is still unacceptable. Is this a > > problem which can be solved, or do a *need* to use a DSP? > > > This whole thing is going to be a lab for the students of a course in > > adaptive signal processing, I have very little experience with real-time > > systems and the same probably goes for the students. > > > Any help is much appreciated! > > Latency is going to be much easier to minimize on a DSP like the C6711. > There are too many unknowns and/or uncontrollables (or "not practically > controllables") like the operating system interrupt latencies, interrupt > priorities, multiple levels of buffering, etc., under something like > Windows. > > If latency is a big issue, the choice is clear.
If I understand the OP correctly, he will use simulink to produce the code that eventually will run on the DSP. Is this likely to result in fast enough code, or does he need to hand-craft the code as well? Rune

MA wrote:

> Dear all, > > I need to implement a real-time feedback ANC (active noise control) > algorithm, and I'd like to know what you experts think, should I try to run > it on a PC with Simulink and a RME soundcard, or on a C6711 DSP board with > code generated by Simulink?
Whatever you do, you will be f... :)))))) My dear friend, the problem of the ANC as itself is enough complicated to outweigth the minor technical difficulties of Simulinks and C6711s. Once you have the working algorithm, it would be very trivial to launch it either on PC or on DSP board.
> Any help is much appreciated!
How much is "much appreciated" ? Vladimir Vassilevsky DSP and Mixed Signal Design Consultant http://www.abvolt.com
Vladimir Vassilevsky wrote:
> > > MA wrote: > >> Dear all, >> >> I need to implement a real-time feedback ANC (active noise control) >> algorithm, and I'd like to know what you experts think, should I try >> to run >> it on a PC with Simulink and a RME soundcard, or on a C6711 DSP board >> with >> code generated by Simulink? > > Whatever you do, you will be f... :)))))) > > My dear friend, the problem of the ANC as itself is enough complicated > to outweigth the minor technical difficulties of Simulinks and C6711s. > Once you have the working algorithm, it would be very trivial to launch > it either on PC or on DSP board.
Even with the long and variable latency that the PS's operating system introduces? ... Jerry -- Engineering is the art of making what you want from things you can get. &#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;

Randy Yates wrote:

> "MA" <oooncs@yahoo.se> writes: > >>I need to implement a real-time feedback ANC (active noise control) >>algorithm,
> Latency is going to be much easier to minimize on a DSP like the C6711. > There are too many unknowns and/or uncontrollables (or "not practically > controllables") like the operating system interrupt latencies, interrupt > priorities, multiple levels of buffering, etc., under something like > Windows. > > If latency is a big issue, the choice is clear.
An audio DAC + ADC delay is at the order of 1ms already, which could make the ANC problematic. The practical minimum turnaround delay in Windows is in the ~tens of milliseconds range. Vladimir Vassilevsky DSP and Mixed Signal Design Consultant http://www.abvolt.com
Hi,

There is actually a demo that ships with this TI C6000 target product for 
Simulink that does something very similar to what you are considering 
(adaptive audio processing on a C6711 DSP board with code generated by 
Simulink / Real-Time Workshop Embedded Coder):
http://www.mathworks.com/cmsimages/tt_acoustic_wl_11823.jpg

See the section "Using the Board Support Library" here for more info:
http://www.mathworks.com/products/tic6000/description3.html

And here is the start of the product overview:
http://www.mathworks.com/products/tic6000/

Cheers,
Steve

"MA" <oooncs@yahoo.se> wrote in message 
news:R6mdnWlQFMszag_UnZ2dnUVZ_tzinZ2d@giganews.com...
> Dear all, > > I need to implement a real-time feedback ANC (active noise control) > algorithm, and I'd like to know what you experts think, should I try to > run > it on a PC with Simulink and a RME soundcard, or on a C6711 DSP board with > code generated by Simulink? Latency is critical for the performance of the > algorithm. I have made a new .dll with ASIO drivers for the "From Audio > Device" block in Simulink, but the latency is still unacceptable. Is this > a > problem which can be solved, or do a *need* to use a DSP? > > This whole thing is going to be a lab for the students of a course in > adaptive signal processing, I have very little experience with real-time > systems and the same probably goes for the students. > > Any help is much appreciated! > > Have a great day! > > / M
Thank you Randy, Rune, Vladimir, Jerry and Steve! I have now decided to buy
a C6713 DSK. 

Vladimir, I am all too aware of how difficult the ANC problem is:) But the
professor I am working for has designed a pretty nifty algorithm so I hope
we can make it work in practice, outside the world of block diagrams.

Thanks again everyone!
Rune Allnor <allnor@tele.ntnu.no> writes:

> On 11 Feb, 17:19, Randy Yates <ya...@ieee.org> wrote: >> "MA" <ooo...@yahoo.se> writes: >> > Dear all, >> >> > I need to implement a real-time feedback ANC (active noise control) >> > algorithm, and I'd like to know what you experts think, should I try to run >> > it on a PC with Simulink and a RME soundcard, or on a C6711 DSP board with >> > code generated by Simulink? Latency is critical for the performance of the >> > algorithm. I have made a new .dll with ASIO drivers for the "From Audio >> > Device" block in Simulink, but the latency is still unacceptable. Is this a >> > problem which can be solved, or do a *need* to use a DSP? >> >> > This whole thing is going to be a lab for the students of a course in >> > adaptive signal processing, I have very little experience with real-time >> > systems and the same probably goes for the students. >> >> > Any help is much appreciated! >> >> Latency is going to be much easier to minimize on a DSP like the C6711. >> There are too many unknowns and/or uncontrollables (or "not practically >> controllables") like the operating system interrupt latencies, interrupt >> priorities, multiple levels of buffering, etc., under something like >> Windows. >> >> If latency is a big issue, the choice is clear. > > If I understand the OP correctly, he will use simulink to > produce the code that eventually will run on the DSP. Is this > likely to result in fast enough code, or does he need to > hand-craft the code as well?
Sorry for the delay (no pun intended!) in responding, Rune. You bring up a good point. To be honest, I don't know. I don't have any experience with generating simulink code. -- % Randy Yates % "Rollin' and riding and slippin' and %% Fuquay-Varina, NC % sliding, it's magic." %%% 919-577-9882 % %%%% <yates@ieee.org> % 'Living' Thing', *A New World Record*, ELO http://www.digitalsignallabs.com
"MA" <oooncs@yahoo.se> wrote in news:1N-
dnQQQhNb_RAvUnZ2dnUVZ_tzinZ2d@giganews.com:

> Thank you Randy, Rune, Vladimir, Jerry and Steve! I have now decided to buy > a C6713 DSK. > > Vladimir, I am all too aware of how difficult the ANC problem is:) But the > professor I am working for has designed a pretty nifty algorithm so I hope > we can make it work in practice, outside the world of block diagrams. > > Thanks again everyone!
You might look at Audio Weaver for this. It does run in real time. We have a demo board or you can run on a PC. It uses Matlab scripts. Al Clark Danville Signal Processing, Inc.