You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -36,6 +36,8 @@ The **processing module** (`src/processing/`) is the heart of the rust-photoacou
36
36
-**Real-time Audio Analysis**: General-purpose audio processing and analysis
37
37
-**Signal Filtering**: Digital filter chains for noise reduction and signal enhancement
38
38
-**Multi-channel Processing**: Dual-channel audio operations and differential analysis
39
+
-**Analytical Computing**: Real-time spectral analysis and peak detection for frequency tracking
40
+
-**Concentration Calculation**: Polynomial-based gas concentration computation from photoacoustic signals
39
41
40
42
---
41
43
@@ -61,10 +63,11 @@ graph TD
61
63
```rust,ignore
62
64
// Main processing module structure
63
65
pub mod processing {
64
-
pub mod consumer; // ProcessingConsumer - main processing orchestrator
65
-
pub mod graph; // ProcessingGraph - node container and execution engine
66
-
pub mod nodes; // ProcessingNode trait and implementations
67
-
pub mod result; // ProcessingResult and analysis structures
66
+
pub mod consumer; // ProcessingConsumer - main processing orchestrator
67
+
pub mod graph; // ProcessingGraph - node container and execution engine
68
+
pub mod nodes; // ProcessingNode trait and implementations
69
+
pub mod result; // ProcessingResult and analysis structures
70
+
pub mod computing_nodes; // ComputingNode - specialized analytical processing nodes
68
71
}
69
72
```
70
73
@@ -74,6 +77,8 @@ pub mod processing {
74
77
use crate::acquisition::AudioFrame; // Input audio data
75
78
use crate::preprocessing::{Filter, DifferentialCalculator}; // Processing algorithms
76
79
use crate::config::processing::*; // Configuration structures
80
+
use realfft::{RealFftPlanner, RealToComplex}; // FFT processing for ComputingNodes
81
+
use num_complex; // Complex number arithmetic for spectral analysis
77
82
```
78
83
79
84
---
@@ -280,6 +285,118 @@ pub enum MixStrategy {
280
285
281
286
---
282
287
288
+
### Computing Nodes (Analytical Processing)
289
+
290
+
Computing Nodes are specialized ProcessingNodes that implement the **pass-through pattern** while performing analytical computations on the data. They allow the original signal to flow unchanged to the next node while extracting analytical information and publishing it to a shared state for use by other nodes.
291
+
292
+
#### Key Features:
293
+
-**Pass-through Processing**: Data flows unchanged, maintaining pipeline integrity
294
+
-**Parallel Analysis**: Performs computations without affecting data latency
295
+
-**Shared State**: Results are published to thread-safe shared state (`Arc<RwLock<ComputingSharedData>>`)
296
+
-**Real-time Analytics**: Enables real-time frequency tracking and concentration calculation
297
+
298
+
#### PeakFinderNode (Spectral Analysis)
299
+
**Purpose**: Performs real-time FFT-based spectral analysis to detect frequency peaks while passing data through unchanged.
300
+
301
+
```rust,ignore
302
+
use rust_photoacoustic::processing::computing_nodes::PeakFinderNode;
303
+
304
+
// Create peak finder with custom configuration
305
+
let peak_finder = PeakFinderNode::new("peak_detector".to_string())
0 commit comments