LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

convolution vi

Solved!
Go to solution

Hi all,

 

I have two Gaussian and Lorentzian profiles which their convolution should be a Voigt profile. I am simply using convolution.vi, however the result is not then thing I expect. I have attached my Front Panel and Block Diagram. As you can see the Voigt (G*L) is much much weaker than both G and L. Also, the central point has been shifted by 500 points!

Would anyone please help me to figure out what the problem is?

 

Thank you,

Soran

Download All
0 Kudos
Message 1 of 14
(4,727 Views)
Solution
Accepted by topic author Soran

 

I figured it out Smiley Happy

0 Kudos
Message 2 of 14
(4,695 Views)

Please give us some details on what it is you figured out so we can all learn something.

0 Kudos
Message 3 of 14
(4,681 Views)
Solution
Accepted by topic author Soran

Sure.

The weakness of the voigt profile was just a numerical mistake. However, I noticed something weird about the number of the points in convolved profile: this number is twice the number of points of input arrays (L & G). That is why the center of Voigt is far away from the center of L and G. I simply used a FOR loop like attached to halve the Voigt point number.

 

0 Kudos
Message 4 of 14
(4,641 Views)

What's wrong with the "array subset" function?

0 Kudos
Message 5 of 14
(4,636 Views)

I did the first thing that came to my mind.

0 Kudos
Message 6 of 14
(4,630 Views)

@Soran wrote:

I did the first thing that came to my mind.


You probably should have had a coffee and waited for the second thing. 😄

 

In any case the inability to specify the output size for 1D convolution is a flaw that should be adressed (After all, it is available for the 2D convolution functions!).

 

So please vote for my old idea here.

 

If the data of the two functions only covers the middle parts (as in your case), you could also do a circular convolution. Here the size of the output remains the same as the two equally sized inputs. (see the help).

Message 7 of 14
(4,624 Views)
Solution
Accepted by topic author Soran

@altenbach wrote:

What's wrong with the "array subset" function?


Because that loop is actually doing a Decimation, therefore Decimate 1D Array is the proper function here.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 8 of 14
(4,617 Views)

Yeah, you are right Smiley LOL (I was so excited to see what the result look like)

 

For sure, I will vote.

 

Thank you,

Soran

0 Kudos
Message 9 of 14
(4,614 Views)
Solution
Accepted by topic author Soran

If the wire actually comes from the R output of Q&R, you are doing a decimation (as Tim correctly pointed out), which, while the number of ponits is correct, will give you a voight line that is only half as wide as it should be. Wrong result!

 

You need to take the subset from 25% to 75% of the output size to get the scaling correctly.

0 Kudos
Message 10 of 14
(4,605 Views)