TFA Fast Gabor Spectrogram VI

LabVIEW 2014 Advanced Signal Processing Toolkit Help

Edition Date: June 2014

Part Number: 372656C-01

»View Product Info
Download Help (Windows Only)

Owning Palette: Time Frequency Spectrogram VIs

Requires: Advanced Signal Processing Toolkit

Decomposes a signal as a linear combination of Gaussian Gabor elementary functions. After decomposing the signal, this VI adds the Wigner-Ville Distribution (WVD) and cross WVD of the elementary functions to compute the quadratic time-frequency representation of signal. Wire data to the signal input to determine the polymorphic instance to use or manually select the instance.

Details  Example

Use the pull-down menu to select an instance of this VI.

TFA Fast Gabor Spectrogram (Waveform)

zoom settings specifies the frequency zoom factor and the zoom range.
zoom factor specifies how much to zoom the spectrogram. zoom factor must be an integer greater than or equal to 1. The default is 1. The larger the zoom factor, the more the detail in the spectrogram you can see.
f0 specifies the lowest frequency in the resulting spectrogram in hertz. The default is NaN, which indicates that the lowest frequency equals 0 for real-valued input signals and that the lowest frequency equals –fs/2 for complex-valued input signals, where fs is the sampling rate of the signal.
number of bins specifies the total number of frequency bins in the resulting spectrogram. As the value of number of bins increases, the frequency range of spectrogram increases. The default value is –1, which specifies that the frequency range of spectrogram is from f0 to fs/2, where fs is the sampling rate of the signal. number of bins must not be greater than half of zoom factor×frequency bins for real-valued input signals and must not be greater than zoom factor×frequency bins for complex-valued input signals.
order specifies how this VI balances the time-frequency resolution and the cross-term interference of the Gabor spectrogram. order must be greater than or equal to 0, or this VI sets order to 0 automatically. As order increases, the time-frequency resolution of the Gabor spectrogram improves, but the spectrogram will have more cross-term interference. Usually, 2, 3, or 4 is an appropriate value for order.
signal specifies the input signal.
time-frequency sampling info specifies the density to use to sample the signal in the joint time-frequency domain and defines the size of the resulting 2D time-frequency array.
time steps specifies the sampling period, in samples, along the time axis in the joint time-frequency domain. The default is –1, which specifies that this VI adjusts time steps automatically so that no more than 512 rows exist in spectrogram. The number of rows in spectrogram equals the signal length divided by time steps.

National Instruments recommends that you set time steps so that the number of rows in spectrogram does not exceed 512. If you specify a small value for time steps, this VI might return a large spectrogram, which requires a long computation time and more memory.

If you need a small sampling period to observe more details and the signal length is large, divide the signal into smaller segments and compute the spectrogram for each segment. If the signal is oversampled, you can downsample the signal. The scale info output contains the actual sampling period in seconds along the time axis. time steps must be power of 2. If time steps is not a power of 2, this VI converts time steps to the largest power of 2 that is not greater than the original time steps.
frequency bins specifies the number of bins along the frequency axis to sample the signal in the joint time-frequency domain. frequency bins must be a power of 2 and greater than 0. The scale info output contains the actual sampling period in hertz along the frequency axis.
Gaussian window length specifies the length of the Gaussian window, in samples, of the Gabor elementary functions and controls the relationship between the time resolution and the frequency resolution of the spectrogram. Gaussian window length must be a power of 2 and greater than or equal to 8. As the value of Gaussian window length increases, the frequency resolution increases, but the time resolution decreases. Gaussian window length determines the other parameters of the Gabor elementary functions. The number of frequencies of Gabor elementary functions, or N (frequency bins), of Gabor elementary functions is half of Gaussian window length. The oversampling rate is 4, that is, the dM (time steps) of the Gabor elementary functions equals N (frequency bins)/4. The variance of the Gaussian envelope window equals dM (time steps)×N (frequency bins)/(2).
error in describes error conditions that occur before this node runs. This input provides standard error in functionality.
spectrogram returns the quadratic time-frequency representation of the signal. Each row corresponds to the instantaneous power spectrum at a certain time. Use the TFA Spectrogram Indicator to display the spectrogram on an intensity graph. You can save the time-dependent 2D array to a text file for use in another software environment. The resulting text file contains only Z values and does not retain the time axis information or the frequency axis information. You can use the TFA Get Time and Freq Scale Info VI to compute the time scale information and the frequency scale information of the time-frequency representation.
scale info returns the time scale and the frequency scale information of the time-frequency representation, including the time offset, the time interval between every two contiguous rows, the frequency offset, and the frequency interval between every two contiguous columns of spectrogram. Use the TFA Get Time and Freq Scale Info VI to return detailed information about the time scale and the frequency scale.
error out contains error information. This output provides standard error out functionality.

TFA Fast Gabor Spectrogram (Real)

