I should convolve my signal with which function to have the signal itself?

1 次查看(过去 30 天)
I should convolve my signal with a function and have the signal itself. I read on the internet that dirac function will be the solution but I convolved it with my signal and all the points became NaN. I don't know what is the problem. I used the same time line as the time line of my signal.
  2 个评论
Benjamin Thompson
Benjamin Thompson 2022-7-11
Yes, symbolically the dirac function is the identify operation for convolution.
But if you are doing this in MATLAB there are a lot of questions such as whether you are doing it symbolically or numerically. Please sumit some code as an example.
2NOR_Kh
2NOR_Kh 2022-7-11
I used this loop:
for i=1:n
%for j=1:1%this is #of frames so for now I am just working on one frame
fgc(:,i)=conv(dirac(tt),e(:,i));
%fg(:,i)=filtfilt(Gt,10,e(:,i));
%end
end
actully I have a RF data of ultrasound that the final result is an image but each line of it is 1D signal, I can apply my conv in both 2D or 1D. In this loop, I applied it in 1D.

请先登录,再进行评论。

采纳的回答

2NOR_Kh
2NOR_Kh 2022-7-11
I find out my issue with dirac.
tt = -100:0.1:100
tt = 1×2001
-100.0000 -99.9000 -99.8000 -99.7000 -99.6000 -99.5000 -99.4000 -99.3000 -99.2000 -99.1000 -99.0000 -98.9000 -98.8000 -98.7000 -98.6000 -98.5000 -98.4000 -98.3000 -98.2000 -98.1000 -98.0000 -97.9000 -97.8000 -97.7000 -97.6000 -97.5000 -97.4000 -97.3000 -97.2000 -97.1000
y=dirac(tt);
idx=y==inf;
y(idx)=1;
plot(tt,y);

更多回答(1 个)

Paul
Paul 2022-7-11
Hi Donya,
dirac is only defined in the Symbolic Math Toolbox and so should only be used for symbolic math, and only for continuous time analysis as well.
The SMT has another function kroneckerDelta that can be cast to a double and used for discrete-domain processing as with conv().
But you can easily write your own unit pulse function for integer-valued input
u = @(n) double(n==0);
This function will, of course, work for non-integer input if that's needed for some reason.

类别

Help CenterFile Exchange 中查找有关 Signal Processing Toolbox 的更多信息

产品


版本

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by