Skip to content

Commit fca4c0d

Browse files
chore: add new structure (#113)
* add new structure * Apply suggestions from code review Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> * Apply suggestions from code review Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --------- Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
1 parent 87a1aa9 commit fca4c0d

94 files changed

Lines changed: 414 additions & 298 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎.github/copilot-instructions.md‎

Lines changed: 17 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,20 @@ This is a numerical algorithms library providing digital signal processing (DSP)
88

99
- **numerical/**: Core implementation of algorithms organized by domain:
1010
- `analysis/`: Signal analysis (FFT, PSD, DCT)
11-
- `controllers/`: Control algorithms (PID controllers)
12-
- `dynamics/`: Dynamics and modeling (Euler-Lagrange)
13-
- `estimators/`: Estimation algorithms (Linear Regression, Yule-Walker)
11+
- `windowing/`: Window functions for spectral analysis
12+
- `control_analysis/`: Control system analysis (Frequency Response, Root Locus)
13+
- `controllers/`: Control algorithms (PID, LQR, MPC)
14+
- `dynamics/`: Dynamics and modeling (Euler-Lagrange, Newton-Euler)
15+
- `estimators/`: Estimation algorithms
16+
- `offline/`: Batch estimators (Linear Regression, Yule-Walker)
17+
- `online/`: Streaming estimators (Recursive Least Squares)
1418
- `filters/`: Digital filters (FIR, IIR, Kalman)
19+
- `kinematics/`: Forward/inverse kinematics
1520
- `math/`: Mathematical foundations (QNumber, Matrix, Complex, Trigonometric functions)
16-
- `neural_network/`: Neural network components (layers, activations, optimizers)
17-
- `solvers/`: Numerical solvers (Levinson-Durbin)
18-
- `windowing/`: Window functions for signal processing
21+
- `neural_network/`: Neural network components (layers, activations, losses, model)
22+
- `optimization/`: General-purpose optimizers (Gradient Descent)
23+
- `regularization/`: Regularization techniques (L1, L2)
24+
- `solvers/`: Numerical solvers (Levinson-Durbin, Gaussian Elimination, DARE)
1925
- **doc/**: Comprehensive documentation for each algorithm with mathematical background
2026
- **embedded-infra-lib/**: Submodule containing infrastructure foundations and utilities for embedded systems
2127

@@ -61,7 +67,7 @@ Place code here when it is:
6167
- Estimators and solvers
6268
- Neural network components
6369
- Hardware-agnostic and reusable across projects
64-
- Organized by domain (analysis, controllers, dynamics, filters, estimators, math, neural_network, solvers, windowing)
70+
- Organized by domain (analysis, control_analysis, controllers, dynamics, estimators, filters, kinematics, math, neural_network, optimization, regularization, solvers)
6571

6672
### Documentation (`doc/`)
6773

@@ -285,15 +291,18 @@ class Algorithm
285291
- **INTERFACES**: Define interfaces (pure virtual classes) for testability and flexibility
286292
- **NAMESPACE**: Use appropriate namespaces by domain:
287293
- `analysis::` - Signal analysis algorithms
294+
- `control_analysis::` - Control system analysis (Frequency Response, Root Locus)
288295
- `controllers::` - Control system algorithms
289296
- `dynamics::` - Dynamics and modeling algorithms
290297
- `estimators::` - Estimation algorithms
291298
- `filters::passive::` - Passive filters (FIR, IIR)
292299
- `filters::active::` - Active filters (Kalman)
293300
- `math::` - Mathematical utilities and functions
294301
- `neural_network::` - Neural network components
302+
- `optimization::` - General-purpose optimizers
303+
- `regularization::` - Regularization techniques
295304
- `solvers::` - Numerical solvers
296-
- `windowing::` - Window functions
305+
- `windowing::` - Window functions (under `analysis/windowing/`)
297306
- **SELF-DOCUMENTING CODE**: Write clear, self-explanatory code with descriptive names
298307
- **UNITS**: Be explicit about units (radians, Hz, samples, normalized) in variable names or comments
299308
- **NUMERICAL TYPES**: Support multiple numeric representations:

‎README.md‎

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,17 @@ Refer to the documentation to quickly integrate and utilize the library's signal
1616

1717
| Category | Description |
1818
|--------------------------------------------------------------------|----------------------------------------------------------------------|
19-
| [Analysis](doc/analysis/README.md) | FFT, Power Spectral Density, DCT, Root Locus |
20-
| [Controllers](doc/controllers/README.md) | PID, LQR |
19+
| [Analysis](doc/analysis/README.md) | FFT, Power Spectral Density, DCT, Window Functions |
20+
| [Control Analysis](doc/control_analysis/README.md) | Frequency Response, Root Locus |
21+
| [Controllers](doc/controllers/README.md) | PID, LQR, MPC |
2122
| [Dynamics](doc/dynamics/README.md) | Euler-Lagrange, Newton-Euler, Recursive Newton-Euler, ABA |
22-
| [Estimators](doc/estimators/README.md) | Linear Regression, Yule-Walker |
23+
| [Estimators](doc/estimators/README.md) | Linear Regression, Yule-Walker (offline), Recursive Least Squares (online) |
2324
| [Filters](doc/filters/README.md) | Kalman, Extended Kalman, Unscented Kalman, FIR, IIR |
2425
| [Kinematics](doc/kinematics/README.md) | Forward Kinematics |
25-
| [Neural Network](doc/neural_network/README.md) | Layers, activations, losses, optimizers, regularization |
26+
| [Neural Network](doc/neural_network/README.md) | Layers, activations, losses, model |
27+
| [Optimization](doc/optimization/README.md) | Gradient Descent |
28+
| [Regularization](doc/regularization/README.md) | L1 (Lasso), L2 (Ridge) |
2629
| [Solvers](doc/solvers/README.md) | Gaussian Elimination, Levinson-Durbin, Durand-Kerner, Cholesky, DARE |
27-
| [Windowing](doc/windowing/README.md) | Rectangular, Hamming, Hann, Blackman |
2830
| [Performance Optimization](doc/performance-optimization/README.md) | Compiler optimizations, SIMD |
2931

3032
Each category page lists its algorithms with a brief description and links to the detailed documentation.

‎doc/analysis/README.md‎

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Analysis
22

3-
Signal analysis algorithms for frequency-domain decomposition, spectral estimation, and system characterization.
3+
Signal analysis algorithms for frequency-domain decomposition and spectral estimation.
44

55
## Algorithms
66

@@ -9,4 +9,11 @@ Signal analysis algorithms for frequency-domain decomposition, spectral estimati
99
| [Fast Fourier Transform](FastFourierTransform.md) | Efficient computation of the Discrete Fourier Transform using the Cooley-Tukey radix-2 algorithm |
1010
| [Power Spectral Density](PowerDensitySpectrum.md) | Estimation of signal power distribution across frequencies using Welch's method |
1111
| [Discrete Cosine Transform](DiscreteCosineTransform.md) | Real-valued frequency decomposition via cosine basis functions, computed through FFT |
12-
| [Root Locus](RootLocus.md) | Closed-loop pole trajectory analysis as a function of loop gain |
12+
13+
## Sub-domains
14+
15+
| Sub-domain | Description |
16+
|-------------------------------------|----------------------------------------------------------------------------------|
17+
| [Windowing](../windowing/README.md) | Window functions (Rectangular, Hamming, Hanning, Blackman) for FFT preprocessing |
18+
19+
> **Note:** For control system analysis tools (Frequency Response, Root Locus), see [Control Analysis](../control_analysis/README.md).

‎doc/control_analysis/README.md‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# Control Analysis
2+
3+
Control system analysis tools for characterizing dynamic systems and feedback loop behavior.
4+
5+
## Algorithms
6+
7+
| Algorithm | Description |
8+
|--------------------------------------------|-------------------------------------------------------------------------------|
9+
| [Frequency Response](FrequencyResponse.md) | Magnitude and phase response of digital filters across the frequency spectrum |
10+
| [Root Locus](RootLocus.md) | Closed-loop pole trajectory analysis as a function of loop gain |
File renamed without changes.

‎doc/estimators/README.md‎

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,15 @@
22

33
Statistical estimation algorithms for fitting models to observed data and making predictions.
44

5-
## Algorithms
5+
## Offline Estimators (Batch)
66

77
| Algorithm | Description |
88
|------------------------------------------|-------------------------------------------------------------------------|
99
| [Linear Regression](LinearRegression.md) | Ordinary least-squares regression using the normal equation |
1010
| [Yule-Walker](YuleWalker.md) | Autoregressive model parameter estimation via the Yule-Walker equations |
11+
12+
## Online Estimators (Streaming)
13+
14+
| Algorithm | Description |
15+
|-----------------------------------------------------|--------------------------------------------------------------------------|
16+
| [Recursive Least Squares](RecursiveLeastSquares.md) | Sample-by-sample parameter estimation with exponential forgetting factor |

‎doc/neural_network/NeuralNetwork.md‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ graph LR
104104
- **Dead neurons.** ReLU neurons that receive only negative inputs output zero forever. LeakyReLU mitigates this.
105105
- **Fixed-point saturation.** In Q15/Q31, activations and gradients must stay within $[-1, 1)$. Scale inputs and learning rates accordingly.
106106
- **Learning rate sensitivity.** Too high → divergence; too low → no progress. Start with $\eta = 0.01$ and adjust.
107-
- **Overfitting.** Small embedded datasets are easily memorized. Apply [regularization](regularization/Regularization.md) (L2 weight decay).
107+
- **Overfitting.** Small embedded datasets are easily memorized. Apply [regularization](../regularization/Regularization.md) (L2 weight decay).
108108

109109
## Variants & Generalizations
110110

@@ -151,8 +151,8 @@ graph TD
151151
| [Dense Layer](layer/Layer.md) | The fundamental building block; computes affine transformations |
152152
| [Activation Functions](activation/Activation.md) | Introduce non-linearity after each layer |
153153
| [Loss Functions](losses/Loss.md) | Define the training objective |
154-
| [Optimizer](optimizer/Optimizer.md) | Drives parameter updates via gradient descent |
155-
| [Regularization](regularization/Regularization.md) | Penalizes complexity to prevent overfitting |
154+
| [Optimizer](../optimization/Optimizer.md) | Drives parameter updates via gradient descent |
155+
| [Regularization](../regularization/Regularization.md) | Penalizes complexity to prevent overfitting |
156156
| [Model](model/Model.md) | Composes layers into a trainable pipeline |
157157
| [Linear Regression](../estimators/LinearRegression.md) | Special case: single layer, identity activation, MSE loss |
158158

‎doc/neural_network/README.md‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,6 @@ Components for building, training, and evaluating feed-forward neural networks e
1010
| [Layers](layer/Layer.md) | Dense (fully connected) layer with forward and backward pass |
1111
| [Activation Functions](activation/Activation.md) | Non-linear element-wise transforms: ReLU, LeakyReLU, Sigmoid, Tanh, Softmax |
1212
| [Loss Functions](losses/Loss.md) | Objective functions: MSE, MAE, Binary Cross-Entropy, Categorical Cross-Entropy |
13-
| [Optimizers](optimizer/Optimizer.md) | Parameter update strategies: Gradient Descent |
14-
| [Regularization](regularization/Regularization.md) | Complexity penalties: L1 (Lasso) and L2 (Ridge) |
1513
| [Model](model/Model.md) | Variadic-template model composing layers, optimizer, and loss into a trainable pipeline |
14+
15+
> **See also:** [Optimization](../optimization/README.md) for optimizers (Gradient Descent) and [Regularization](../regularization/README.md) for weight penalties (L1, L2) — these are general-purpose domains used by neural networks and other algorithms.

‎doc/neural_network/layer/Layer.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ graph TD
117117
|-----------------------------------------------------------|----------------------------------------------------------------------------------------|
118118
| [Activation Functions](../activation/Activation.md) | Applied element-wise after the affine transformation |
119119
| [Model](../model/Model.md) | Chains multiple dense layers into a network |
120-
| [Optimizer](../optimizer/Optimizer.md) | Updates $W$ and $b$ using the computed gradients |
120+
| [Optimizer](../../optimization/Optimizer.md) | Updates $W$ and $b$ using the computed gradients |
121121
| [Linear Regression](../../estimators/LinearRegression.md) | A dense layer with identity activation and MSE loss is equivalent to linear regression |
122122

123123
## References & Further Reading

0 commit comments

Comments
 (0)