STFT
STFT [flags] srcWave
The STFT operation computes the Short-Time Fourier Transform of srcWave. STFT was added in Igor Pro 8.00.
Output is stored in the wave M_STFT in the current data folder or in a wave specified by the /DEST flag.
Flags
| /DB=dbMode | dbMode determines if output is scaled in decibels: | ||||||||||||||
| |||||||||||||||
| /DEST=destWave | |||||||||||||||
| Specifies the output wave created by the FFT operation. | |||||||||||||||
| It is an error to specify the same wave as both srcWave and destWave. | |||||||||||||||
| The default output wave name M_STFT is used if you omit /DEST. | |||||||||||||||
| When used in a function, the STFT operation by default creates a real wave reference for the destination wave. See Automatic Creation of Wave References for details. | |||||||||||||||
| /FREE | Creates the specified destination wave as a free wave. | ||||||||||||||
| /FREE is allowed only in functions, and only if the destination waves are simple names or wave reference structure fields. | |||||||||||||||
| See Free Waves for more discussion. | |||||||||||||||
| The /FREE flag was added in Igor Pro 10.00. | |||||||||||||||
| /HOPS=hopSize | Specifies the offset in points between centers of consecutive source segments. By default this value is 1 and the transform is computed for segments that are offset by a single points from each other. | ||||||||||||||
| /OUT=mode |
| ||||||||||||||
| The scaled quantities apply to transforms of real valued inputs where the output is normally folded in the first dimension (because of symmetry). The scaling applies a factor of 2 to the squared magnitude of all components except the DC. The scaled transforms should be used whenever Parseval's relation is expected to hold. | |||||||||||||||
| /PAD=newSize | Converts each segment of srcWave into a padded array of length newSize. The padded array contains the original data at the center of the array with zeros elements on both sides. | ||||||||||||||
| /RP=[startPoint,endPoint] | |||||||||||||||
| Specifies the range of srcWave from which data are sampled in point numbers. startPoint is the first point at which segments are centered. Wave data from points preceding startPoint are used as needed for the left parts of beginning segments. | |||||||||||||||
| /RX=(startX,endX) | |||||||||||||||
| Specifies the range of srcWave from which data are sampled in X values. The operation expects startX<endX. startX corresponds to the first point at which segments are centered. Data from points preceding startX are used as necessary to fill left parts of the beginning segments. | |||||||||||||||
| /SEGS=segSize | Sets the length of the segment sampled from srcWave in points. The segment is optionally padded to a larger dimension (see /PAD) and multiplied by a window function prior to FFT. The default segment size is 128 when the number of points in srcWave is greater than 128. Otherwise it is set to one less than the number of points in the srcWave. The operation requires that segSize is at least 32 points. | ||||||||||||||
| /WINF=windowKind | |||||||||||||||
| Premultiplies a data seggment with the selected window function. The default window is Hanning. See Window Functions in the documentation for FFT for details. | |||||||||||||||
| /Z | Ignores errors. V_flag is set to -1 for any error and to zero otherwise. | ||||||||||||||
Details
The Short-Time Fourier Transform is a time-frequency representation for a 1D array. The squared magnitude of the transform is known as the "spectrogram" for time series or "sonogram" in the case of sound input. The operation comprises the following steps:
-
Sampling the data.
A segment of size specified by /SEGS is sampled from srcWave centered about the first point in the wave or as specified by /RX or /RP flags. When the first point is at the beginning of the wave the centering implies that the first half of the segment is set to zero. If the first point is somewhere else the operation uses as many points as are available in the wave and sets the rest to zero. End effects are mitigated by scaling the result by a factor that accounts for the actual number of source data used in the segment. Subsequent segments are each centered at hopSize points from the previous center.
-
Apply windowing.
The selected segment is multiplied by the specified window function.
-
Apply padding.
If padding is specified the windowed data are centered onto a zero padded array. Padding may be used to simulate longer arrays for improved spectral resolution.
-
Compute the FFT.
Initial complex transform may be further processed according to the /OUT flag.
See Also
Fourier Transforms, FFT, CWT, WignerTransform, DSPPeriodogram, LombPeriodogram.