The Math Forum



Search All of the Math Forum:

Views expressed in these public forums are not endorsed by NCTM or The Math Forum.


Math Forum » Discussions » Software » comp.soft-sys.matlab

Topic: convn and (i)fftn
Replies: 10   Last Post: May 16, 2016 4:51 PM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]
Matt J

Posts: 4,997
Registered: 11/28/09
Re: convn and (i)fftn
Posted: Jun 23, 2011 9:00 AM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

"Alle Meije " <a.m.wink@gmail.com> wrote in message <itv26g$mv$1@newscl01ah.mathworks.com>...

> Ah, OK. So the steps for Hx and Hy can be combined into one call (Hxy) because the x and y dimensions are the same (3rd parameter), and the step for Hz needs to be a separate call because the dimension is different?
================

Yep.


> Got it! I needed to download a substitute for bsx_func() which is in the latest matlab version only, and change a line where it says
> [~, output] = function(inputs)
> which is also new-matlab syntax?


Your MATLAB version is obviously quite old. BSXFUN has been around since R2008 and the "~" syntax is only a bit more recent. Just replace the "~" with some dummy variable.


> Also had to apply a circular shift of [-ksize -ksize -ksize] to the volume (because the kernel was not centred), but still it was *A LOT* faster than the other two.
===================

No idea why the circshift is necessary. Possibly a side-effect of other changes you made? I checked directly that this produces a centered kernel. I also compared the output of my scheme numerically to CONVN and got agreement to within numerical precision. In any case, the 2nd argument to interpMatrix also accepts a number if you want to do it that way. This lets you indicate directly the location of what you consider the kernel center.



Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© The Math Forum at NCTM 1994-2017. All Rights Reserved.