Forums

Partial Derivative for 3D function by FFTW

Started by xiaoniu October 29, 2006
Dear FFTW experts,

I want to do the partial derivative for a 3D function by FFTW.

For example, I have a 3D function P(x,y,z), and I want to compute dP/dx
and dP/dy (I can not find the symbol for partial so I use "d" here). As I
remembered:
1. Determine dP/dx:(P is a 3D data)
(1)I should do fourier transfrom of P(x,y,z) with x direction(1D transform
for 3D data)
(2)multiply with i*Wx
(3)inverse transform also with x direction (1D transform for 3D data)

2. Determine dP/dx:(P is a 3D data)
(1)I should do fourier transfrom of P(x,y,z) with y direction(1D transform
for 3D data). This should be different from the fourier transfrom of
P(x,y,z) with x direction.
(2)multiply with i*Wy
(3)inverse transform with y direction (1D transform for 3D data)

I can not find a subrouine from FFTW to do this 1D fourier transform for
3D data.(From the FFTW document, I only find 1D tranform for 1D data, 3D
transform for 3D data). Could you please help me figure out how to do the
tranform in different dimension for a 3D data by FFTW?

Thanks in advance!!
Xiaoniu



  



xiaoniu wrote:

> ... (I can not find the symbol for partial so I use "d" here). ...
Does 'δ' show up on your computer? It doesn't on everyone's. FWIW: α β γ δ ε η θ ι κ λ μ ν ξ ο π ρ σ (final: ς) τ υ φ χ ψ ω Jerry -- "The rights of the best of men are secured only as the rights of the vilest and most abhorrent are protected." - Chief Justice Charles Evans Hughes, 1927 ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
xiaoniu wrote:
> Dear FFTW experts, > > I want to do the partial derivative for a 3D function by FFTW. > > For example, I have a 3D function P(x,y,z), and I want to compute dP/dx > and dP/dy (I can not find the symbol for partial so I use "d" here). As I > remembered: > 1. Determine dP/dx:(P is a 3D data) > (1)I should do fourier transfrom of P(x,y,z) with x direction(1D transform > for 3D data) > (2)multiply with i*Wx > (3)inverse transform also with x direction (1D transform for 3D data) > > 2. Determine dP/dx:(P is a 3D data) > (1)I should do fourier transfrom of P(x,y,z) with y direction(1D transform > for 3D data). This should be different from the fourier transfrom of > P(x,y,z) with x direction. > (2)multiply with i*Wy > (3)inverse transform with y direction (1D transform for 3D data) > > I can not find a subrouine from FFTW to do this 1D fourier transform for > 3D data.(From the FFTW document, I only find 1D tranform for 1D data, 3D > transform for 3D data). Could you please help me figure out how to do the > tranform in different dimension for a 3D data by FFTW? > > Thanks in advance!! > Xiaoniu >
I'm no FFTW expert, but you should be able to do a 3D transform, multiply by i*Wx, then do the inverse for the partial in the x direction, with a similar operation for the y direction. You will do a bunch of extra computations, but that's life. -- Tim Wescott Wescott Design Services http://www.wescottdesign.com Posting from Google? See http://cfaj.freeshell.org/google/ "Applied Control Theory for Embedded Systems" came out in April. See details at http://www.wescottdesign.com/actfes/actfes.html
xiaoniu wrote:

> I want to do the partial derivative for a 3D function by FFTW. > > For example, I have a 3D function P(x,y,z), and I want to > compute dP/dx and dP/dy (I can not find the symbol for partial > so I use "d" here).
Any such symbol would not be ASCII, hence not very suitable for NNTP transmission.
> As I remembered: > 1. Determine dP/dx:(P is a 3D data) > (1)I should do fourier transfrom of P(x,y,z) with x direction(1D > transform for 3D data) > (2)multiply with i*Wx > (3)inverse transform also with x direction (1D transform for 3D > data)
> I can not find a subrouine from FFTW to do this 1D fourier > transform for 3D data.(From the FFTW document, I only find 1D > tranform for 1D data, 3D transform for 3D data).
Apply the 1D transform to each slice P(0..n_x-1, y,z) separately, looping over all index pairs (y,z). Proceed analogously for other directions. Martin -- Quidquid latine scriptum sit, altum viditur.
>xiaoniu wrote: >> Dear FFTW experts, >> >> I want to do the partial derivative for a 3D function by FFTW. >> >> For example, I have a 3D function P(x,y,z), and I want to compute
dP/dx
>> and dP/dy (I can not find the symbol for partial so I use "d" here). As
I
>> remembered: >> 1. Determine dP/dx:(P is a 3D data) >> (1)I should do fourier transfrom of P(x,y,z) with x direction(1D
transform
>> for 3D data) >> (2)multiply with i*Wx >> (3)inverse transform also with x direction (1D transform for 3D data) >> >> 2. Determine dP/dx:(P is a 3D data) >> (1)I should do fourier transfrom of P(x,y,z) with y direction(1D
transform
>> for 3D data). This should be different from the fourier transfrom of >> P(x,y,z) with x direction. >> (2)multiply with i*Wy >> (3)inverse transform with y direction (1D transform for 3D data) >> >> I can not find a subrouine from FFTW to do this 1D fourier transform
for
>> 3D data.(From the FFTW document, I only find 1D tranform for 1D data,
3D
>> transform for 3D data). Could you please help me figure out how to do
the
>> tranform in different dimension for a 3D data by FFTW? >> >> Thanks in advance!! >> Xiaoniu >> >I'm no FFTW expert, but you should be able to do a 3D transform, >multiply by i*Wx, then do the inverse for the partial in the x >direction, with a similar operation for the y direction. You will do a >bunch of extra computations, but that's life. > >-- > >Tim Wescott >Wescott Design Services >http://www.wescottdesign.com > >Posting from Google? See http://cfaj.freeshell.org/google/ > >"Applied Control Theory for Embedded Systems" came out in April. >See details at http://www.wescottdesign.com/actfes/actfes.html >
Thank you Tim. I tried in the way as you suggested and it worked. Thanks a lot!