zoom settings specifies the frequency zoom factor and the zoom range.
zoom factor specifies how much to zoom the spectrogram. zoom factor must be an integer greater than or equal to 1. The default is 1. The larger the zoom factor, the more the detail in the spectrogram you can see.
f0 specifies the lowest frequency in the resulting spectrogram in hertz. The default is NaN, which indicates that the lowest frequency equals 0 for real-valued input signals and that the lowest frequency equals –fs/2 for complex-valued input signals, where fs is the sampling rate of the signal.
number of bins specifies the total number of frequency bins in the resulting spectrogram. As the value of number of bins increases, the frequency range of spectrogram increases. The default value is –1, which specifies that the frequency range of spectrogram is from f0 to fs/2, where fs is the sampling rate of the signal. number of bins must not be greater than half of zoom factor×frequency bins for real-valued input signals and must not be greater than zoom factor×frequency bins for complex-valued input signals.
order specifies how this VI balances the time-frequency resolution and the cross-term interference of the Gabor spectrogram. order must be greater than or equal to 0, or this VI sets order to 0 automatically. As order increases, the time-frequency resolution of the Gabor spectrogram improves, but the spectrogram will have more cross-term interference. Usually, 2, 3, or 4 is an appropriate value for order.
signal specifies the input signal.
time-frequency sampling info specifies the density to use to sample the signal in the joint time-frequency domain and defines the size of the resulting 2D time-frequency array.
time steps specifies the sampling period, in samples, along the time axis in the joint time-frequency domain. The default is –1, which specifies that this VI adjusts time steps automatically so that no more than 512 rows exist in spectrogram. The number of rows in spectrogram equals the signal length divided by time steps.

National Instruments recommends that you set time steps so that the number of rows in spectrogram does not exceed 512. If you specify a small value for time steps, this VI might return a large spectrogram, which requires a long computation time and more memory.

If you need a small sampling period to observe more details and the signal length is large, divide the signal into smaller segments and compute the spectrogram for each segment. If the signal is oversampled, you can downsample the signal. The scale info output contains the actual sampling period in seconds along the time axis. time steps must be power of 2. If time steps is not a power of 2, this VI converts time steps to the largest power of 2 that is not greater than the original time steps.
frequency bins specifies the number of bins along the frequency axis to sample the signal in the joint time-frequency domain. frequency bins must be a power of 2 and greater than 0. The scale info output contains the actual sampling period in hertz along the frequency axis.
Gaussian window length specifies the length of the Gaussian window, in samples, of the Gabor elementary functions and controls the relationship between the time resolution and the frequency resolution of the spectrogram. Gaussian window length must be a power of 2 and greater than or equal to 8. As the value of Gaussian window length increases, the frequency resolution increases, but the time resolution decreases. Gaussian window length determines the other parameters of the Gabor elementary functions. The number of frequencies of Gabor elementary functions, or N (frequency bins), of Gabor elementary functions is half of Gaussian window length. The oversampling rate is 4, that is, the dM (time steps) of the Gabor elementary functions equals N (frequency bins)/4. The variance of the Gaussian envelope window equals dM (time steps)×N (frequency bins)/(2).
error in describes error conditions that occur before this node runs. This input provides standard error in functionality.
sampling rate specifies the sampling rate of signal in hertz. sampling rate must be greater than 0, or this VI sets sampling rate to 1 automatically. The default is 1.
spectrogram returns the quadratic time-frequency representation of the signal. Each row corresponds to the instantaneous power spectrum at a certain time. Use the TFA Spectrogram Indicator to display the spectrogram on an intensity graph. You can save the time-dependent 2D array to a text file for use in another software environment. The resulting text file contains only Z values and does not retain the time axis information or the frequency axis information. You can use the TFA Get Time and Freq Scale Info VI to compute the time scale information and the frequency scale information of the time-frequency representation.
scale info returns the time scale and the frequency scale information of the time-frequency representation, including the time offset, the time interval between every two contiguous rows, the frequency offset, and the frequency interval between every two contiguous columns of spectrogram. Use the TFA Get Time and Freq Scale Info VI to return detailed information about the time scale and the frequency scale.
error out contains error information. This output provides standard error out functionality.

TFA Fast Gabor Spectrogram (Complex)

