Alignsignals not supported for C code generation

1 view (last 30 days)
Hello everybody,
I am trying to align signals with Matlab function that is supported for C generation according to its website. But, when I open the Coder says that is not supported. Does anyone know how to fix this problem? If I have to make my own function, can anyone tell me where i can fin a good implementation?
Thanks in advance,
Javi
  2 Comments
Adam
Adam on 18 Aug 2017
Edited: Adam on 18 Aug 2017
What version of Matlab are you using? For some reason that function's help page does not say when it was introduced as most do, though I know it was recent. It is possible that the version it was introduced it was not supported for C code generation, but has been made so in subsequent versions (my help for R2017a says it is supported). If you have an earlier version that could be the cause.
It is basically just a wrapper function for some simple functionality based on xcorr though, with a huge amount of validation and argument checking added in to make it look more complicated than it is! Find the lag giving the best correlation and move one or other signal by the appropriate amount. I haven't used alignsignals myself so I don't know what options it has for dealing with the ends of signals that are not matched and any other issues, but you can easily handle those for your own usage.
Javier Naranjo
Javier Naranjo on 18 Aug 2017
Edited: Javier Naranjo on 29 Aug 2017
I am usigna 2016b. That is why I am worried because I thought it was new enough for that support.
Thanks for answering.

Sign in to comment.

Accepted Answer

Steven Lord
Steven Lord on 18 Aug 2017
The "Extended Capabilities" section of the documentation page for alignsignals (which describes the functionality available in the most recent release, currently release R2017a) indicates that it is supported for code generation using MATLAB Coder.
Looking in the Release Notes for Signal Processing Toolbox I see that support for C and C++ code generation from the alignsignals function was introduced in release R2017a. So no, this support is not available in the release R2016b version of the toolbox.
In response to a part of Adam's comment: it is true that not all function pages contain information about when a function was introduced. I don't work in our documentation group so I don't know if there is a plan to revise all the older functions' pages to include that information or when that would occur. But another way to see when a function was introduced is to use the Release Notes. The section to which I linked goes back to release R2015a (and you could extend the range as far back as R14SP2, released in 2005) and that's far enough back to show that alignsignals was introduced in release R2015b.

More Answers (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!