nufftn
N-D nonuniform fast Fourier transform
Description
Examples
Create a 3-D signal X
sampled at unevenly spaced points t
in each dimension. Compute the nonuniform fast Fourier transform Y
.
t = [1:10 11:2:29]'; x = t; y = t'; z = reshape(t,[1 1 20]); X = cos(2*pi*0.01*x) + sin(2*pi*0.02*y) + cos(2*pi*0.03*z); Y = nufftn(X,{t,t,t});
Input Arguments
Input array, specified as a numeric vector, matrix, or multidimensional array.
Data Types: double
| single
| int8
| int16
| int32
| uint8
| uint16
| uint32
| logical
Complex Number Support: Yes
Sample points, specified as a vector, matrix, or cell array of vectors for each
dimension of the input array X
.
When specified as a vector or matrix, the number of rows of t
must equal the number of elements in X
. When no query points are
specified, the transform is computed at N evenly spaced query points
in each dimension, where N = ceil(numel(X).^(1/D))
and
D is the number of columns in t
. The output
Y
is a D-dimensional array of length
N in each dimension.
When t
is specified as a cell array of D
vectors, the length of each vector must equal the length of the corresponding dimension
of X
.
Data Types: double
| single
Query points, specified as a vector, matrix, or cell array of vectors for each
dimension of the input array X
. When specified as a matrix,
f
must be an M-by-k array,
where k is greater than or equal to the number of dimensions
D defined by the sample points.
When f
is specified as a cell array of D
vectors, the length of each dimension of the output Y
is equal to the
length of the corresponding vector in the cell array.
To specify f
without specifying sample points, use
nufftn(X,[],f)
.
Data Types: double
| single
Extended Capabilities
This function fully supports thread-based environments. For more information, see Run MATLAB Functions in Thread-Based Environment.
Version History
Introduced in R2020aThe nufftn
function shows improved performance when operating on
either nonuniformly spaced sample points or nonuniformly spaced query points.
For example, this code constructs a 262,144-by-3 matrix of nonuniform sample points
t
and calculates the nonuniform discrete Fourier transform along each
dimension of a 64-by-64-by-64 array. The code is about 3.3x faster than in the previous
release.
function timingSamplePoints rng default t = rand(64^3,3); X = rand(64,64,64); tic Y = nufftn(X,t); toc end
The approximate execution times are:
R2023a: 0.40 s
R2023b: 0.12 s
The code was timed on a Windows® 10, Intel®
Xeon® CPU E5-1650 v4 @ 3.60 GHz test system by calling the
timingSamplePoints
function.
As another example, this code constructs a 262,144-by-3 matrix of nonuniform query
points f
and calculates the nonuniform discrete Fourier transform along
each dimension of a 64-by-64-by-64 array. The code is about 1.6x faster than in the previous
release.
function timingQueryPoints rng default f = rand(64^3,3); X = rand(64,64,64); tic Y = nufftn(X,[],f); toc end
The approximate execution times are:
R2023a: 0.40 s
R2023b: 0.25 s
The code was timed on a Windows 10, Intel
Xeon CPU E5-1650 v4 @ 3.60 GHz test system by calling the
timingQueryPoints
function.
The nufftn
function shows improved performance when operating on
either nonuniformly spaced sample points or nonuniformly spaced query points.
For example, this code constructs a 32768-by-3 matrix of nonuniform sample points
t
and calculates the nonuniform discrete Fourier transform along each
dimension of a 32-by-32-by-32 array. It runs about 14.5x faster than in the previous
release:
function timingSamplePoints rng default t = rand(32^3,3); X = rand(32,32,32); tic; Y = nufftn(X,t); toc end
The approximate execution times are:
R2021b: 2.76 s
R2022a: 0.19 s
The code was timed on a Windows 10, Intel
Xeon CPU E5-1650 v4 @ 3.60 GHz test system by calling the
timingSamplePoints
function.
As another example, this code constructs a 65536-by-3 matrix of nonuniform query points
f
and calculates the nonuniform discrete Fourier transform along each
dimension of a 64-by-32-by-32 array. It runs about 42.6x faster than in the previous
release:
function timingQueryPoints rng default f = rand(64*32*32,3); X = rand(64,32,32); tic; Y = nufftn(X,[],f); toc end
The approximate execution times are:
R2021b: 4.26 s
R2022a: 0.10 s
The code was timed on a Windows 10, Intel
Xeon CPU E5-1650 v4 @ 3.60 GHz test system by calling the
timingQueryPoints
function.
MATLAB Command
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
웹사이트 선택
번역된 콘텐츠를 보고 지역별 이벤트와 혜택을 살펴보려면 웹사이트를 선택하십시오. 현재 계신 지역에 따라 다음 웹사이트를 권장합니다:
또한 다음 목록에서 웹사이트를 선택하실 수도 있습니다.
사이트 성능 최적화 방법
최고의 사이트 성능을 위해 중국 사이트(중국어 또는 영어)를 선택하십시오. 현재 계신 지역에서는 다른 국가의 MathWorks 사이트 방문이 최적화되지 않았습니다.
미주
- América Latina (Español)
- Canada (English)
- United States (English)
유럽
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)