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

조회 수: 2 (최근 30일)
2NOR_Kh
2NOR_Kh 2022년 7월 11일
답변: Paul 2022년 7월 11일
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에서 Applications에 대해 자세히 알아보기

제품


릴리스

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by