Convolution in Simulink Wrong? element-wise multiplication instead of convolution 2018b
Show older comments
Block diagram is very simple like this 

simData.xt, simData.ht are periodic trigonometric polynomial signals (fourier series) and are imported from MATLAB workspace variables with cyclic repetition enabled.
The output with both convolution and FIR filtering return element-wise multiplication result between the two inputs.
This is confirmed by checking the result against element-wise mulitiplication manually, as well as through Code Generation, which returns this block:
```
84 /* S-Function (sdspconvcorr): '<Root>/Convolution1' incorporates:
85 * DiscreteFir: '<Root>/Discrete FIR Filter'
86 * Outport: '<Root>/output1'
87 * Outport: '<Root>/output2'
88 */
90
91 /* Outport: '<Root>/y_conv' incorporates:
92 * S-Function (sdspconvcorr): '<Root>/Convolution1'
93 */
95
96 /* Outport: '<Root>/y_fir' */
```
At link 89, we see that the y_conv_tmp result is just a multiplication of the two signals (which are sent to output ports in this case).
--
I'm sure I'm doing something wrong but can't figure out what.
Accepted Answer
More Answers (0)
Categories
Find more on Signal Attributes and Indexing in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!