Documentation for `nuftnn` (SPASS).

## Non uniform Fourier Transform with nearest neighbor interpolation

### Description

The function `nuftnn` computes the Fourier transform of a non uniform signal for some given frequencies using nearest neighbor interpolation to compute a continuous equivalent of the sampled signal.

### Usage

```ft = nuftnn(nu,f)
```

### Arguments

 `nu` Input signal. Non Uniform signal. `f` Frequencies. Vector.

### Values

 `ft` Fourier Transform signal. Non Uniform signal.

### See Also

• nuft (Non uniform Fourier Transform (generic function))
• nuft0 (Non uniform Fourier Transform with zeroth order interpolation)
• nuft1 (Non uniform Fourier Transform with linear interpolation)

### Example

```% Creation of a non uniform signal

f = 1;           % signal frequency
t = 10/f;        % signal duration
fs = 1000;       % sampling frequency
ts = 1/fs;       % sampling time
t0 = 1.;         % initial time
times = t0+(0:ts:t); % time samples
a = 0.45;        % signal amplitude

ampl = a*sin(2*pi*f*times)+a*sin(4*2*pi*f*times)+0.9;   % amplitudes

u = uinit(ampl,ts,t0);

% Level crossing

levels = [.1 .4 .7 1.1 1.4 1.7];
nu = levelcross(u,levels);

% Frequencies and transform

f = 0:.02:6;
ft = nuftnn(nu,f);

% Plot result

figure(1)
plot(f,abs(ft.ampl),'k','LineWidth',1)
```