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
 All Forums
 Origin Forum for Programming
 Forum for Origin C
 convoluting a step-function with gaussian

Note: You must be registered in order to post a reply.
To register, click here. Registration is FREE!

Screensize:
UserName:
Password:
Anti-Spam Code:
Format Mode:
Format: BoldItalicizedUnderlineStrikethrough Align LeftCenteredAlign Right Horizontal Rule Insert HyperlinkUpload FileInsert Image Insert CodeInsert QuoteInsert List
   
Message:

* HTML is OFF
* Forum Code is ON
Smilies
Smile [:)] Big Smile [:D] Cool [8D] Blush [:I]
Tongue [:P] Evil [):] Wink [;)] Clown [:o)]
Black Eye [B)] Eight Ball [8] Frown [:(] Shy [8)]
Shocked [:0] Angry [:(!] Dead [xx(] Sleepy [|)]
Kisses [:X] Approve [^] Disapprove [V] Question [?]

 
Check here to subscribe to this topic.
   

T O P I C    R E V I E W
justanewbie Posted - 04/26/2012 : 06:32:24 AM
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?

2   L A T E S T    R E P L I E S    (Newest First)
jonasweinen Posted - 05/04/2012 : 09:48:07 AM
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
Penn Posted - 04/27/2012 : 11:43:41 PM
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

The Origin Forum © 2020 Originlab Corporation Go To Top Of Page
Snitz Forums 2000