Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Convolution in Simulink

386 views
Skip to first unread message

Michael Harris

unread,
Nov 14, 2016, 7:44:09 PM11/14/16
to
I am trying to use either the convolution or FIR block within Simulink to convolve a BLWN vector and a FIR Function. Whenever I use the blocks in Simulink, I only get the multiplication of the values of the BLWN signal by the corresponding values in the FIR function for any given time sample which is not a convolution of the two signals. I have seen the thread by Murad (https://www.mathworks.com/matlabcentral/newsreader/view_thread/123786) and I have tried everything that I could see to do and have not seen any final resolution of his/my problem with the Simulink convolution of the time signals. Here is my process:

In MATLAB:
Define a system with mass, damping, and stiffness parameters
Define a transfer function of the corresponding system
Define the impulse response function as a vector from the transfer function

In Simulink:
Load the IRF into Simulink with a "from workspace" block
Generate a BLWN signal as the excitation of the system
Use either a "conv" or "Discrete FIR Filter" block

The resulting output is either a multiplication of the time histories if I use the Discrete FIR Filter with the FIR as an input port, a nonsensical nxm matrix if I input the FIR from dialogue parameters where n=number of samples in the excitation and m=number of samples in the FIR, or a multiplication of the two time vectors (not convolution) if I use the "conv" block.

Could someone tell me how to get an actual convolution of the two signals? Is there some parameter within the conv or discrete FIR Filter blocks that I need to change in order to get an actual convolution?

Thank you very much, and let me know if you need any clarification.

Mike

Navan Ruthramoorthy

unread,
Nov 15, 2016, 8:34:11 AM11/15/16
to
"Michael Harris" wrote in message <o0dloj$mum$1...@newscl01ah.mathworks.com>...
Mike,

What is the size of your input signal to FIR filter block? Also what setting do you use for "Input Processing" parameter in FIR Filter block? For filtering all input samples as one time series, the input needs to be a column vector with "Input processing" parameter set to "Columns as channels (frame based)". Otherwise each input sample may be treated as a separate channel.

The convolution block performs convolution between two current inputs. It does not carry any states. If the two inputs are vectors your output will be convolution result of the two vectors. If one of them is a scalar you will get multiplication of that scalar in the output.

Navan

Michael Harris

unread,
Nov 15, 2016, 9:29:08 AM11/15/16
to
I have found the solution to using to the blocks. In order to perform the convolution using a FIR Function, you must store the IRF as a 1xn vector WITHOUT the time vector included in the matrix. I included the time vector within the IRF because if you input the IRF with the "from workspace" block in simulink, it tells you that the time vector must be included in the IRF variable. If you use the IRF vector without the time included and use the discrete FIR Filter block with the IRF as a dialogue input and select the frame based input processing, the convolution is performed. Let me know if you have any questions, and thank you to everyone that took their time to assist me.

Mike
0 new messages