11-29-2024 11:49 AM
I uploaded the wrong version, wait here it is corrected
11-29-2024 11:50 AM
@altenbach can you see this final VI correctly?
It's in 2019 with all the datas
11-29-2024 12:09 PM
Yes, this works and produces output. You say that the result is not as expected. What is the expected result?
(Sorry, I need to switch to my desktop later. my laptop screen is not big enough to efficiently look at this)
11-29-2024 12:13 PM
I should be obtaining the same graph I obtain in MatLab (the output of waveform graph 3). The output of matlab is attached.
You're really kind btw thank you so much for your help!
I will probably look at your adjustments tomorrow morning (I'm in Italy), so feel free to do it when you have time 🙂
11-29-2024 12:29 PM
I can attach the MatLab code that works and does the convolution correctly.
11-29-2024 12:52 PM
Sorry, I no longer do text based code*. Can you save your Matlab output for the current inputs to a simple text file?
*(I did text based code from 1973 to 1996, switched to LabVIEW 4.0 and never looed back since 😄 )
11-29-2024 12:56 PM
The output is the graph attached in the previous message (It's in png format).
Do you prefer another format for images? I can't turn an image into a txt.
11-29-2024 05:38 PM
@gaiab03 wrote:
I should be obtaining the same graph I obtain in MatLab. The output of matlab is attached. 🙂
If you need to obtain same output as from given script,
clear all
a=zeros(200, 1);
a(2,1)=-150i;
a(4,1)=-100i;
a(6,1)=-50i;
a(102,1)=-150i;
a(104,1)=-100i;
a(106,1)=-50i;
a(100,1)=150i;
a(98,1)=100i;
a(96,1)=50i;
a(200,1)=150i;
a(198,1)=100i;
a(196,1)=50i;
b=zeros(200, 1);
b(2,1)=-250i;
b(4,1)=-100i;
b(102,1)=-250i;
b(104,1)=-100i;
b(100,1)=250i;
b(98,1)=100i;
b(200,1)=250i;
b(198,1)=100i;
c=zeros(200, 1);
for i=1:1:200
l=200;
for k=1:1:200
if i-k>0
c(i)=c(i)+a(k)*b(i-k);
else
c(i)=c(i)+a(k)*b(l);
l=l-1;
end
end
end
% Plot the histogram of abs(c)
figure(1);
bar(1:200, abs(c)); % Plot the absolute values of c
xlabel('Array Indexes');
ylabel('Amplitude');
title('Histogram of abs(c)');
grid on;
then it could be like this:
The graphs are the same:
And values are identical:
Some issues may present, but hopefully the overall idea is clear more or less.
11-30-2024 04:12 AM
Thank you so much!
You're really helped me a lot!
The solution works also on my project
11-30-2024 10:04 AM - edited 11-30-2024 10:08 AM
@Andrey_Dmitriev wrote:
@gaiab03 wrote:
I should be obtaining the same graph I obtain in MatLab. The output of matlab is attached. 🙂
If you need to obtain same output as from given script,
.
It is just a circular convolution and all you need is code the size of a postage stamp. The following gives the same result!
I changed the cosmetics of the graph to show both as points. Modify as desired.
Of course the lingering question is if this is really what you need. 😄