Amplitude of the convoluted signal?
18 views (last 30 days)
Show older comments
Hi all,
i'm modelling some measurement devices and I need the conv function of Matlab.
Hence, lets define A = conv(B, C); where B has 20 k points and C 5 k points. A will have 24999 points, but what happens to its amplitude? I've tried thousand of simulations but i cannot see any relation between the amplitudes. In other words, I always find that A amplitude has a coefficient factor but i don't know where it cames from.
I've already tried introducting the samplimg frequency of the signals, but nothing.
Thank you in advance.
0 Comments
Answers (3)
Pawel Jedrejko
on 4 Aug 2021
For anyone looking for an answer in future:
I had the same problem, then I found in the documentation that conv() is actually just multiplying and summing, not 'integrating'.
Multiplying the output times dx (discretization step size) does the job.
2 Comments
Image Analyst
on 13 Feb 2022
Yes, the x "units" of the result are the same as for the inputs, which should both have the same units. So if you just want "elements" as the units, it's that way already. However if you consider the units to be units of time, like the distance between two adjacent elements is 1 millisecond, then the output will be the sum of the values of the first signal times the second signal, summed up. Where the signals don't overlap, as the one slides past the other, the sum is zero there. If you want the output to be an "integration" like an area with units of (y units) * (x units) you'd have to multiply the result by the "delta x" distance, like 1 millisecond. It's like if you pretend the signal is a bar chart and to get the area of the bar you multiply by the y value of the bar (which has the units of the first signal) by the units of the width of the bar, which is either unitless (meaning just elements) or units of the x axis (liek one bar is 1 millisecond wide). The units of the second signal, the "kernel" are usually unitless since it's basically weighting factors that get multiplied by the first signal. This will get you the area of all the bars in real world units.
Mahesh Taparia
on 16 Mar 2020
Hi
The amplitude of the convoluted signal will be the sum of the product of elements of the two vectors with different range of those vector indices. For more information check the formula of the convolution in the documentation page
4 Comments
Mahesh Taparia
on 19 Mar 2020
There is a relation between z and x,y. The conv function works as per the convolution formula.The link to that formula I already shared in my previous reply.
Image Analyst
on 5 Aug 2021
If you don't want the convolved signal to be in a different range than the input signal, make sure that the kernel sums to 1. For example
windowSize = 5;
kernel = randi(99, 1, windowSize); % Whatever filter you want.
% Normalize to 1
kernel = kernel / sum(kernel(:));
outputSignal = conv(inputSignal, kernel, 'same');
Now the overall mean of the output will equal the overall mean of the input, so mean(outputSignal) will equal mean(inputSignal).
0 Comments
See Also
Categories
Find more on Measurements and Feature Extraction 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!