lombscargle.m

版本 1.0.1.0 (7.0 KB) 作者: Brett Shoelson
Performs a Lomb-Scargle periodogram analysis on unevenly spaced data.
11.4K 次下载
更新时间 2020/7/17

查看许可证

LOMBSCARGLE(INPUTDATA, DUPE_ELIM) performs a Lomb-Scargle periodogram (spectral) analysis on an n x 2 matrix of data (inputdata = x(i),y(i)) that are not necessarily evenly spaced. (For evenly spaced data, more traditional Fourier-based spectral methods may be more appropriate.)

DUPE_ELIM (= 0 or 1) is an optional argument that will prompt the program (if dupe_elim == 1) to eliminate duplicated samples from the analysis. The default value is 0.

This program will plot and spectrally analyze the input data, and then plot the power spectrum of the data.

The program is also capable of overlaying a signal of known frequency and amplitude; this may be helpful for spectral calibration. The resulting spectrum plot will also include significance levels. Finally, the program will reconstruct a plot of frequencies determined to be "significant" (at alpha = 0.05); for this reconstruction, frequencies within 5% of the calibration signal (if used) will be discarded. Significant frequencies and powers are written to the MATLAB command window.

(This program is based on a Lomb-Scargle implementation in Press, Teukolsky, et al. Numerical Recipes, "Spectral Analysis of Unevenly Sampled Data." Use of this program requires an understanding of the Press/Teukolsky implementation, inculding the usage of hifac and ofac variables. The user is referred to that source for a thorough discussion of the algorithms. In addition, the references cited in Press/Teukolsky are quite helpful--particularly Scargle 1982, and Horne and Baliunas, 1986.)

Note that there is an over-reliance in this code on global variables, and that no attempts have been made to vectorize for loops or to optimize the implementation. Perhaps in the next version....

The attached file INPUTTOLOMB.M includes code for easily generating test data with known frequencies and amplitudes. This file is helpful for users trying to understand the output generated by lombscargle.

引用格式

Brett Shoelson (2024). lombscargle.m (https://www.mathworks.com/matlabcentral/fileexchange/993-lombscargle-m), MATLAB Central File Exchange. 检索时间: .

MATLAB 版本兼容性
创建方式 R12.1
兼容任何版本
平台兼容性
Windows macOS Linux
类别
Help CenterMATLAB Answers 中查找有关 Predictive Maintenance Toolbox 的更多信息
致谢

启发作品: Lomb normalized periodogram

Community Treasure Hunt

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

Start Hunting!
版本 已发布 发行说明
1.0.1.0

I removed references to an unused variable (dataid) that I had prompted for.

1.0.0.0

Eliminates a duplicated subfunction, and fixes a bug when hifac is selected. Also, now successfully evaluates the real part of imaginary data.