Download Help (Windows Only) |

**Owning Palette:** Time Frequency Spectrogram VIs

**Requires:** Advanced Signal Processing Toolkit

Computes the Cohen's class time-frequency distribution of **signal**. **kernel** controls the properties of the resulting spectrogram. Wire data to the **signal** input to determine the polymorphic instance to use or manually select the instance.

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

signal specifies the input signal. | |

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. 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. National Instruments recommends that you set time steps so that the number of rows in spectrogram does not exceed 512. 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 or downsample the signal if it is oversampled. The scale info output contains the actual sampling period in seconds along the time axis.
| |

kernel specifies the upper half of a user-defined 2D kernel function. The number of rows in kernel determines the number of frequency bins, or the number of columns, in the resulting spectrogram. The number of rows in kernel must be a power of 2. The number of columns in kernel must be 2^(ceil(log2(Ls – 1))), where Ls is the length of signal. For a kernel function Phi(, ), is associated with the row direction of kernel, and is associated with the column direction.
| |

error in describes error conditions that occur before this node runs. This input provides standard error in functionality. | |

analytic signal? specifies whether to convert the real input signal to the corresponding analytic signal. The default is TRUE. The analytic signal has no negative frequency components and has the same positive frequency components as the original signal. Converting the real input signal to the analytic signal can suppress the cross-term interference between the positive frequency components and the negative frequency components.
| |

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. |

signal specifies the input signal. | |

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. 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. National Instruments recommends that you set time steps so that the number of rows in spectrogram does not exceed 512. 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 or downsample the signal if it is oversampled. The scale info output contains the actual sampling period in seconds along the time axis.
| |

kernel specifies the upper half of a user-defined 2D kernel function. The number of rows in kernel determines the number of frequency bins, or the number of columns, in the resulting spectrogram. The number of rows in kernel must be a power of 2. The number of columns in kernel must be 2^(ceil(log2(Ls – 1))), where Ls is the length of signal. For a kernel function Phi(, ), is associated with the row direction of kernel, and is associated with the column direction.
| |

error in describes error conditions that occur before this node runs. This input provides standard error in functionality. | |

analytic signal? specifies whether to convert the real input signal to the corresponding analytic signal. The default is TRUE. The analytic signal has no negative frequency components and has the same positive frequency components as the original signal. Converting the real input signal to the analytic signal can suppress the cross-term interference between the positive frequency components and the negative frequency components.
| |

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. |

signal specifies the input signal. | |

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. 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. National Instruments recommends that you set time steps so that the number of rows in spectrogram does not exceed 512. 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 or downsample the signal if it is oversampled. The scale info output contains the actual sampling period in seconds along the time axis.
| |

kernel specifies the upper half of a user-defined 2D kernel function. The number of rows in kernel determines the number of frequency bins, or the number of columns, in the resulting spectrogram. The number of rows in kernel must be a power of 2. The number of columns in kernel must be 2^(ceil(log2(Ls – 1))), where Ls is the length of signal. For a kernel function Phi(, ), is associated with the row direction of kernel, and is associated with the column direction.
| |

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. |

For large values of the signal length, this VI requires a long computation time and more memory. National Instruments recommends that you limit **signal** to 15,000 samples.

To suppress the cross-term interference in the Wigner-Ville Distribution (WVD), Leon Cohen proposed a general framework of time-frequency distributions. You can derive most of the quadratic JTFA methods from the Cohen's class time-frequency distributions. The short-time Fourier transform (STFT) spectrogram and the WVD are two extreme cases in Cohen's class.

The following equations define the Cohen's class time-frequency distribution of signal *s(t)*:

where is the ambiguity function of the input signal, is the kernel function for smoothing the cross-term interference, and is the time-dependent auto-correlation function of the input signal. When , the Cohen's distribution is degraded into the WVD. When the kernel is the ambiguity function of a window used in the STFT, the resulting time-frequency distribution is the STFT spectrogram.

Complete the following steps to compute the Cohen's class time-frequency distribution.

- Apply the fast Fourier transform (FFT) to the time-dependent auto-correlation function along the
*t*–axis to compute the ambiguity function. - Multiply the kernel function with the ambiguity function and perform the inverse FFT on the kernel-truncated ambiguity function along the –axis. You can consider the resulting function as the smoothed time-dependent auto-correlation function.
- Apply the FFT to the smoothed time-dependent auto-correlation function along the –axis.

The following table outlines some general kernel functions:

Name | Kernel | Kernel Plot |
---|---|---|

Born-Jordan (BJD) | ||

Choi-Williams (CWD) | ||

Cone-shape (CSD) |

You can use the kernel plot to investigate the ability of each kernel function to suppress cross-term interference. The –axis indicates the central time difference between any two signal components, and the –axis indicates the central frequency difference. If the kernel function decays rapidly along the –axis, the kernel function can suppress cross-term interference from signal components with a large central time difference. If the kernel function decays rapidly along the –axis, the kernel function can suppress cross-term interference from signal components with different central frequencies.

The kernel function you select in real applications depends on the property of the input signals. The CSD is a common first choice for the evaluation of different time-frequency distributions in real applications.

Refer to the book Introduction to Time-Frequency and Wavelet Transforms for more information about Cohen's class time-frequency distributions.

Refer to the Pseudo Wigner-Ville Distribution VI in the labview\examples\Time Frequency Analysis\TFAFunctions directory for an example of using the TFA Cohen VI.

Helpful

Not Helpful