Documentation for `nuft` (SPASS).

## Non uniform Fourier Transform (generic function)

### Description

The function `nuft` computes the Fourier transform of a non uniform signal for some given frequencies. This is a generic function gathering the functionalities of functions nuft0, nuftnn and nuft1.

### Usage

```ft = nuft(nu,f)
ft = nuft(nu,f,'0')
ft = nuft(nu,f,'nn')
ft = nuft(nu,f,'1')
ft = nuft(nu,f,'1','no-signal')
ft = nuft(nu,f,'1','no-activity')
```

### Arguments

 `nu` Input signal. Non Uniform signal. `f` Frequencies. Vector. `interptype` Choice of interpolation type. String among '0', 'nn' and '1'. Optional, default='0'. `lsig` Choice of left data in the case of linear interpolation (interptype='1'). String among 'no-signal' and 'no-activity'. Optional, default='no-signal'.

### Values

 `ft` Fourier Transform signal. Non Uniform signal.

• nuft0 (Non uniform Fourier Transform with zeroth order interpolation)
• nuftnn (Non uniform Fourier Transform with nearest neighbor 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;
ft0 = nuft(nu,f,'0');
ftnn = nuft(nu,f,'nn');
ft1nos = nuft(nu,f,'1','no-signal');
ft1noa = nuft(nu,f,'1','no-activity');

% Plot result

figure(1)
plot(f,abs(ft0.ampl),'k', ...
f,abs(ftnn.ampl),'r', ...
f,abs(ft1nos.ampl),'b', ...
f,abs(ft1noa.ampl),'g','LineWidth',1)
legend('zero','nearest neighbor','linear no signal','linear no-activity')
```