istft
Inverse windowed Fourier transform.
| Library |
|
Syntax
Function call
-
x = istft(s)— returns Inverse windowed Fourier transform (OOPF) of the signals.
-
x = istft(___,Name,Value)— sets additional parameters using name-value arguments. The values of such arguments include the length of the FFT window and the number of overlapping samples. These arguments can be added to any of the previous input syntaxes.
Arguments
Input arguments
#
s —
windowed Fourier
transform
the matrix | three-dimensional array
Details
A windowed Fourier transform defined as a matrix or a three-dimensional array. For single-channel signals s It is set as a matrix where time increases in columns and frequency increases in rows. For multi-channel signals s It is defined as a three-dimensional array, the third dimension of which corresponds to the channels. The frequency and time vectors are obtained as the output of the function stft.
If it is required that x and s had the same length, value (length(x)-noverlap)/(length(window)-noverlap) it must be an integer. Use the argument Window to set the length window and the argument OverlapLength to ask noverlap.
|
| Типы данных |
|
| Support for complex numbers |
Yes |
#
fs —
sampling
rate
2π (by default) | positive scalar
Details
The sampling frequency in hertz, set as a positive scalar.
| Типы данных |
|
Name-value input arguments
Specify optional argument pairs as Name,Value, where Name — the name of the argument, and Value — the appropriate value. Name-value arguments should be placed after other arguments, but the order of the pairs does not matter.
Use commas to separate the name and value, and Name put it in quotation marks.
# Window — window function
+
hann(128,"periodic") (by default) | vector
Details
A window function defined as a vector. If the argument is Window not specified or set as empty, the function uses a periodic Hanna window of length 128. Length of the argument Window must be greater than or equal to 2.
For a list of available windows, see Windows - window functions.
| Типы данных |
|
# OverlapLength — the number of overlapping samples
+
75% of the window length (by default) | a non-negative integer
Details
The number of overlapping samples specified as a non-negative integer less than the length of the argument Window. If the argument is OverlapLength omitted or empty, the function uses the largest integer smaller than 75% of the window length, which is 96 There are no default counts for the Hanna window.
| Типы данных |
|
# FFTLength — number of DFT points
+
128 (by default) | a positive integer
Details
The number of DFT points, set as a positive integer greater than or equal to the window length. To achieve perfect signal recovery in the time domain, it is necessary to set the number of DFT points corresponding to the one used in stft.
| Типы данных |
|
# Method — the method of summation with overlap
+
"wola" (by default) | "ola"
Details
The overlapping summation method, defined as one of the following options:
-
"wola"— weighted summation with overlap; -
"ola"— summation with overlap.
# ConjugateSymmetric — conjugate symmetry of the original signal
+
false (by default) | true
Details
The conjugate symmetry of the original signal, given as true or false. If this argument is set to true, function istft assumes that the input signal s symmetrical, otherwise the assumption of symmetry is not made. If s it is not exactly conjugate-symmetric due to rounding error, setting the value for a name-value type argument true ensures that the OPF is considered conjugate symmetric. If s If it is conjugately symmetric, then the calculation of the inverse transformation is faster, and the output signal is real.
# FrequencyRange — frequency range of OPF
+
"centered" (by default) | "twosided" | "onesided"
Details
The frequency range of the OPF, set as "centered", "twosided" or "onesided".
-
"centered"— processsas a two-way centered OPF. Ifnffteven, then it is assumed thatscalculated in the interval rad/countdown. IfnfftIf it is odd, then it is assumed thatscalculated in the interval rad/countdown. If time information is specified, then the intervals are cycles per unit of time and cycles per unit of time, respectively, where — sampling rate. -
"twosided"— processsas a two-way OPF calculated in the interval rad/countdown. If time information is specified, the interval is cycles per unit of time. -
"onesided"— processsas a one-sided OPF. IfnfftIf the number is even, then it is assumed thatscalculated in the interval rad/countdown. IfnfftIf it is odd, then it is assumed thatscalculated in the interval rad/countdown. If time information is specified, then the intervals are cycles per unit of time and cycles per unit of time, respectively, where — sampling rate.
If this argument is set to "onesided", function istft assumes that the values in the positive Nyquist band were calculated without saving full power.
|
| Типы данных |
|
# InputTimeDimension — time measurement of the input
+
"acrosscolumns" (by default) | "downrows"
Details
The time dimension of the input, set as "acrosscolumns" or "downrows".
# out — type of output data
+
:data (by default) | :plot
Details
Type of output data:
-
:data— the function returns data; -
:plot— the function returns a graph.
Additional Info
Inverse windowed Fourier transform
Details
To calculate the inverse windowed Fourier transform, take the FFT of each DFT vector and add the inverted signals with overlap.
Recall that the OPF of the signal is calculated by moving the _ window of the analysis_ lengths based on the signal and the calculation of the discrete Fourier transform (DFT) of each segment of the window data. The window moves according to the original signal with an interval of counts, which is equivalent to counts of overlap between adjacent segments. The OOPF is calculated as follows.
where — this is a time-centered window data DFT , and . The reverse OPF ensures perfect recovery of the original signal if , where — a non-zero constant, and equally 0 or 1. For more information, see Limitation of constant addition with overlap (COLA). This figure shows the steps of restoring the original signal.
Limitation of constant addition with overlap (COLA)
Details
For successful reconstruction of unmodified spectra, the analysis window must meet the COLA constraint. In general, if the analysis window satisfies the condition , where — a non-zero constant, and equally 0 or 1, the window is considered to correspond to COLA. In addition, COLA compliance can be described as weak or strong.
-
Weak COLA matching implies that the Fourier transform of the analysis window has zeros on the harmonics of the frame rate, so that
The suppression of overlays is disrupted by spectral modifications. Weak COLA is based on suppression of overlaps in the frequency domain. Therefore, perfect recovery is possible using windows with weak COLA compliance, provided that the signal has not undergone any spectral modifications.
-
For strong COLA compliance, the Fourier transform of the window must be bandwidth-limited sequentially while lowering the frame rate such that
This equation shows that the strong COLA constraint does not allow for overlapping spectra. In addition, for a strong COLA match, the value of the constant should be equal to
1. In general, if the short-term spectrum changes in any way, a window with a stronger COLA match is preferred.
In the general case, it is customary to use in for weighted overlap summation (WOLA) and for overlapping summation (OLA). By default istft uses the WOLA method, applying the synthesis window before performing the overlap summation method.
In general, the synthesis window is the same as the analysis window. Useful WOLA windows can be constructed by extracting the square root of a strong OLA window. This method is applicable to all non-negative OLA windows. For example, a window with a Hanna root is a good example of a WOLA window.
Perfect recovery
Details
In general, calculating the OPF of the input signal and inverting it does not lead to perfect recovery. In order for the OOPF output signal to match the original input signal as closely as possible, the signal and the window must meet the following conditions:
-
Input signal size — if you invert the output signal
stftwith the helpistftand you want the length of the result to match the length of the input signal.x, valueit must be an integer. In this equation — signal length, — the length of the window, and — the length of the overlap.
-
COLA matching — use windows with COLA matching, provided that the windowed Fourier transform of the signal has not been modified.
-
Padding — if the length of the input signal is such that the value If it is not an integer, add zeros to the signal before calculating the window Fourier transform. Remove the extra zeros after inverting the signal.
Literature
-
Crochiere, R. E. «A Weighted Overlap-Add Method of Short-Time Fourier Analysis/Synthesis.» IEEE Transactions on Acoustics, Speech and Signal Processing. Vol. 28, Number 1, Feb. 1980, pp. 99–102.
-
Gotzen, A. D., N. Bernardini, and D. Arfib. «Traditional Implementations of a Phase-Vocoder: The Tricks of the Trade.» Proceedings of the COST G-6 Conference on Digital Audio Effects (DAFX-00), Verona, Italy, Dec 7–9, 2000.
-
Griffin, Daniel W., and Jae S. Lim. «Signal Estimation from Modified Short-Time Fourier Transform.» IEEE Transactions on Acoustics, Speech and Signal Processing. Vol. 32, Number 2, April 1984, pp. 236–243.
-
Laroche, Jean, and Mark Dolson. «Improved Phase Vocoder Time-Scale Modification of Audio.» IEEE Transactions on Speech and Audio Processing 7, no. 3 (May 1999): 323–32. https://doi.org/10.1109/89.759041.
-
Portnoff, M. R. «Time-Frequency Representation of Digital Signals and Systems Based on Short-Time Fourier analysis.» IEEE Transactions on Acoustics, Speech and Signal Processing. Vol. 28, Number 1, Feb 1980, pp. 55–69.
-
Smith, Julius Orion. Spectral Audio Signal Processing. https://ccrma.stanford.edu/~jos/sasp/, online book, 2011 edition, accessed Nov. 2018.
-
Sharpe, Bruce. Invertibility of Overlap-Add Processing. https://gauss256.github.io/blog/cola.html, accessed July 2019.