The Origin Forum
File Exchange
Try Origin for Free
The Origin Forum
Home | Profile | Register | Active Topics | Members | Search | FAQ | Send File to Tech support
Username:
Password:
Save Password
Forgot your Password? | Admin Options

 All Forums
 Origin Forum for Programming
 Forum for Origin C
 convoluting a step-function with gaussian
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

justanewbie

1 Posts

Posted - 04/26/2012 :  06:32:24 AM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
I am trying to convolute asymmetric (step) function with gaussian. the result in both linear and circular convolution cases appears to be symmetrized at edges. Is there a way of avoiding this mistake?

Penn

China
644 Posts

Posted - 04/27/2012 :  11:43:41 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi,

I think the result is right. Your input signal is a steep fall step, which makes the result looks like (actually not) symmetric at edges. You can see the comparison I make below:

1. A similar signal like your data, steep step:



You can see that I change the scale from 0.5 to 4, which make it not look so symmetric.

2. Also a step signal, but not a steep one:



Obviously, the edges are not symmetric.

Penn

Edited by - Penn on 04/27/2012 11:46:39 PM
Go to Top of Page

jonasweinen

Germany
2 Posts

Posted - 05/04/2012 :  09:48:07 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi,

I had the same problem some time ago and I decided not to use the (fourier transform-based) convolution function of Origin, but to do the convolution non-elegantly "brute force" in OriginC (I am using it for fitting):

	int GaussNumPoints = 20;    // Choose some reasonable
	double xstep = 0.25 * sig;  // setting for the Gaussian here.
	double GaussRange = GaussNumPoints * xstep;
	y = 0;
	double k = x - GaussRange;
	while ( k <= x + GaussRange )
	{
		// gauss() needs to be defined somewhere.
		y += yourstepfunction(parameters...) * gauss(x-k,sig);
		k += xstep;
	}
	y *= xstep;


Note that this is quite inefficient compared to the FFT way.

Jonas
Go to Top of Page
  Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
The Origin Forum © 2020 Originlab Corporation Go To Top Of Page
Snitz Forums 2000