# convolving 1D filter in 1D signal

9 visualizzazioni (ultimi 30 giorni)
2NOR_Kh il 19 Mar 2022
Commentato: 2NOR_Kh il 10 Apr 2022
I have a filter with this eq:
GH2=4*t^2*exp(-t^2) - 2*exp(-t^2);
E2=3*sqrt(pi/2);
GHE2=GH2/sqrt(E2);
the t here is a 1*6787 array of numbers, I should convolve my 1d signal; here e(t) with this filter, each of those ts in the above eq coresponds to the t here in e(t), now for convolution I am using the folowing loop, but those ts that I am choosing for my filter make the whole calculation to be elementwise, so I cant convolve my signal with this filter.
Now my question is what should I do to make this filtering process correctly?
for i=1:m
for j=1:n
e=RF_scan(i,j,:);
t1=t(1,i);
GH2=4*t^2.*exp(-t^2) - 2*exp(-t^2);
E2=3*sqrt(pi/2);
GHE2=GH2./sqrt(E2);
e_low=conv(e,GHE2);%this part has an error that convolution is not for elementwise operations
filteredl(i,j,:)=e_low;
end
end
##### 0 CommentiMostra -2 commenti meno recentiNascondi -2 commenti meno recenti

Accedi per commentare.

### Risposte (1)

Chandra il 6 Apr 2022
Hi,
For 1D convolution the two signals should be vector form while doing convolution.
If e is 1D then use Conv function .
If e is 2D then try using Conv2 function.
>>e_low=conv2(e,GHE2);
##### 1 CommentoMostra -1 commenti meno recentiNascondi -1 commenti meno recenti
2NOR_Kh il 10 Apr 2022
Tnx Chandra, but this problem itself is 1D and the problem is not convolution itself. I changed the way to program this entirely and fixed it.

Accedi per commentare.

### Categorie

Scopri di più su Matched Filter and Ambiguity Function in Help Center e File Exchange

R2021a

### Community Treasure Hunt

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

Start Hunting!

Translated by