LabVIEW Biomedical Toolkit API Reference

HRV STFT Spectrogram VI

  • Updated2023-02-21
  • 9 minute(s) read

HRV STFT Spectrogram VI

Owning Palette: HRV Analysis VIs

Requires: Biomedical Toolkit

Calculates the short-time Fourier transform (STFT) spectrogram from RR intervals.

Example

HRV STFT Spectrogram (Array Unevenly Sampled RR)

RR specifies the RR intervals that this VI uses to calculate the power spectral density (PSD).
raw RR specifies the raw RR intervals. This VI interpolates raw RR intervals to an evenly-sampled time series.
STFT settings specifies parameters for the STFT.
window info specifies the sliding window that this VI uses to compute the STFT and defines the resolution of the resulting time-frequency representation.
type specifies the type of the sliding window.

0None
1Hanning (default)
2Hamming
3Blackman-Harris
4Exact Blackman
5Blackman
6Flat Top
74 Term B-Harris
87 Term B-Harris
9Low Sidelobe
10Gaussian
length specifies the length, in samples, of the sliding window. The default is -1, which indicates that this VI sets the window length to four times time steps. Thus, the overlap between sliding windows is 75 percent. However, this VI wraps the default window length to 64 when time steps is less than 16. length controls the relationship between the time resolution and the frequency resolution of the time-frequency representation. A large window length provides better frequency resolution but poorer time resolution.
time-frequency sampling info specifies the density that this VI uses 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 such 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 spectrogram for each segment. If the signal is oversampled, you also can downsample the signal. The scale info output contains the actual sampling period, in seconds, along the time axis of the spectrogram.
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. The default is 512.
error in describes error conditions that occur before this node runs. This input provides standard error in functionality.
interpolation rate specifies the rate of interpolation, in hertz, for converting raw RR intervals into an evenly-sampled time series. The default is 2.
spectrogram returns the STFT spectrogram of the input RR intervals.
scale info returns the time scale and 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 continuous columns of spectrogram.
error out contains error information. This output provides standard error out functionality.

HRV STFT Spectrogram (Waveform Evenly Sampled RR)

RR specifies the RR intervals that this VI uses to calculate the power spectral density (PSD).
STFT settings specifies parameters for the STFT.
window info specifies the sliding window that this VI uses to compute the STFT and defines the resolution of the resulting time-frequency representation.
type specifies the type of the sliding window.

0None
1Hanning (default)
2Hamming
3Blackman-Harris
4Exact Blackman
5Blackman
6Flat Top
74 Term B-Harris
87 Term B-Harris
9Low Sidelobe
10Gaussian
length specifies the length, in samples, of the sliding window. The default is -1, which indicates that this VI sets the window length to four times time steps. Thus, the overlap between sliding windows is 75 percent. However, this VI wraps the default window length to 64 when time steps is less than 16. length controls the relationship between the time resolution and the frequency resolution of the time-frequency representation. A large window length provides better frequency resolution but poorer time resolution.
time-frequency sampling info specifies the density that this VI uses 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 such 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 spectrogram for each segment. If the signal is oversampled, you also can downsample the signal. The scale info output contains the actual sampling period, in seconds, along the time axis of the spectrogram.
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. The default is 512.
error in describes error conditions that occur before this node runs. This input provides standard error in functionality.
spectrogram returns the STFT spectrogram of the input RR intervals.
scale info returns the time scale and 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 continuous columns of spectrogram.
error out contains error information. This output provides standard error out functionality.

HRV STFT Spectrogram (Array Evenly Sampled RR)

RR specifies the RR intervals that this VI uses to calculate the power spectral density (PSD).
STFT settings specifies parameters for the STFT.
window info specifies the sliding window that this VI uses to compute the STFT and defines the resolution of the resulting time-frequency representation.
type specifies the type of the sliding window.

0None
1Hanning (default)
2Hamming
3Blackman-Harris
4Exact Blackman
5Blackman
6Flat Top
74 Term B-Harris
87 Term B-Harris
9Low Sidelobe
10Gaussian
length specifies the length, in samples, of the sliding window. The default is -1, which indicates that this VI sets the window length to four times time steps. Thus, the overlap between sliding windows is 75 percent. However, this VI wraps the default window length to 64 when time steps is less than 16. length controls the relationship between the time resolution and the frequency resolution of the time-frequency representation. A large window length provides better frequency resolution but poorer time resolution.
time-frequency sampling info specifies the density that this VI uses 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 such 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 spectrogram for each segment. If the signal is oversampled, you also can downsample the signal. The scale info output contains the actual sampling period, in seconds, along the time axis of the spectrogram.
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. The default is 512.
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 the input RR intervals, in hertz. The default is 1.
spectrogram returns the STFT spectrogram of the input RR intervals.
scale info returns the time scale and 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 continuous columns of spectrogram.
error out contains error information. This output provides standard error out functionality.

Example

Refer to the HRV Analyzer VI in the labview\examples\Biomedical\Biosignal directory for an example of using the HRV STFT Spectrogram VI.

Log in to get a better experience