Documentation for `ifir1` (SPASS).

## Linearly interpolated FIR filter

### Description

The function `ifir1` performs a FIR filtering using linear interpolation to compute a continuous equivalent of the input sampled signal.

### Usage

```sig_out = ifir1(sig_in,h)
```

### Arguments

 `sig_in` Input signal. Non Uniform signal. `h` Filter transfer function. Non Uniform signal.

### Values

 `sig_out` Filtered output signal. Non Uniform signal.

• h2nuh (Conversion of a uniform transfer function to a non uniform transfer function)
• ifir (Interpolated FIR filter (generic function))
• ifir0 (Zeroth order interpolated FIR filter)

### 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);

% Creation of a uniform filter

fc = 2;          % cut frequency
order = 10;      % filter order
nyq = 8;         % half sampling rate = nyquist frequency
fn = fc/nyq;     % normalized cut-off frequency

h = fir1(order,fn);
uh = uinit(h,1/nyq);

% FIR filtering

nuh = h2nuh(uh);
sig = ifir1(nu,nuh);

% Plot result

figure(1)
plot(delay2time(nu.delay,nu.t0),nu.ampl,'k');
hold on
plot(delay2time(sig.delay,sig.t0),sig.ampl,'r');
hold off
```