11-28-2024 07:45 AM
Hi everyone,
I’m working on calculating the convolution sum in the frequency domain for two discrete-time systems. My approach so far has been to shift one signal element by element while keeping the other fixed. At each iteration, I multiply the two signals and compute the summation of all elements in the resulting array to get each point p(i)p(i)p(i). However, the results are not as expected.
Does anyone know the proper algorithm for this or what I might be doing wrong? Any advice would be greatly appreciated!
Thanks in advance!
Solved! Go to Solution.
11-28-2024 10:47 AM
LabVIEW has 1D and 2D convolution built-in. That's probably all you need. (unless you only have "LabVIEW base").
Can you attach a simple VI with some typical data so we can see what you are doing? We don't know what results you "expect", so it could even be that your expectations are wrong.
11-28-2024 11:44 AM
So I'm trying to do a convolution of two Fourier Transforms, one for Voltage and one for current. I have the fourier transform of both and I need to convolute them in order to obtain the power.
But I don't get the correct result.
In the attached picture is how I'm trying to do it.
I think there might be a problem due to the fact that Fourier Transform are complex number.
I don't know how to handle it, should I convolute the real part and imaginary part separately (or with the 2-D convolution) and then reconstruct the power vector?
11-28-2024 12:09 PM - edited 11-28-2024 12:12 PM
For a circular convolution, you would just multiply the two complex transforms and transform back
As a first step, you need to do some basic LabVIEW tutorials and learn about the principles of dataflow. You have two independent code segments that run in parallel and the one on top runs exactly once while the bottom is a while loop masquerading as a FOR loop because the number of iterations are known before the loop even starts. I assume you think that number of iterations should depend on the size of the input arrays, right? So why is it a constant? There is no way to tell in what order the locals are read or written.
In LabVIEW, "the wire is the variable" and determines execution order. You should not need any local variables or sequence structures at all! (terminals are just for communicating with the user, they should not be abused for data shuffling).
Of course we cannot really run or debug pictures, so please attach your actual VI and some typical data. Make sure to "save for previous" (2020 or below) so more have a change to inspect.
11-29-2024 09:27 AM
So Basically this is what I have to do:
Develop a virtual instrument that
The following graphs must be shown:
11-29-2024 11:14 AM
@altenbach wrote:
Make sure to "save for previous" (2020 or below) so more have a change to inspect.
I cannot look at your code at the moment because whatever you attached is in LabVIEW 2023. Sorry.
11-29-2024 11:17 AM
now it is in 2013
11-29-2024 11:36 AM - edited 11-29-2024 11:38 AM
Your code suffers severely from localitis and sequenceitis, typically indicating that you are a seasoned text programmer with very little LabVIEW experience. I am sure it could be done right with flat code that fits on a postcard. 😄
Did you notice the red coercion dots? Wiring a complex local variable to an EXT indicator seem unusual. Your M and N should probably be blue (I32), right?
Can you make sure that all controls contain typical data? Currently all inputs are zero or empty arrays, which is not useful for testing. I assume this is a subVI, but there are no connectors assigned, so how exactly are you testing this??? The problem with local variable overuse is also that it blurs the difference between control (data source) and indicator (data sink). It is very difficult to tell what are inputs or outputs.
Can you assign reasonable values to all controls, select all controls and do a "edit...make selected values default". Save under a new name and attach again after saving for previous.
11-29-2024 11:44 AM
Add all control. I'm so sorry for all these misunderstandings, it is my first LabView project, and I'm getting crazy trying to figure out everything from scratch.
I also think the problem is in the ext variable but I'm really clueless about what to do next.
All adjustaments and feedbacks are welcome
11-29-2024 11:49 AM