-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathREADME.txt
More file actions
115 lines (72 loc) · 3.01 KB
/
Copy pathREADME.txt
File metadata and controls
115 lines (72 loc) · 3.01 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
# kernelize: Signal Kernelization via Exponential and Impulse Convolution (MATLAB)
Applies kernelization to multivariate signals by convolving each sample with a bank of normalized exponential and impulse kernels to enhance feature extraction in trilinear decomposition.
**Reference**:
Gómez-Sánchez, Adrián, et al. (2023). *Kernelizing: A way to increase accuracy in trilinear decomposition analysis of multiexponential signals*.
Analytica Chimica Acta, vol. 1273, article 341545.
---
## Overview
The `kernelize` function transforms a two-dimensional data matrix `D` (samples × timepoints) into a three-way array by applying a set of user-specified kernels via convolution.
It generates:
- **Impulse kernels** at the first and last positions to capture local spikes
- **Paired decaying exponentials** mirrored about the center to detect transient behaviors
- **A symmetric exponential** (if an odd number of kernels is requested)
All kernels are normalized to unit maximum to ensure comparability.
Convolution is performed using the `'valid'` option, producing an output length of:
num_timepoints – kernel_width + 1
The result is a 3D array of size `[samples × kernels × timepoints′]`, ready for trilinear or multicomponent analysis.
---
## Inputs
- `D` (matrix): Input data matrix `[samples × timepoints]`
- `num_kernels` (integer): Number of kernels to apply (≥2)
- `kernel_width` (integer): Width of each kernel (≤ number of columns in `D`)
## Output
- `D_kernelized`: 3D array `[samples × kernels × timepoints′]`
---
## Usage Example
(Insert into MATLAB script or command window)
% Example data: 10 samples, 100 timepoints
D = randn(10,100);
% Specify number of kernels and kernel width
num_kernels = 5; % must be integer ≥2
kernel_width = 20; % ≤ number of columns in D
% Apply kernelization
D_kernelized = kernelize(D, num_kernels, kernel_width);
% Inspect size: [10 × 5 × (100-20+1)]
disp(size(D_kernelized)); % → [10 5 81]
---
## Installation
### Prerequisites
- MATLAB R2016a or later
- No additional toolboxes required
### Setup
1. Save `kernelize.m` into a directory on your MATLAB path.
2. Add the folder:
addpath('path/to/your/functions');
3. Verify availability:
which kernelize
### Dependencies
- Built-in MATLAB functions: `conv`, `exp`, `linspace`, `max`, `warning`, basic matrix operations
---
## License
Released under the **MIT License**.
---
## Authors
- **Adrián Gómez-Sánchez**
- **Created**: December 14, 2024
- **Reviewed by**: Lovelace’s Square
---
## Changelog
- **v1.0 (2024-12-14)**: Initial release reviewed by Lovelace’s Square
---
## Keywords
- Kernelization
- Convolution
- Signal processing
- MATLAB
- Multivariate analysis
- Three-way data
-Trilinear
- Exponential kernels
- Feature extraction
- Trilinear decomposition
- Data transformation