# istft

Inverse Short-Time Fourier Transform.

## Syntax

x = istft(x)

x = istft(st,fs)

x = istft(st,fs,window)

x = istft(st,fs,window,overlap)

x = istft(st,fs,window,overlap,nfft)

x = istft(st,fs,window,overlap,nfft)

x = istft(st,fs,window,overlap,nfft,range)

[st,t] = istft(...)

## Inputs

st
The short-time fourier transform input, with segments stored by column.
window
The window size, or the window column vector.
Default: hann(256, 'periodic').
Type: integer | vec
Dimension: scalar | vector
overlap
The number of overlapping points in adjacent windows.
Default: 0.
Type: integer
Dimension: scalar
nfft
The size of the (two-sided) fft.
Default: the window length.
Required for range = 'onesided'.
Ignored for range = 'twosided'.
Type: integer
Dimension: scalar
fs
The sampling frequency.
Default: 1 Hz.
Type: double
Dimension: scalar
range
The spectrum type. The options are as follows:
• 'onesided'
• 'twosided' (default)
Type: string

## Outputs

x
The generated time domain signal.
Type: double
Dimension: vector
t
The vector of times corresponding to the start of each column of st.
Type: vector

## Example

Use stft/istft to remove frequency components with low magnitudes from a linear chirp signal.


f0 = 0;
f1 = 5;
T = 4;
c = (f1 - f0) / T;
t = [0:0.01:T-0.01];
x1 = sin(2 * pi * ((c/2)*t.^2 + f0*t));
[st, t_st, f] = stft(x1, 100, 20, 10, 32, 'onesided');
idx = (abs(st) > 2.5);
st = st .* idx;
x2 = istft(st, 100, 20, 10, 32, 'onesided');
plot(t, x1);
hold on;
plot(t, x2);
legend('original', 'filtered');