03-04-2015 02:46 PM - edited 03-04-2015 02:47 PM
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
Solved! Go to Solution.
03-04-2015 06:34 PM
I figured it out
03-04-2015 07:30 PM
Please give us some details on what it is you figured out so we can all learn something.
03-06-2015 10:53 AM
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.
03-06-2015 10:56 AM
What's wrong with the "array subset" function?
03-06-2015 11:02 AM
I did the first thing that came to my mind.
03-06-2015 11:09 AM - edited 03-06-2015 11:12 AM
@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).
03-06-2015 11:12 AM
@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.
03-06-2015 11:14 AM
Yeah, you are right (I was so excited to see what the result look like)
For sure, I will vote.
Thank you,
Soran
03-06-2015 11:32 AM - edited 03-06-2015 11:36 AM
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.