zoom settings specifies the frequency zoom factor and the zoom range.
zoom factor specifies how much to zoom the spectrogram. zoom factor must be an integer greater than or equal to 1. The default is 1. The larger the zoom factor, the more the detail in the spectrogram you can see.
f0 specifies the lowest frequency in the resulting spectrogram in hertz. The default is NaN, which indicates that the lowest frequency equals 0 for real-valued input signals and that the lowest frequency equals –fs/2 for complex-valued input signals, where fs is the sampling rate of the signal.
number of bins specifies the total number of frequency bins in the resulting spectrogram. As the value of number of bins increases, the frequency range of spectrogram increases. The default value is –1, which specifies that the frequency range of spectrogram is from f0 to fs/2, where fs is the sampling rate of the signal. number of bins must not be greater than half of zoom factor×frequency bins for real-valued input signals and must not be greater than zoom factor×frequency bins for complex-valued input signals.
order specifies how this VI balances the time-frequency resolution and the cross-term interference of the Gabor spectrogram. order must be greater than or equal to 0, or this VI sets order to 0 automatically. As order increases, the time-frequency resolution of the Gabor spectrogram improves, but the spectrogram will have more cross-term interference. Usually, 2, 3, or 4 is an appropriate value for order.
signal specifies the input signal.
time-frequency sampling info specifies the density to use to sample the signal in the joint time-frequency domain and defines the size of the resulting 2D time-frequency array.
time steps specifies the sampling period, in samples, along the time axis in the joint time-frequency domain. The default is –1, which specifies that this VI adjusts time steps automatically so that no more than 512 rows exist in spectrogram. The number of rows in spectrogram equals the signal length divided by time steps.

National Instruments recommends that you set time steps so that the number of rows in spectrogram does not exceed 512. If you specify a small value for time steps, this VI might return a large spectrogram, which requires a long computation time and more memory.

If you need a small sampling period to observe more details and the signal length is large, divide the signal into smaller segments and compute the spectrogram for each segment. If the signal is oversampled, you can downsample the signal. The scale info output contains the actual sampling period in seconds along the time axis. time steps must be power of 2. If time steps is not a power of 2, this VI converts time steps to the largest power of 2 that is not greater than the original time steps.
frequency bins specifies the number of bins along the frequency axis to sample the signal in the joint time-frequency domain. frequency bins must be a power of 2 and greater than 0. The scale info output contains the actual sampling period in hertz along the frequency axis.
Gaussian window length specifies the length of the Gaussian window, in samples, of the Gabor elementary functions and controls the relationship between the time resolution and the frequency resolution of the spectrogram. Gaussian window length must be a power of 2 and greater than or equal to 8. As the value of Gaussian window length increases, the frequency resolution increases, but the time resolution decreases. Gaussian window length determines the other parameters of the Gabor elementary functions. The number of frequencies of Gabor elementary functions, or N (frequency bins), of Gabor elementary functions is half of Gaussian window length. The oversampling rate is 4, that is, the dM (time steps) of the Gabor elementary functions equals N (frequency bins)/4. The variance of the Gaussian envelope window equals dM (time steps)×N (frequency bins)/(2).
error in describes error conditions that occur before this node runs. This input provides standard error in functionality.
sampling rate specifies the sampling rate of signal in hertz. sampling rate must be greater than 0, or this VI sets sampling rate to 1 automatically. The default is 1.
spectrogram returns the quadratic time-frequency representation of the signal. Each row corresponds to the instantaneous power spectrum at a certain time. Use the TFA Spectrogram Indicator to display the spectrogram on an intensity graph. You can save the time-dependent 2D array to a text file for use in another software environment. The resulting text file contains only Z values and does not retain the time axis information or the frequency axis information. You can use the TFA Get Time and Freq Scale Info VI to compute the time scale information and the frequency scale information of the time-frequency representation.
scale info returns the time scale and the frequency scale information of the time-frequency representation, including the time offset, the time interval between every two contiguous rows, the frequency offset, and the frequency interval between every two contiguous columns of spectrogram. Use the TFA Get Time and Freq Scale Info VI to return detailed information about the time scale and the frequency scale.
error out contains error information. This output provides standard error out functionality.

TFA Fast Gabor Spectrogram Details

The Gabor spectrogram has better time-frequency resolution than the STFT spectrogram method and less cross-term interference than the WVD method. The Gabor spectrogram also allows control of the tradeoff between the cross-term suppression and the joint time-frequency resolution.

The Gabor spectrogram also is called the Gabor expansion-based spectrogram. You can use the Gabor expansion to represent the signal as the linear combination of the time-frequency elementary functions, as shown in the following equation:

where hm,n(i) is the elementary function, and Cm,n is the Gabor coefficients.

After you represent the signal as the linear combination of the time-frequency elementary function, you can use the following equation to compute the WVD of the signal:

Thus, any two elementary functions generate the cross-term interferences. Instead of computing the WVD for any pair of elementary functions, you can select a subset for the computation based on the Manhattan distance between the pair of and . The resulting time-frequency distribution is the Gabor spectrogram, as defined in the following equation:

where D denotes the order. The joint time-frequency resolution and the cross-term interference of the Gabor spectrogram increases with order. When order is 0, the Gabor spectrogram is non-negative and is similar to the STFT spectrogram. As order approaches infinity, the Gabor spectrogram converges to the WVD.

Refer to the book Introduction to Time-Frequency and Wavelet Transforms for more information about the Gabor expansion and transform.

Example

Refer to the Liquefaction Detection VI in the labview\examples\Time Frequency Analysis\TFAApplications directory for an example of using the TFA Fast Gabor Spectrogram VI.

WAS THIS ARTICLE HELPFUL?

Not Helpful