Verfasst am: 02.05.2016, 19:26
Titel: convolution without conv. result is wrong amplitude&shif
hello everyone , i just wrote my matlab code and it appears to be right (2 rectangles convoluted), the only problem i get is that i should have as a result : triangle centered at the 0 point width = 2 and amplitude of 4 . the result i get is shifted and has 4000 amplitude. i also implemented the ready to use conv. function , and it gives me the right answer . please help me correcting my code to match the resuld of the conv. function.
the matlab code is in the rar file .
thanks allot
function[YY,NN] = convolution3(x,n,h,m)
N = length(n);
M = length(m);
tstart = min(min(n), min(m));
NN = tstart : tstart + N+M-2;
for i= 0 : length(NN)-1
YY(i+1) = 0;
k=0;
while i-k >=0 if(k+1<=N)&&(i-k+1<=M)
YY(i+1) = YY(i+1) + x(k+1)*h(i-k+1);
end
k = k+1;
end end end end
Verfasst am: 03.05.2016, 08:56
Titel: Re: convolution without conv. result is wrong amplitude&
Dear zxzzxz,
Please do not cross-post a question in different forums, because this wastes the time of the vountary helpers, if they pos an answer which has given by someone else already.
If you have a good reason for cross-posting, meantion this at least and add links to the other thread. Thanks.
You can compare your result with many other published solutions for the same problem. Please ask your favorite search engine for "Matlab convolution without conv".
Dear moderator , please delete my Question and code.
thanks allot.
Einstellungen und Berechtigungen
Du kannst Beiträge in dieses Forum schreiben. Du kannst auf Beiträge in diesem Forum antworten. Du kannst deine Beiträge in diesem Forum nicht bearbeiten. Du kannst deine Beiträge in diesem Forum nicht löschen. Du kannst an Umfragen in diesem Forum nicht mitmachen. Du kannst Dateien in diesem Forum posten Du kannst Dateien in diesem Forum herunterladen
MATLAB, Simulink, Stateflow, Handle Graphics, Real-Time Workshop, SimBiology, SimHydraulics, SimEvents, and xPC TargetBox are registered trademarks and The MathWorks, the L-shaped membrane logo, and Embedded MATLAB are trademarks of The MathWorks, Inc.