Frequency and time-frequency analysis in Matlab

Perform time-frequency analysis without the Signal Processing Toolbox™
1.7K Downloads
Updated 1 Dec 2023

autofft - A time-frequency analyser for Matlab

The Signal Processing Toolbox™ provides several functions to power spectrum estimation, including pspectrum, pwelch and stft. Although these functions are of high quality and well-documented, they might be cumbersome in some engineering applications. These applications include estimating magnitudes of vibration, noise and other discrete-time signals in engineering units or comparing theoretical results with measurements.

In such applications, you can use autofft to estimate the discrete Fourier transform (DFT), which mimics the properties of the Brüel & Kjaer FFT analysers. Based on your input, autofft segments signal, applies window functions and performs spectral averaging. The resulting averaged spectrum, also called modified periodogram, can be returned in various engineering spectral units, including decibels, magnitude, root mean square (RMS), peak-to-peak and power spectral density (PSD). autofft can also estimate spectral derivation or spectral integral of DFT and perform the short-time Fourier transform (STFT).

In such applications, you can use the autofft package which mimics the properties of the Brüel & Kjaer FFT analysers. Based on your input, autofft automatically filter signal, separates it into segments, applies window functions and performs spectral averaging. The resulting averaged spectrum, also called modified periodogram, can be returned in various engineering spectral units, including decibels, root mean square (RMS) and peak-to-peak magnitudes, and power spectral density (PSD). autofft can also estimate spectral derivation or spectral integral of the spectrumm and perform the short-time Fourier transform (STFT).

Capabilities of autofft

  • Does not require the Signal Processing Toolbox™.
  • Performs significantly better than pwelch and pspectrum in computationally intensive problems.
  • Estimates magnitudes of components in your data in engineering units, e.g. dB, V or Pa.
  • Provides control over the setup of the frequency analyser, which is impossible with library functions.
  • Can apply high-pass and frequency weighting filters per ISO 61672, spectral derivation or spectral integration.

What's new in v1.5?

  • v1.5.3: New functionality: The results are now visualised automatically or manually using 'PlotLayout' and 'EngineeringUnit' parameters.
  • v1.5.3: Changed functionality: 'HighPassFrequency' parameter now also accepts a filter object or numerator and denominator coefficients b and a. This feature allows experienced users to use their own filters and store them in the setup structure array.
  • v1.5.3: Documentation: New example added.
  • v1.5.3: Documentation: Nomenclature have been unified and simplified.
  • v1.5.2: Changed functionality: The package no longer requires the Signal Processing Toolbox™.
  • v1.5.2: Changed functionality: A first-order Butterworth digital filter is now used for high-pass filtering rather than a first-order elliptic filter.
  • v1.5.2: New functions: The package is now distributed with functions that can construct Blackman-Harris, flat-top, Hamming, Hann, Kaiser and uniform windows and can design an n-th order Butterworth digital filter. These functions can be found in +utilities directory.
  • v1.5.1: Code optimisation: The STFT is now computed more efficiently.
  • v1.5.1: Bug fix: In same cases, times for the STFT were evaluated more than once. This has been fixed.
  • New functionality: The output spectra can be returned in decibel scale using the 'dbReference' parameter.
  • New function: A freqWeight function, which applies frequency weighting filters to the power spectrum, is now included in the package.
  • Documentation: New example added.
  • Code optimisation: Times at which the STFT is evaluated are computed more efficiently.

Getting started

For more information read user manual or visit View Frequency and time-frequency analysis in Matlab on File Exchange

Cite As

Lubos Smolik (2024). Frequency and time-frequency analysis in Matlab (https://github.com/LubosSmolik/autofft/releases/tag/v1.5.3), GitHub. Retrieved .

MATLAB Release Compatibility
Created with R2023b
Compatible with R2016b to R2023b
Platform Compatibility
Windows macOS Linux

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Versions that use the GitHub default branch cannot be downloaded

Version Published Release Notes
1.5.3

See release notes for this release on GitHub: https://github.com/LubosSmolik/autofft/releases/tag/v1.5.3

1.5.2

See release notes for this release on GitHub: https://github.com/CarlistRieekan/autofft/releases/tag/v1.5.2

1.5.1

See release notes for this release on GitHub: https://github.com/CarlistRieekan/autofft/releases/tag/v1.5.1

1.5

See release notes for this release on GitHub: https://github.com/CarlistRieekan/autofft/releases/tag/v1.5

1.4.1

See release notes for this release on GitHub: https://github.com/CarlistRieekan/autofft/releases/tag/v1.4.1

1.4

See release notes for this release on GitHub: https://github.com/CarlistRieekan/autofft/releases/tag/v1.4

1.3.1

See release notes for this release on GitHub: https://github.com/CarlistRieekan/autofft/releases/tag/v1.3.1

1.3.0

Please, see https://github.com/CarlistRieekan/autofft/releases

1.2.5.1

See release notes for this release on GitHub: https://github.com/CarlistRieekan/autofft/releases/tag/1.2.5.1

1.2.5

An optional highpass filtering has been implemented.

1.2.4.2

Overlap length (in samples) returned in output variable setup is now correct. Previous versions incorrectly returned overlap percentage.

1.2.4.1

An error occurring during estimation of autospectrum has been fixed.

1.2.4

- Improved documentation.
- New types of averaging: median filter and variance of spectral unit.
- Results of the STFT of multiple signals are now returned as 3D array.
- Performance improved significantly.
- Accuracy of PSD slightly improved.

1.2.3

- User can define frequency resolution of the analyser.
- The window function can be directly specified as a vector.
- The analyser setup can be returned as an output variable.
- Warning messages are now displayed.

1.2.2

To view or report issues in this GitHub add-on, visit the GitHub Repository.
To view or report issues in this GitHub add-on, visit the GitHub Repository.