why there are two different comands for calculating convolution of two vectors?

9 views (last 30 days)
What is the use of conv, when cconv can perform both linear as well as cicular convolution by choice of passing third argument.
Please guide
  1 Comment
Walter Roberson
Walter Roberson on 12 Nov 2021
Edited: Walter Roberson on 13 Nov 2021
You have to know the padding requirements to use circular convolution as equivalent.
Also, for code generation, linear convolution is easier to generate code for, including potentially parallel HDL for some data types.

Sign in to comment.

Accepted Answer

Bjorn Gustavsson
Bjorn Gustavsson on 12 Nov 2021
The answer to:
why
returned: "To please all."
That might be more of a matlab in-joke, but a true answer can only (possibly) be given by Mathworks and this seems unlikely to happen - for reasons of business-privacy reasons, and even if they tried it would likely not be a complete and correct answer due to the "fog of time". The two functions are in different toolboxes, cconv is in my signal-processing toolbox, while conv is in the datafun toolbox, this makes the former an add-on while the latter is included in even the most basic matlab-package. To my memory the conv-function is older than cconv which makes its existens if for no other reason an issue of backward compatibility. In addition conv also allows the setting of the output size by the flags 'same', 'valid' and 'full' which my version of cconv does not.
This answers your question.
As an advice for programming for other users that might not have the same toolboxes available check what toolboxes you are using by checking which functions you are using. You can do that by explicitly calling which:
which cconv -all
and get the full list of which cconv-functions you have, or after the completion of your function/script/toolbox you could use:
matlab.codetools.requiredfilesandproducts, or look at the following links:
HTH
  4 Comments
Walter Roberson
Walter Roberson on 15 Nov 2021
In my opinion, it isn't really a toolbox if it cannot be installed separately (assuming all prerequisites are present.)
Now... it does get a bit fuzzy as to what the difference is between a "toolbox" and a "support package".

Sign in to comment.

More Answers (0)

Community Treasure Hunt

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

Start Hunting!