Amplitude of the convoluted signal?

18 ビュー (過去 30 日間)
Alessandro Mingotti
Alessandro Mingotti 2020 年 3 月 12 日
コメント済み: Image Analyst 2022 年 2 月 13 日
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.

回答 (3 件)

Pawel Jedrejko
Pawel Jedrejko 2021 年 8 月 4 日
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 件のコメント
Justin Kim
Justin Kim 2022 年 2 月 13 日
Thank you this was super helpful!
Image Analyst
Image Analyst 2022 年 2 月 13 日
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
Mahesh Taparia 2020 年 3 月 16 日
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 件のコメント
Alessandro Mingotti
Alessandro Mingotti 2020 年 3 月 19 日
Hi,
i'm trying to find a relation between the amplitudes of the convoluted signals and the result of the convolution.
Here my example of code. Sinc of amplitdue 1, sine with amplitude 1. The amplitude of the convolution must have a relationship between those two, but I cannot find it
clear all
close all
N = 201;
K = 10;
NsuK = N/K;
f = 50;
% sinc
m = -(N-1)/2 : 1: (N-1)/2;
x = sin(pi*m*K/N)./sin(pi*m/N)/K;
NaN = find(isnan(x));
x(NaN) = K/K;
% sine
m1 = -4*(N-1)/2 : 1: 4*(N-1)/2;
y = sin(2*pi*m1*8/length(m1));
% Conv
z = conv(y, x);
plot(x)
Mahesh Taparia
Mahesh Taparia 2020 年 3 月 19 日
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
Image Analyst 2021 年 8 月 5 日
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).

カテゴリ

Help Center および File ExchangeMeasurements and Feature Extraction についてさらに検索

製品


リリース

R2019b

Community Treasure Hunt

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

Start Hunting!

Translated by