(newbie) spectral derivative

I have data that form a scalar field on a 2D grid, evenly spaced. There is no particular periodicity patern in my data.
I want to calculate the value of the gradient at each grid point with a spectral method in MATLAB. Using simple FFT does not seem to work, especially near the borders (probably because the data are not periodic). I have ears about DCT, but I am not sure.
I would appreciate advice on the best way to do this.

3 件のコメント

Jack Silver
Jack Silver 2014 年 4 月 10 日
I think that I could extend my grid with one row/column at each of the 4 boundaries, duplicate the real boundary on these new boundary points to get a zero derivative boundary for the DCT algorithm. However, I am not sure how to get it working. Another possibility would be to extend my grid in some way that FFT will not create spurious oscillation near the boundaries, but again, I my attempts failed so far.
Sean de Wolski
Sean de Wolski 2014 年 4 月 10 日
Why not just use gradient?
Jack Silver
Jack Silver 2014 年 4 月 10 日
Thanks, for your answer, but my understanding is that the "gradient" function is based on finite difference, which is not accurate enough for my needs.
I would definitly prefer a spectral solution.

サインインしてコメントする。

回答 (0 件)

カテゴリ

質問済み:

2014 年 4 月 10 日

コメント済み:

2014 年 4 月 10 日

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by