# Fourier transform values at non-integer frequencies for images.

조회 수: 12 (최근 30일)
Saivivek 2024년 3월 12일
댓글: Saivivek 2024년 3월 20일
For one of my projects I need Fourier transform values at non-integer frequencies of images. Zero padding doesn't help for my application. I'm trying to use nufftn without specifying sample points i.e., nufft(X, [], f). But I couldn't quite understand the output. Documentation is not elaborate enough. I really appreciate if anyone can help me with this. Thanks in Advance.

댓글을 달려면 로그인하십시오.

### 답변 (1개)

Sudarsanan A K 2024년 3월 18일
Hello Saivivek,
The "nufftn" function in MATLAB is used for non-uniform fast Fourier transforms. It allows you to compute the Fourier transform at non-integer frequencies for non-uniformly sampled data.
To use "nufftn" without specifying sample points, you can pass an empty array as the second argument. For example,
nufftn(X, [], f)
will compute the Fourier transform of the data "X" at the frequencies specified by the vector "f".
The output of "nufftn" will be a vector or array of complex numbers representing the Fourier transform values at the specified frequencies. The size and shape of the output will depend on the size and shape of the input data "X" and the frequencies "f".
Here is an example:
% Assuming img is your image data
img = double('cameraman.tif'); % Convert image to double
% Define non-integer frequencies for 2D image
frequencies = [0.1, 0.2; 0.3, 0.4; 0.45, -0.45]; % Example frequency pairs
% Compute the Fourier transform at specified non-integer frequencies
F = nufftn(img, [], frequencies);
% F now contains the Fourier transform values at the specified frequencies
For better interpretation of the output, it may be helpful to visualize the results using MATLAB's plotting functions. For example, you can plot the magnitude and phase of the Fourier transform values to get a better understanding of the frequency content of your data:
% Compute magnitude and phase
magnitude = abs(F);
phase = angle(F);
% Plot magnitude
figure;
stem3(frequencies(:,1), frequencies(:,2), magnitude, 'filled');
title('Magnitude Spectrum');
xlabel('Frequency X');
ylabel('Frequency Y');
zlabel('Magnitude');
% Plot phase
figure;
stem3(frequencies(:,1), frequencies(:,2), phase, 'filled');
title('Phase Spectrum');
xlabel('Frequency X');
ylabel('Frequency Y');
zlabel('Phase');
I hope this helps!
##### 댓글 수: 1이전 댓글 -1개 표시이전 댓글 -1개 숨기기
Saivivek 2024년 3월 20일

댓글을 달려면 로그인하십시오.

### 카테고리

Help CenterFile Exchange에서 Fourier Analysis and Filtering에 대해 자세히 알아보기

### Community Treasure Hunt

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

Start Hunting!

Translated by