Feature suggestion: implement nufft (nonuniform fast Fourier transform)

  • How can I replicate the Octave problem?
    I have script with what I think a nonuniform should do and compare with an just
    doing a normal fft

  • What did I expect to happen and what did happen?
    There is no error it’s a new funtionaility needed.

  • My system
    Windows 11 octave 6.4.0

There is no nonuniform fft in octave, there is a nufft in matlab 2020 now but I would argue it isn’t a nonuniform fft an their example can be done with a normal fft.

This is the problem I think you should be solving make a sine signal for eg and make nonuniform pts it’s evaluated at.

%-------------problem code-------------------
clear all


% make a normal signal
f1=20;
fs=f1*4.5;
dt=1/fs;
t=[0:dt:3];
y=sin(2*pi*f1*t);

% make a nonuniform t domain an make signal from that
trand=0;
for ii=1:length(t);
trand=trand+dt*rand;% nonuniform t
trandsave(ii)=trand;%save nonuniform t
yrand(ii)=sin(2*pi*f1*trand);%signal
end

figure(1)
plot(trandsave,y)%plot signal made
fTrand=abs(fft(yrand));%take fft
figure(2)
plot(fTrand)%plot fft vs sample pts

Just a few pointers, the functions nufft and nufftn were introduced in Matlab R2020a.

Hi Siko1056,
Thanks for your reply. yes I have matlab 2020a on my work laptop and thats where it first appeared.
I have a solution where I intepolate between the points onto the uniform spaced samples and then take the fft that works well enough but not the most sophisticated algorithm.

I find in matlabs example you linked to is a silly example in my opinon.

  1. The time domain is t = [0:300 500.5:700.5]; which is just a gap inbetween.
  2. To recreate a signal I am still expecting a nyquist being respected so a gap from 300:500.5 is going to mess it up but this is more a thing I fft the [0:300] samples then wait and then do a fft [500.5:700.5] samples.
    I’m talking about you have a signal sampled within nyquist but the samples are non uniform.

I can paste my solution which octave may like or find useful. I would love to hear other people solutions I’ve seen work on this for c++ fortran but the code I find is impenatrable.

The LSSA package might do what you want:
https://octave.sourceforge.io/lssa/index.html

1 Like

I think the current state of the art is this one: MATLAB/octave interfaces — finufft 2.0.3 documentation
I do not have any first hand experience with it.

1 Like

Thanks for this links they are very interesting :slight_smile:

Would people be in agreement that the matlab 2020 nufft is not exactly what is needed to perform a fft on the code I have posted and the example is not precisely a nonuniform FT