# Least-squares spectral analysis
<!-- MICROSIMGEN:BEGIN v1.7 — generated by g08_place_microsims.py; three.js first (§15); do not hand-edit inside -->
## Microsims — p5.js
### Least-squares spectral analysis (p5.js) · `LSSA`
<div class="microsim-player">
<iframe src="https://editor.p5js.org/sciencenibber/full/h0z2TzuUv" width="100%" height="480" frameborder="0" loading="lazy" sandbox="allow-scripts allow-same-origin" title="Least-squares spectral analysis — p5.js microsim"></iframe>
</div>
*Find a spectrum by fitting sinusoids in the least-squares sense — works on unevenly sampled data where the FFT can't.*
**Open in the editor:** [▶ fork this sketch](https://editor.p5js.org/sciencenibber/sketches/h0z2TzuUv) · movement *II · Transforms & the frequency domain* · library `p5js`
### Related microsims
Live sims on neighbouring articles — 6 of them inside this article's own Wikipedia link tree:
- [[Autocorrelation]] *(in tree)*
- [[Calculus]] *(in tree)*
- [[Complex_analysis]] *(in tree)*
- [[Decibel]] *(in tree)*
- [[Fast_Fourier_transform]] *(in tree)*
- [[Fourier_analysis]] *(in tree)*
*Sim hosted off-article; the article owns the reference, not the runtime (WIKI_RULES §10.4). Placed by `g08_place_microsims.py`.*
<!-- MICROSIMGEN:END -->
## Links (Wikipedia order)
<!-- injected from _registry/childlinks/Least-squares_spectral_analysis.json (2026-07-30T02:09:12Z) -->
`Accelerated_failure_time_model` · `Actuarial_science` · `Akaike_information_criterion` · `Algebraic_analysis` · `Amplitude` · `Analysis_of_covariance` · `Analysis_of_variance` · `Anderson–Darling_test` · `Anscombe_transform` · `Arithmetic_mean` · `Arithmetic–geometric_mean` · `Asymptotic_theory_(statistics)` · [[Autocorrelation]] · `Autoregressive_conditional_heteroskedasticity` · `Autoregressive_model` · `Average_absolute_deviation` · `Backslash` · [[Bar_chart]] · `Bayes_estimator` · `Bayes_factor` · `Bayesian_inference` · `Bayesian_information_criterion` · `Bayesian_linear_regression` · `Bayesian_multivariate_linear_regression` · `Bayesian_probability` · `Beta_distribution` · `Bias_of_an_estimator` · `Binary_regression` · `Binomial_regression` · [[Bioinformatics]] · `Biostatistics` · `Biplot` · `Blocking_(statistics)` · `Bootstrapping_(statistics)` · [[Box_plot]] · `Box–Jenkins_method` · `Breusch–Godfrey_test` · [[Calculus]] · [[Calculus_of_variations]] · `Canonical_correlation` · `Carl_Friedrich_Gauss` · `Cartography` · `Categorical_variable` · `Census` · `Central_limit_theorem` · `Centrum_Wiskunde_&_Informatica` · `Chemometrics` · `Chi-squared_test` · `Cholesky_decomposition` · `Clinical_study_design` · `Clinical_trial` · `Cluster_analysis` · `Cluster_sampling` · `Cochran–Mantel–Haenszel_statistics` · `Coefficient_of_determination` · `Coefficient_of_variation` · `Cohen's_kappa` · `Cohort_study` · `Cointegration` · `Completeness_(statistics)` · [[Complex_analysis]] · `Confidence_interval` · `Confounding` · `Contingency_table` · `Continuous_function` · `Contraharmonic_mean` · `Control_chart` · `Coordinate_vector` · `Correlogram` · `Count_data` · `Credible_interval` · `Crime_statistics` · `Cross-correlation` · `Cross-sectional_study` · `Cross-validation_(statistics)` · `Cubic_mean` · `Data_collection` · `Data_preprocessing` · `Data_transformation_(statistics)` · [[Decibel]] · `Decomposition_of_time_series` · `Degrees_of_freedom_(statistics)` · `Demographic_statistics` · `Density_estimation` · `Derivative` · `Descriptive_statistics` · `Design_of_experiments` · `Dickey–Fuller_test` · [[Differential_equation]] · `Dimensionality_reduction` · `Discrete_Fourier_transform` · `Discrete_choice` · `Divergence_(statistics)` · `Dot_product` · `Durbin–Watson_statistic` · `Econometrics` · `Effect_size` · `Efficiency_(statistics)` · `Elliptical_distribution` · `Empirical_distribution_function` · `Engineering_statistics` · `Environmental_statistics` · `Epidemiology` · `Errors_and_residuals` · `Estimating_equations` · `Experiment` · `Exponential_family` · `Exponential_smoothing` · `F-test` · `Factor_analysis` · `Factorial_experiment` · `Failure_rate` · `Fan_chart_(statistics)` · [[Fast_Fourier_transform]] · `Feature_scaling` · `First-hitting-time_model` · `Fisher_transformation` · `Fixed_effects_model` · `Forest_plot` · [[Fourier_analysis]] · `Fourier_transform` · [[Frequency_domain]] · `Frequentist_inference` · `Friedman_test` · `Function_(mathematics)` · [[Functional_analysis]] · `Fundamental_theorem_of_calculus` · `G-test` · `Gauss–Markov_theorem` · `General_linear_model` · `Generalized_estimating_equation` · `Generalized_least_squares` · `Generalized_linear_model` · `Generalized_mean` · `Geodesy` · `Geographic_information_system` · `Geometric_mean` · `Geophysics` · `Geostatistics` · `Goodness_of_fit` · `Granger_causality` · `Graphical_model` · `Grouped_data` · `Harmonic_analysis` · `Harmonic_mean` · `Heinz_mean` · `Heronian_mean` · [[Histogram]] · `Hodges–Lehmann_estimator` · `Homoscedasticity_and_heteroscedasticity` · `Hypercomplex_analysis` · `Identity_matrix` · `Index_of_dispersion` · `Infinity` · `Integral` · `Interaction_(statistics)` · `Interquartile_range` · `Interval_estimation` · `Isotonic_regression` · `Iteratively_reweighted_least_squares` · `Jackknife_resampling` · `Jarque–Bera_test` · `Johansen_test` · `Jonckheere's_trend_test` · `Jurimetrics` · `Kaplan–Meier_estimator` · `Kendall_rank_correlation_coefficient` · `Kingston,_Ontario` · `Kolmogorov–Smirnov_test` · `Kriging` · `Kruskal–Wallis_test` · `Kurtosis` · `L-moment` · `Least-angle_regression` · `Least_absolute_deviations` · `Least_squares` · `Lehmann–Scheffé_theorem` · `Lehmer_mean` · `Likelihood-ratio_test` · `Likelihood_function` · `Lilliefors_test` · `Limit_(mathematics)` · [[Line_chart]] · `Linear_discriminant_analysis` · `Linear_least_squares` · `Linear_regression` · `List_of_fields_of_application_of_statistics` · `List_of_statistical_tests` · `List_of_statistics_articles` · `Lists_of_integrals` · `Ljung–Box_test` · `Local_regression` · `Location_parameter` · `Location–scale_family` · `Logistic_regression` · `Loss_function` · `Lp_space` · `M-estimator` · `MATLAB` · `Magnitude_(mathematics)` · `Mann–Whitney_U_test` · `Matching_pursuit` · `Mathematical_analysis` · `Matrix_calculus` · `Maximum_a_posteriori_estimation` · `McNemar's_test` · `Measure_(mathematics)` · `Median` · `Medical_statistics` · `Method_of_moments_(statistics)` · `Methods_engineering` · `Microlocal_analysis` · `Minimum-variance_unbiased_estimator` · `Missing_data` · `Mixed_logit` · `Mixed_model` · `Mode_(statistics)` · `Model_selection` · `Moment_(mathematics)` · `Monotone_likelihood_ratio` · `Multilevel_model` · `Multinomial_logistic_regression` · `Multinomial_probit` · `Multivariate_analysis_of_variance` · `Multivariate_normal_distribution` · `Multivariate_statistics` · `National_accounts` · `Natural_experiment` · `Nelson–Aalen_estimator` · `Non-linear_least_squares` · `Non-negative_least_squares` · `Non-uniform_discrete_Fourier_transform` · `Nonlinear_mixed-effects_model` · `Nonlinear_regression` · `Nonlinear_system_identification` · `Nonparametric_regression` · `Nonparametric_statistics` · `Normalization_(statistics)` · `Observational_study` · `Official_statistics` · `One-_and_two-tailed_tests` · `Opinion_poll` · `Optimal_decision` · `Order_statistic` · `Ordered_logit` · [[Ordinary_differential_equation]] · `Ordinary_least_squares` · `Orthogonal_functions` · `Outlier` · `Outline_of_statistics` · `P-adic_analysis` · `P-adic_number` · `Parametric_statistics` · `Partial_autocorrelation_function` · `Partial_correlation` · [[Partial_differential_equation]] · `Partial_least_squares_regression` · `Partition_of_sums_of_squares` · `Pearson_correlation_coefficient` · `Percentile` · `Periodogram` · `Permutation_test` · `Petr_Vaníček` · `Pie_chart` · `Pivotal_quantity` · `Point_estimation` · `Poisson_regression` · `Polynomial_regression` · `Posterior_probability` · `Power_(statistics)` · `Power_transform` · `Prediction_interval` · `Principal_component_analysis` · `Principal_component_regression` · `Prior_probability` · `Probabilistic_design` · `Probability_distribution` · `Probit_model` · `Proportional_hazards_model` · `Psychometrics` · `Quadratic_function` · `Quality_control` · `Quantile_regression` · `Quasi-experiment` · `Quaternionic_analysis` · `Queen's_University_at_Kingston` · `Questionnaire` · `Q–Q_plot` · `Radar_chart` · `Random_assignment` · `Random_effects_model` · `Randomized_controlled_trial` · `Randomized_experiment` · `Range_(statistics)` · `Rank_correlation` · `Ranking_(statistics)` · `Rao–Blackwell_theorem` · `Real_analysis` · `Regression_analysis` · `Regression_validation` · `Regularized_least_squares` · [[Reliability_engineering]] · `Replication_(statistics)` · `Representation_theory` · `Resampling_(statistics)` · `Richard_A._Muller` · `Robust_regression` · `Robust_statistics` · `Run_chart` · `Sample_size_determination` · `Sampling_(statistics)` · `Sampling_distribution` · `Scale_parameter` · [[Scatter_plot]] · `Scientific_control` · `Score_test` · `Seasonal_adjustment` · `Segmented_regression` · `Semiparametric_regression` · `Series_(mathematics)` · `Shape_parameter` · `Shapiro–Wilk_test` · `Sign_test` · `Simple_linear_regression` · `Simultaneous_equations_model` · [[Sine_wave]] · `Skewness` · `Social_statistics` · `Sparse_matrix` · `Spatial_analysis` · `Spearman's_rank_correlation_coefficient` · `Special_functions` · `Spectral_density` · `Spectral_density_estimation` · `Standard_deviation` · `Standard_error` · `Standard_score` · `Stationary_process` · `Statistic` · `Statistical_classification` · `Statistical_dispersion` · `Statistical_distance` · `Statistical_graphics` · `Statistical_hypothesis_test` · `Statistical_inference` · `Statistical_model` · `Statistical_parameter` · `Statistical_population` · `Statistical_process_control` · `Statistical_theory` · `Statistics` · `Stem-and-leaf_display` · `Stochastic_approximation` · `Stochastic_differential_equation` · `Stratified_sampling` · `Structural_break` · `Structural_equation_modeling` · `Student's_t-test` · `Studentized_residual` · `Sufficient_statistic` · `Survey_methodology` · `Survival_analysis` · `Survival_function` · [[System_identification]] · [[Time_domain]] · [[Time_series]] · `Tolerance_interval` · `Total_least_squares` · `Tropical_analysis` · `Truncation_(statistics)` · `U-statistic` · `U.S._National_Geodetic_Survey` · `Uniformly_most_powerful_test` · `University_of_New_Brunswick` · `University_of_Sydney` · `V-statistic` · `Van_der_Waerden_test` · `Variance` · `Variance-stabilizing_transformation` · `Vector_autoregression` · `Vector_calculus` · `Vector_generalized_linear_model` · `Violin_plot` · `Wald_test` · `Wavelet` · `Weighted_least_squares` · `Whittle_likelihood` · `Wilcoxon_signed-rank_test` · `Winsorizing` · `Z-test`
> Signal Processing concept · part of the Signal Processing Portal · movement II · !31 変換 henkan.svg
<!-- RENDER-THUMB:START -->
!480
*Rendered from the live microsim (▶ motion).*
<!-- RENDER-THUMB:END -->
## See it next
[](Spectral_estimation)
*→ Spectral estimation*
<!-- VISUAL-LINK:END -->
---
Back to Signal Processing Portal · the room · Semiotic gateway
## What it is
Least-squares spectral analysis (LSSA) estimates a signal's spectrum by fitting sinusoids to the data in a least-squares sense, rather than by a Fourier transform.
## How it works / why it matters
For each trial frequency, sine and cosine terms are fitted to minimize the squared residual, and the reduction in residual variance gives the spectral power at that frequency. Because it does not assume uniform sampling, LSSA handles unevenly or sparsely sampled data — a common situation in astronomy and geophysics — where the ordinary DFT fails. The widely used Lomb–Scargle periodogram is the standard implementation of this idea.
## Signs & universals
Instantiates: spectrum, frequency, signal.
## Related
Spectral estimation · Prony's method · Power spectral density · [[Fourier_analysis]] · Discrete Fourier transform · Fourier transform
<!-- VISUAL-LINK:START -->
<!-- CRAFT-LINK:START g12 -->
*Built to the [[WT!P5_js_Microsim_Master_Class|p5.js Master Class]].*
<!-- CRAFT-LINK:END -->
## Wikipedia : Wikitube
**Strict pair:** [Wikipedia](https://en.wikipedia.org/wiki/Least-squares_spectral_analysis) : [Wikitube](https://en.wikitube.io/wiki/Least-squares_spectral_analysis)
## Previous hub tags
Tree parents: [[Monte_Carlo_method]] · [[Reliability_engineering]].
Legacy hubs: none.
---
*Sources: 1 legacy note. Minted wave 1, 2026-07-30 (v1.6 order).*