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
 fft_convolute and fft_deconvolute

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
Frank_H Posted - 12/15/2005 : 2:06:51 PM
Origin Version (Select Help-->About Origin): 7.5 SR5
Operating System: XP

Hi!

I just want to give a warning to all future users of fft_convolute and fft_deconvolute. As a reminder, the function definition is:

int fft_convolute(vector& vecSignal, vector& vecResponse, vector& vecResult, bool bNormalize = true, bool bWrap = true)

The function computes the convolution of vecSignal and vecResponse and the result is written into vecResult.
But attention: vecSignal and vecResponse are both altered in this process, as some operations (FFT) are performed within these vectors! Same is true for fft_deconvolute. Therefore these functions should be used only with a copy of any vector or dataset that you might want to use later!

It would be nice to see a warning or hint onto this effect in the help files!

Regards,
Frank
2   L A T E S T    R E P L I E S    (Newest First)
Frank_H Posted - 12/16/2005 : 05:09:08 AM
Hi Mike

When working on large vectors (or matrices), it makes pretty much sense to pass vectors by reference to avoid allocating new memory, copying data around, and deallocating it at the end. Therefore when writing time efficient code its everything but obvious that a call by reference implies necessarily a change of the data - I always use references and not a call by value for matrix and vector data. You are of cause right, that it could give a hint, but it is still far from obvious - 2 lines in the help file would be nice.

Best regards,
Frank

P.S.: No offence meant, but I learned the distinction between call by reference and by value 20 years ago. But I have to admit, that I am still living too much in pre-object era of C (without ++) and Pascal, and my use of IDL in recent years threw me back (at least concerning syntax) into the Fortran 77 era :-)
Mike Buess Posted - 12/15/2005 : 4:53:35 PM
The fact that vecSignal and vecResponse are declared as vector& is a pretty strong clue that they will be changed by the function. It's called passing variables (in this case vectors) by reference.

Mike Buess
Origin WebRing Member

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