From ef2dcd92d8364510fd35446c9ddf745a6cee9d89 Mon Sep 17 00:00:00 2001 From: Philipp Paul Klose Date: Thu, 12 Nov 2026 16:36:53 +0100 Subject: [PATCH 01/30] docs: add vibration measurement (accelerometer) spec v0.2 Co-Authored-By: Claude Opus 5.5 --- docs/VIBRATION_SPEC.md | 362 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 362 insertions(+) create mode 100644 docs/VIBRATION_SPEC.md diff --git a/docs/VIBRATION_SPEC.md b/docs/VIBRATION_SPEC.md new file mode 100644 index 0000000..1336923 --- /dev/null +++ b/docs/VIBRATION_SPEC.md @@ -0,0 +1,362 @@ +# SPLMeter — Vibration Measurement (Accelerometer) Specification + +Status: **Draft v0.2** · 2026-11-12 · target: next minor version after v3.5.2 +(v0.2: open points resolved, weighting parameters and limit values cross-checked against public sources — see §14) + +## 1. Goals + +Add vibration measurement with IEPE accelerometers to SPLMeter, integrated seamlessly with the existing acoustic measurement — not a separate app mode. + +| Decision | Value | +|---|---| +| Use cases | Machinery / condition monitoring, human exposure (whole-body + hand-arm), building vibration, structure-borne sound | +| Hardware | IEPE accelerometer → DC-coupled audio interface with IEPE supply | +| Axes | Triaxial from the start (uniaxial also supported) | +| Mixed use | Microphone and accelerometer simultaneously (e.g. mic on input 1, triax on inputs 2–4) | +| Layout | Vibration panel below the SPL meter, appears when an accelerometer is configured; shared timeline | +| Targets | Standalone, VST3, AU (iOS later) | +| Export | Vibration columns in CSV/JSON **and** a separate vibration report (HTML) | + +### Non-goals + +- SPLMeter does not claim conformance to ISO 8041 or DIN 45669 as a type-tested instrument. The report states this explicitly (§9.4). +- More than one accelerometer sensor at the same time (e.g. two triaxial sensors). The channel model allows it, but the UI and report in this version handle **one mic + one accelerometer sensor** (decided). +- Report languages other than English (decided: English first; strings are kept in one table so German can be added later). +- Hardware-specific integrations (TEDS readout, DAQ SDKs). + +## 2. Current architecture (relevant parts) + +- `PluginProcessor` receives up to 32 channels (standalone `discreteChannels(32)`); plugins accept 1–8 (`isBusesLayoutSupported`). +- Per-channel processing: optional mute → optional 20 Hz–20 kHz bandpass (48 dB/oct) → optional correction convolution → **mono mix** of active channels → A/C weighting → SPL detectors with `calOffset`. +- FFT: `fftCircBuf_` (mono mix) + `fftCircBufDual_[2]` (inputs 1 and 2) sharing `fftWritePos_`; `copyFftWindow(dest, size, channel)`. +- Timeline: `LogEntry` pushed every 125 ms. +- WAV recording: **stereo only** (`wavCircBuf_[2]`, writer with 2 channels). +- Non-parameter settings persist in the `UIState` child of `apvts.state` (v3.5.2). + +## 3. Channel model + +### 3.1 Input channel configuration + +Each physical input gets a role. Stored in `UIState/Inputs` (non-automatable, persisted, included in JSON export/import). + +```cpp +enum class SensorRole { Mic, AccelX, AccelY, AccelZ, AccelUniaxial, Off }; + +struct InputChannelConfig +{ + SensorRole role = SensorRole::Mic; // default keeps today's behaviour + // Accelerometer only: + double calDb = 140.0; // dB re 1 µm/s² at 0 dBFS RMS sine (see §4) + juce::String sensorSerial; // free text, goes into the report +}; +``` + +Rules: +- **Default: all channels `Mic`** → behaviour identical to v3.5.2. No migration needed. +- The **mono mix** and the **20 Hz bandpass** only include `Mic` channels. Accelerometer channels bypass both. +- Mute applies to all roles. +- Correction convolution (`correctionFile`) applies to `Mic` channels only. +- Validation: at most one of each `AccelX/Y/Z`, or exactly one `AccelUniaxial`, and not both kinds. Invalid configs are shown in red in Settings and the accelerometer path stays inactive. +- If a configured channel does not exist on the current device or bus (e.g. a stereo DAW track), the Vibration panel shows "Input 3 (Z) not available". + +### 3.2 Accelerometer sensor settings + +Stored in `UIState/Accel`: + +| Setting | Values | Notes | +|---|---|---| +| `profile` | see §6 | Selects weighting, quantity, detectors, report contents | +| `highPassHz` | 0.1 … 20 Hz | DC removal ahead of integration; defaults come from the profile | +| `lowerLimitHz` | 0.1 … 20 Hz | Sensor's lower usable frequency (datasheet); readings and bands below are marked unreliable | +| `upperLimitHz` | 100 … fs/2 | Sensor's upper usable frequency (mounting resonance) | +| `displayUnit` | m/s², mm/s, µm, g, dB | dB = dB re 1 µm/s² / 1 nm/s / 1 pm (ISO 1683) | +| `kx`, `ky`, `kz` | 0 … 2 | Axis multiplying factors for the vector sum; defaults from the profile | +| `calDate` | date | Last calibration, goes into the report | + +## 4. Calibration + +Calibration works like `calOffset`: a per-channel dB offset that maps dBFS to **dB re 1 µm/s²**. + +`level_dB = 20·log10(rms_FS) + calDb`; `a [m/s²] = 10^((level_dB − 120) / 20)` + +Two methods are available, per axis, in a calibration dialog: + +1. **Handheld calibrator** (preferred): the user mounts the sensor on a calibrator and selects the reference (default **10 m/s² RMS at 159.2 Hz = 140 dB**; also 1 g = 9.80665 m/s² and a custom value). SPLMeter measures for 3 s with a narrow bandpass around the reference frequency and sets `calDb`. It rejects the measurement if the frequency deviates by more than ±5 % or the level fluctuates by more than ±0.2 dB. +2. **Datasheet**: sensitivity *S* in mV/(m/s²) or mV/g, plus the interface's full-scale input voltage *V_FS* (Vrms or dBu at 0 dBFS). + `calDb = 120 + 20·log10(V_FS / S)` with *V_FS* in mV and *S* in mV/(m/s²). + +The calibration range is wider than `calOffset` (80–180): **60–220 dB**. + +## 5. Signal processing + +### 5.1 Chain per accelerometer axis + +``` +raw (FS) ─► ×cal (m/s²) ─► HP (Butterworth, 2nd order, highPassHz) + ├─► full-rate path: FFT buffer, structure-borne detectors, WAV recording + └─► decimate ÷D ─► quantity (a / v = ∫a / d = ∬a) ─► weighting ─► detectors +``` + +- **Precision**: all IIR filters in the vibration path use `double` biquads (TDF-II). Poles at 0.4 Hz are very close to z = 1 at 48 kHz. +- **Decimation**: the low-frequency path runs at `fs_d = fs / D`, where D is the largest power of two that keeps `fs_d ≥ 8 kHz` (44.1 kHz → D = 4, 11.025 kHz; 48 kHz → D = 4, 12 kHz; 96 kHz → D = 8, 12 kHz). 8 kHz is the lowest rate NI supports for Wh (upper band limit 1250 Hz); the whole-body weightings are supported from 1 kHz upward, so one shared decimated rate covers all weightings. A cascade of half-band FIR decimators with ≥ 90 dB stopband rejection is used. Structure-borne profiles use the full-rate path. +- **Integration**: trapezoidal (bilinear) integrator `H(s) = 1/s`, always cascaded after the HP, so the overall response is stable. Displacement uses two integrators, and the second gets its own HP at the same corner frequency. + +### 5.2 Frequency weightings (ISO 8041-1) + +Each weighting is the product of four sections, implemented as biquads via the bilinear transform with prewarping: + +- **Band-limiting**: 2nd-order Butterworth HP at f1 × 2nd-order Butterworth LP at f2 +- **a–v transition**: `(1 + s/(2πf3)) / (1 + s/(2πf4·Q4) + s²/(2πf4)²)` +- **Upward step**: `((1 + s/(2πf5·Q5) + s²/(2πf5)²) / (1 + s/(2πf6·Q6) + s²/(2πf6)²)) · (f5/f6)²` +- **Gain**: K + +Parameters (Q1 = Q2 = 1/√2 for all; "∞" means the section is bypassed). Cross-checked against public sources ([V], [I]; see §14): + +| Weighting | Use | f1 | f2 | f3 | f4 | Q4 | f5 | Q5 | f6 | Q6 | K | Status | +|---|---|---|---|---|---|---|---|---|---|---|---|---| +| Wb | Whole-body Z (ISO 2631-4, rail) | 0.4 | 100 | 16 | 16 | 0.55 | 2.5 | 0.90 | 4.0 | 0.95 | **1.024** | [V] | +| Wc | Seat-back X | 0.4 | 100 | 8 | 8 | 0.63 | ∞ | — | ∞ | — | 1 | [V], [I] band | +| Wd | Whole-body X/Y | 0.4 | 100 | 2 | 2 | 0.63 | ∞ | — | ∞ | — | 1 | [V], [I] band | +| We | Rotational | 0.4 | 100 | 1 | 1 | 0.63 | ∞ | — | ∞ | — | 1 | [V], [I] band | +| Wj | Head, recumbent | 0.4 | 100 | ∞ | ∞ | — | 3.75 | 0.91 | 5.32 | 0.91 | 1 | [V], [I] band | +| Wk | Whole-body Z | 0.4 | 100 | 12.5 | 12.5 | 0.63 | 2.37 | 0.91 | 3.35 | 0.91 | 1 | [V], [I] band | +| Wm | Buildings (ISO 2631-2) | 10^−0.1 (0.794) | 100 | 1/(0.028·2π) (5.684) | 5.684 | 0.50 | ∞ | — | ∞ | — | 1 | [V] | +| Wh | Hand-arm (ISO 5349-1) | 10^0.8 (6.31) | 10^3.1 (1258.9) | 100/(2π) (15.915) | 15.915 | 0.64 | ∞ | — | ∞ | — | 1 | [V], [I] band | +| Wf | Motion sickness | 0.08 | 0.63 | ∞ | 0.25 | 0.86 | 0.0625 | 0.80 | 0.10 | 0.80 | 1 | [V], [I] band | + +"[I] band" means that the band limits (two-pole Butterworth, 12 dB/oct) are confirmed verbatim by the ISO 8041 Amd.1:1999 preview text. The ISO 8041-1:2017 edition was not accessible; the tables in the unit tests (§11) are the final check. + +Additionally: + +- **KB** (DIN 4150-2 / DIN 45669-1): applied to **velocity**, `|H_KB(f)| = 1 / √(1 + (f0/f)²)` with f0 = 5.6 Hz, plus band limits 1–80 Hz. +- **Band-limit only**: Butterworth HP/LP with user-defined corners (e.g. 10–1000 Hz for ISO 20816). +- **None**: unweighted, full band. + +Unit tests check each weighting at the nominal 1/3-octave frequencies (0.02 Hz – 4 kHz) against the reference dB table in [V]. The table is computed from the analog transfer functions, which is exactly what our digital filter must reproduce. Tolerance: ±0.1 dB inside the passband. + +### 5.3 Detectors (per axis and for the vector sum) + +| Detector | Definition | Used by | +|---|---|---| +| Running RMS | exponential, τ = 0.125 s (FAST) / 1 s (SLOW) / user-defined; or linear over the measurement | all | +| a_w,rms | linear RMS over the whole measurement | ISO 2631, ISO 5349 | +| MTVV | max of the running RMS with τ = 1 s | ISO 2631 | +| VDV | `(∫ a_w⁴ dt)^(1/4)` in m/s^1.75 | ISO 2631 | +| Crest factor | peak / a_w,rms | ISO 2631 (decides whether VDV is required, CF > 9) | +| Peak, peak-to-peak | with hold (existing `peakHoldTime`) | all | +| PPV | max \|v(t)\| per axis, plus the **dominant frequency** at the peak (zero-crossing half-period around the peak, cross-checked with the FFT) | DIN 4150-3 | +| KB_F(t) | running RMS of KB-weighted velocity, τ = 0.125 s | DIN 4150-2 | +| KB_Fmax | max KB_F(t) | DIN 4150-2 | +| KB_FTm / KB_FTr | max of KB_F per 30 s cycle; `KB_FTr = √(1/N · Σ KB_FTi²)` | DIN 4150-2 | + +**Vector sum**: `a_v = √(kx²·ax² + ky²·ay² + kz²·az²)`, computed from the per-axis detectors (RMS-type values) or sample-wise (VDV, peak). The vector sum is labelled Σ. + +Accumulating detectors (a_w,rms, MTVV, VDV, PPV, KB_FTr) reset together with the existing session reset (the same button that resets `sessionPeakDBCSPL_`). They pause during DAW-sync pauses, like the log. + +### 5.4 Publishing to the GUI + +As for SPL: the audio thread writes `std::atomic` values, and the GUI polls them at 30 Hz. A `VibrationSnapshot` struct (per axis + Σ: running RMS, peak, plus the profile values) is published through a seqlock, or via a set of atomics with a version counter, so all values in one GUI frame are consistent. + +## 6. Measurement profiles + +A profile sets the defaults for weighting, quantity, filters, detectors, k-factors, the big readout value and the report section. Every value stays user-editable; once one is changed, the profile is shown as "Custom (based on …)". + +| Profile | Quantity | Weighting per axis X / Y / Z | HP | k (x,y,z) | Main value | Assessment | +|---|---|---|---|---|---|---| +| Structure-borne | a | None | 1 Hz | 1,1,1 | L_a dB re 1 µm/s² | — | +| Machinery ISO 20816 | v | band 10–1000 Hz | 2 Hz | 1,1,1 | v_rms mm/s (max axis) | Zones A–D (§9.3) | +| Machinery low speed | v | band 2–1000 Hz | 1 Hz | 1,1,1 | v_rms mm/s | Zones A–D | +| Whole-body health (ISO 2631-1) | a | Wd / Wd / Wk | 0.1 Hz | 1.4,1.4,1 | a_w max axis, VDV, A(8) | EU 2002/44/EC values | +| Whole-body comfort (ISO 2631-1) | a | Wd / Wd / Wk | 0.1 Hz | 1,1,1 | a_v (Σ) | Comfort scale | +| Hand-arm (ISO 5349-1) | a | Wh / Wh / Wh | 2 Hz | 1,1,1 | a_hv (Σ), A(8) | EU 2002/44/EC values | +| Building – perception (DIN 4150-2) | v | KB on all axes | 0.5 Hz | — | KB_Fmax, KB_FTr | A_u / A_o / A_r | +| Building – structural (DIN 4150-3) | v | band 1–315 Hz | 0.5 Hz | — | PPV per axis + f_dom | Guideline lines | +| Custom | any | any | any | any | — | — | + +## 7. UI + +### 7.1 Settings → new "Inputs" section + +- A table of the device's input channels (up to 8 shown; scrolls for 32): **Channel · Role · Level meter · Cal (dB) · Calibrate…** +- Role combobox: Mic / Accel X / Accel Y / Accel Z / Accel (uniaxial) / Off. +- An "Accelerometer" group appears below when any channel has an accelerometer role: profile, high-pass, lower/upper limit, unit, k-factors, sensor serial, calibration date. +- Psychoacoustic metrics, dBA/dBC and the Sound Detective continue to use the mic mix only. If no channel is `Mic`, the SPL meter shows "No microphone input" instead of meaningless values. + +### 7.2 Vibration panel (below the SPL meter) + +``` +├─ Vibration · Whole-body health ──── [m/s² ▾] [Wd/Wk]┤ +│ X ████░░░░░░░░░░ 0.12 m/s² pk 0.41 │ +│ Y ███░░░░░░░░░░░ 0.09 m/s² pk 0.30 │ +│ Z ██████░░░░░░░░ 0.31 m/s² pk 0.95 │ +│ Σ ███████░░░░░░░ 0.35 m/s² VDV 1.8 A(8) 0.29 ● │ +``` + +- Shown only when an accelerometer is configured; the editor grows by the panel's height (respecting the persisted `extendedHeight` logic). +- Bars use a log scale (dB) internally; the readout is in `displayUnit`. +- Bars are tinted when frequency content below `lowerLimitHz` dominates (unreliable reading). +- Status dot: green / amber / red against the profile's assessment (action value, zone, guideline line). +- Light/dark mode and the iOS title-bar scaling follow existing conventions. + +### 7.3 Timeline (LogComponent) + +- `LogEntry` gets an optional `VibrationLog` block: per axis running RMS and peak, plus Σ and the profile's main value. +- New toggles next to dB SPL / dBA / dBC: **Vib X · Y · Z · Σ**. +- Vibration traces use the **right y-axis** (already used for psychoacoustic metrics) with its own range in `displayUnit`. If a psychoacoustic metric is shown at the same time, the vibration trace takes precedence on the right axis and the metric falls back to its normalized scale. +- Colours: X orange, Y cyan, Z violet, Σ white/black (colourblind-safe against the mic's green/red Dual FFT colours). + +### 7.4 FFT and spectrogram + +- Generalize `fftCircBufDual_[2]` to `fftCircBufCh_[kMaxFftChannels]` (8 channels × 524288 floats = 16 MB; allocate only for configured channels). +- `copyFftWindow(dest, size, channel)` keeps its signature; `channel` now indexes physical inputs. +- FFT channel selector replaces the Dual FFT toggle: **Mix · In 1 · In 2 · Dual (1+2) · Vib X/Y/Z · Vib Σ · Mic + Vib**. The existing `fftDual` parameter maps to "Dual (1+2)" so v3.5.2 settings load unchanged. +- Accelerometer FFT data is shown in dB re 1 µm/s² (or in the displayed quantity, converted per bin with 1/(2πf)). When mic and vibration are overlaid, the legend names each unit; both share the dB grid. +- 1/n-octave bands extend down to 0.5 Hz for accelerometer channels (needs FFT ≥ 131072 at 48 kHz; the UI suggests a size). +- Spectrogram: source selector for Mix or one accelerometer axis. + +### 7.5 WAV recording + +Extend recording to **all non-Off channels** (up to 8), and write channel roles and calibration as a `iXML` chunk (or a sidecar `.json`). This makes file-mode playback able to re-analyse a vibration recording with correct roles and calibration. + +## 8. Persistence and export + +- All settings in §3 live in `UIState`, so they persist across launches and are part of the plugin state (DAW sessions). +- JSON settings export/import: new `inputs` array and `accel` object. +- CSV log export: added columns `vibX_rms, vibY_rms, vibZ_rms, vibSum_rms, vibX_pk, …, vib_main, vib_unit, vib_profile`. These are empty when no accelerometer is configured, so existing column positions stay the same. + +## 9. Vibration report + +### 9.1 Format and trigger + +- **Self-contained HTML** (inline CSS, inline SVG charts, no external resources), so it opens anywhere and prints to PDF from the browser. JUCE has no PDF writer. +- Save menu: "Save vibration report…". Enabled when an accelerometer is configured and the session has data. +- A dialog before saving asks for: project, location / measurement point, operator, sensor mounting, notes. The values persist (`UIState/Report`). +- Language: English in this version; strings centralized so German can be added. + +### 9.2 Contents + +1. **Header**: title, project, location, operator, date/time, duration, SPLMeter version. +2. **Setup**: interface (device name, sample rate), sensor serial, roles per channel, calibration (method, `calDb`, date), profile, filters (HP, weighting per axis, band limits), k-factors, `lowerLimitHz`/`upperLimitHz`. +3. **Results table**: per axis + Σ — RMS, peak, crest factor, plus the profile values (MTVV, VDV, PPV + f_dom, KB_Fmax, KB_FTr, v_rms). +4. **Assessment** (§9.3), with the reference values used and a clear pass / attention / exceed verdict. +5. **Charts**: time history per axis + Σ; 1/3-octave spectrum per axis (linear average over the measurement); for DIN 4150-3, PPV vs. dominant frequency plotted over the guideline lines. +6. **Events**: user markers and pauses from the timeline. +7. **Mic summary** (if a mic is configured): LAeq, LCeq, LAFmax for the same period. +8. **Disclaimer** (§9.4). + +### 9.3 Assessment reference values + +All limit values ship as **editable defaults** in Settings; the report lists the values actually used. Status markers refer to the sources in §14. + +- **EU 2002/44/EC** ✔ [E][O]: hand-arm A(8) action 2.5 m/s², limit 5.0 m/s²; whole-body A(8) action 0.5 m/s², limit 1.15 m/s²; alternative whole-body VDV action 9.1, limit 21 m/s^1.75. + **Germany** (LärmVibrationsArbSchV) ⚠ [D] only: whole-body limit 0.8 m/s² in Z, 1.15 m/s² in X/Y. Offered as a "Germany" preset; check the legal text before release. + A(8) = a · √(T / 8 h), where *a* is the highest axis value with k-factors applied (whole-body) or a_hv (hand-arm). T is entered by the user (default: measurement duration). +- **ISO 2631-1 comfort scale** (unverified, from memory): < 0.315 not uncomfortable · 0.315–0.63 a little · 0.5–1 fairly · 0.8–1.6 uncomfortable · 1.25–2.5 very · > 2 m/s² extremely uncomfortable. Informational only, no pass/fail. +- **ISO 10816-3 / 20816-3** ✔ [M] (velocity RMS, mm/s), zone boundaries A/B, B/C, C/D: + | | Rigid | Flexible | + |---|---|---| + | Group 1 (> 300 kW, or shaft height ≥ 315 mm) | 2.3 / 4.5 / 7.1 | 3.5 / 7.1 / 11.0 | + | Group 2 (15–300 kW, or shaft height 160–315 mm) | 1.4 / 2.8 / 4.5 | 2.3 / 4.5 / 7.1 | + The user selects the group and foundation. ISO 20816-3 keeps the same values. +- **DIN 4150-3**, short-term vibration ✔ [H][G][L] (PPV in mm/s at the foundation, for 1–10 Hz / 10–50 Hz / 50–100 Hz, linearly interpolated within each band; last column is the top floor, horizontal, all frequencies): + | Line | Building type | 1–10 | 10–50 | 50–100 | Top floor | + |---|---|---|---|---|---| + | 1 | Commercial / industrial | 20 | 20–40 | 40–50 | 40 | + | 2 | Residential | 5 | 5–15 | 15–20 | 15 | + | 3 | Particularly sensitive / heritage-protected | 3 | 3–8 | 8–10 | 8 | + Above 100 Hz, the 100 Hz values apply. + **Long-term vibration** (top floor, horizontal): line 3 = 2.5 mm/s ✔ [T]; lines 1 = 10 and 2 = 5 mm/s ⚠ from memory, verify. +- **DIN 4150-2** ✔ [L] plus consistent values in several expert reports (KB values, dimensionless): + | Zone | Day A_u / A_o / A_r | Night A_u / A_o / A_r | + |---|---|---| + | Industrial (GI) | 0.4 / 6 / 0.2 | 0.3 / 0.6 / 0.15 | + | Commercial (GE) | 0.3 / 6 / 0.15 | 0.2 / 0.4 / 0.1 | + | Mixed / village / core (MI, MD, MK) | 0.2 / 5 / 0.1 | 0.15 / 0.3 / 0.07 | + | Residential (WR, WA) | 0.15 / 3 / 0.07 | 0.1 / 0.2 / 0.05 | + | Hospitals, spa areas (SO) | 0.1 / 3 / 0.05 | 0.1 / 0.15 / 0.05 | + Values are from the 1999 edition. Special rules (e.g. a different A_o at night for rail traffic, construction-site tables) are not modelled; the user edits the values in such cases. + Assessment logic: KB_Fmax ≤ A_u → requirement met; KB_Fmax > A_o → not met; otherwise KB_FTr ≤ A_r → met. + +### 9.4 Disclaimer (fixed text) + +> Measured with SPLMeter vX.Y.Z using a general-purpose audio interface. The measurement chain has not been type-tested to ISO 8041-1 / DIN 45669-1. Results are indicative and do not replace a measurement with a certified instrument for legal or contractual assessments. + +## 10. Plugin specifics + +- Input bus: keep 1–8 channels for VST3/AU. Accelerometer roles only make sense when the host provides more than 2 channels. With a stereo track, the Inputs table shows only channels 1–2. +- DAW sync and pause behaviour apply to vibration detectors as they do to SPL. +- Vibration values are not exposed as automatable output parameters in this version. + +## 11. Testing + +Catch2 unit tests (`Tests/`): + +- Weighting responses at 1/3-octave frequencies vs. the ISO 8041-1 tables (±0.1 dB), at 44.1 kHz and 48 kHz (decimated path). +- Calibration: synthetic 159.2 Hz sine at −20 dBFS with calibrator method → `calDb` such that the sine reads exactly 140 dB; datasheet formula round trip. +- Integration: a sine of acceleration *a* at *f* reads `v = a / (2πf)` and `d = a / (2πf)²` within 0.5 % for f ≥ 5·HP. +- VDV of a sine of RMS *a* over *T*: `a · (1.5·T)^(1/4)`. +- MTVV of a burst; crest factor of a known waveform. +- KB_FTr on a synthetic signal with known per-cycle maxima. +- PPV + dominant frequency of a decaying sine. +- Vector sum with k-factors. +- Channel model: default config gives a bit-identical SPL output to v3.5.2 on a reference WAV (regression). + +Manual verification: handheld calibrator per axis; compare a short machinery and a structure-borne measurement against a reference instrument if one is available. + +## 12. Implementation plan + +### Phase 1a — Foundation + +1. Channel model in `UIState/Inputs`; mono mix and bandpass take `Mic` channels only; regression test (bit-identical default). +2. Per-channel FFT buffers (`fftCircBufCh_`), FFT channel selector replacing the Dual FFT toggle (with `fftDual` mapping). +3. Accelerometer DSP: calibration, HP, decimation, integration, weightings (§5.1–5.2), with unit tests. +4. Detectors: running RMS, peak, peak-to-peak, vector sum; `VibrationSnapshot` publishing. +5. Settings "Inputs" section, calibration dialog (calibrator + datasheet). +6. Vibration panel. +7. Timeline vibration traces + CSV columns + JSON export/import. +8. Multichannel WAV recording with role and calibration metadata; file-mode playback respects it. + +### Phase 1b — Assessment and report + +9. Profiles (§6) incl. "Custom (based on …)". +10. Accumulating detectors: a_w,rms, MTVV, VDV, crest factor, PPV + f_dom, KB_F/KB_Fmax/KB_FTr; session reset integration. +11. Assessment engine with editable limits (§9.3) and the panel's status dot. +12. HTML report (§9) with inline SVG charts. +13. README + user documentation; version bump. + +### Later + +- iPad layout for the Vibration panel. +- Multiple accelerometer sensors; per-sensor reports. +- German report strings. +- TEDS and sensor database (sensitivity per serial number). + +## 13. Decisions and remaining checks + +Decided (2026-11-12): +1. One accelerometer sensor (triaxial or uniaxial) plus the mic in this version. +2. Report in English first. +3. Parameters and limits were cross-checked against public sources (§14). +4. DIN 4150-2 zone values ship as editable defaults. + +Remaining ⚠ items to check before release: +- DIN 4150-3 long-term values for lines 1 and 2 (10 / 5 mm/s). +- The German whole-body Z limit of 0.8 m/s² (LärmVibrationsArbSchV legal text). +- The ISO 2631-1 comfort scale bands. +- The Wb gain K = 1.024 and the Wm/Wb parameters (single source [V]). The unit-test tables will catch any inconsistency between parameters and response. +- The KB weighting definition (f0 = 5.6 Hz) and the DIN 4150-2 assessment flow; neither has been cross-checked against a public source yet. + +## 14. Sources + +- [V] Virtins Technology, *Frequency Weightings for Sound and Vibration Perceived by Humans* (2024), parameter table and 1/3-octave reference values: https://www.virtins.com/doc/Frequency-Weightings-for-Sound-and-Vibration-Perceived-by-Humans-using-Multi-Instrument.pdf +- [I] ISO 8041:1990/Amd.1:1999 preview (band-limiting definition): https://cdn.standards.iteh.ai/samples/27055/fe924c0e30794197b3c57e15abffdb30/ISO-8041-1990-Amd-1-1999.pdf +- [N] NI, Human vibration weighting filters (supported sample rates): https://www.ni.com/en/support/documentation/supplemental/08/human-vibration-weighting-filters-in-labview-sound-and-vibration.html +- [R] Rimell & Mansfield, *Design of digital filters for frequency weightings required for risk assessments of workers exposed to vibration*, Industrial Health 45 (2007) 512–519: https://www.jstage.jst.go.jp/article/indhealth/45/4/45_4_512/_article (digital IIR implementation for any sample rate) +- [E] Directive 2002/44/EC (consolidated): https://eur-lex.europa.eu/eli/dir/2002/44/2019-07-26/eng +- [O] OSHwiki, Vibration: https://oshwiki.osha.europa.eu/en/themes/vibration +- [D] IFA/DGUV, Whole-body and hand-arm vibration: https://www.dguv.de/ifa/fachinfos/vibrationen/index-2.jsp +- [M] ISO 10816-3 zone tables, e.g. https://vibromera.eu/glossary/iso-10816-3/ and https://www.fabrico.io/blog/iso-10816-3-vibration-severity/ +- [L] LfU Bayern, Erschütterungen (DIN 4150-2 day/night tables, DIN 4150-3 excerpt): https://www.lfu.bayern.de/laerm/erschuetterungen/index.htm +- [H] HLNUG, Einwirkungen auf Bauwerke: https://www.hlnug.de/themen/erschuetterungen/beurteilung/einwirkungen-auf-bauwerke +- [G] Bundesverband Geothermie, Schadensgrenze: https://www.geothermie.de/bibliothek/lexikon-der-geothermie/s/schadensgrenze-erschuetterungen +- [T] terrana Geophysik, Regelwerke DIN 4150 und LAI: https://www.terrana-geophysik.de/images/Methode_Erschuetterung.htm From cfbbdccbc070153c9031d091dc1ca42c6bd0e800 Mon Sep 17 00:00:00 2001 From: Philipp Paul Klose Date: Thu, 12 Nov 2026 16:51:34 +0100 Subject: [PATCH 02/30] Vibration step 0: processor regression safety net + test CI - SPLMeterProcessorTests: runs the real processor on 5 deterministic scenarios (mono/stereo/quad, bandpass, SLOW, mute, calOffset) and compares meter values, log entries and FFT ring buffers with golden files in Tests/golden (exact mode: SPLMETER_GOLDEN_EXACT=1) - State compatibility test: v3.5.2 plugin state fixture must load (all 78 params, UIState, MIDI CC, channel names) and round-trip - tests.yml: unit + regression tests on every push/PR (Linux) - run-tests.sh: local build outside iCloud, --exact / --update modes Co-Authored-By: Claude Opus 5.5 --- .github/workflows/tests.yml | 56 + CMakeLists.txt | 20 + Tests/ProcessorRegressionTests.cpp | 378 ++++ Tests/golden/mono_sine_1k.txt | 2404 ++++++++++++++++++++++ Tests/golden/quad_silent_impulses.txt | 2404 ++++++++++++++++++++++ Tests/golden/state_v3.5.2.xml | 85 + Tests/golden/stereo_bandpass_lowfreq.txt | 2404 ++++++++++++++++++++++ Tests/golden/stereo_noise_sine.txt | 2404 ++++++++++++++++++++++ Tests/golden/stereo_slow_muted.txt | 2404 ++++++++++++++++++++++ run-tests.sh | 29 + 10 files changed, 12588 insertions(+) create mode 100644 .github/workflows/tests.yml create mode 100644 Tests/ProcessorRegressionTests.cpp create mode 100644 Tests/golden/mono_sine_1k.txt create mode 100644 Tests/golden/quad_silent_impulses.txt create mode 100644 Tests/golden/state_v3.5.2.xml create mode 100644 Tests/golden/stereo_bandpass_lowfreq.txt create mode 100644 Tests/golden/stereo_noise_sine.txt create mode 100644 Tests/golden/stereo_slow_muted.txt create mode 100755 run-tests.sh diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml new file mode 100644 index 0000000..c6eaef5 --- /dev/null +++ b/.github/workflows/tests.yml @@ -0,0 +1,56 @@ +name: SPLMeter tests + +# Runs the unit and processor regression tests on every push and pull request. +# Deliberately separate from build-chain.yml (main only), which signs, notarizes +# and uploads release artifacts and is too slow/expensive for feature branches. + +on: + push: + branches: ['**'] + pull_request: + workflow_dispatch: + +env: + FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true + CMAKE_POLICY_VERSION_MINIMUM: "3.5" + +jobs: + tests-linux: + name: Tests (Linux) + runs-on: ubuntu-latest + + steps: + - name: Checkout + uses: actions/checkout@v6.0.2 + + - name: Install system dependencies + run: | + sudo apt-get update -qq + sudo apt-get install -y \ + libasound2-dev \ + libx11-dev libxrandr-dev libxinerama-dev libxcursor-dev libxext-dev \ + libgl1-mesa-dev \ + libfreetype-dev libfontconfig1-dev \ + libgtk-3-dev \ + xvfb + + - name: Cache deps (JUCE + Catch2) + uses: actions/cache@v5.0.4 + with: + path: | + build/_deps + key: juce-8.0.7-catch2-3.7.1-tests-v1-linux + + - name: Configure CMake + run: cmake -B build -DCMAKE_BUILD_TYPE=Release -DSPLMETER_TFLITE=OFF -DSPLMETER_BUILD_TESTS=ON + + - name: Build tests + run: cmake --build build --config Release --target SPLMeterTests SPLMeterProcessorTests -- -j$(nproc) + + - name: Unit tests + run: ./build/SPLMeterTests + + - name: Processor regression tests + # Golden files come from macOS arm64; the default tolerance mode absorbs + # libm/FMA differences between platforms. + run: xvfb-run -a ./build/SPLMeterProcessorTests diff --git a/CMakeLists.txt b/CMakeLists.txt index 03371d9..005d1b8 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -334,8 +334,28 @@ if(SPLMETER_BUILD_TESTS) JUCE_UNIT_TESTS=1 ) + # Regression tests against the real processor. Separate executable because it + # links the plugin's shared-code library, which already contains the compiled + # JUCE modules (linking juce:: modules again would duplicate symbols). + add_executable(SPLMeterProcessorTests + Tests/ProcessorRegressionTests.cpp + ) + target_link_libraries(SPLMeterProcessorTests PRIVATE + SPLMeter + Catch2::Catch2WithMain + ) + target_include_directories(SPLMeterProcessorTests PRIVATE + Source + $ + ) + target_compile_definitions(SPLMeterProcessorTests PRIVATE + $ + SPLMETER_GOLDEN_DIR="${CMAKE_CURRENT_SOURCE_DIR}/Tests/golden" + ) + include(CTest) list(APPEND CMAKE_MODULE_PATH ${catch2_SOURCE_DIR}/extras) include(Catch) catch_discover_tests(SPLMeterTests) + catch_discover_tests(SPLMeterProcessorTests) endif() diff --git a/Tests/ProcessorRegressionTests.cpp b/Tests/ProcessorRegressionTests.cpp new file mode 100644 index 0000000..0b8bf9b --- /dev/null +++ b/Tests/ProcessorRegressionTests.cpp @@ -0,0 +1,378 @@ +#include +#include +#include +#include "PluginProcessor.h" + +#include +#include +#include +#include + +// Golden-file regression test for the real SPLMeterAudioProcessor. +// +// Deterministic input signals are run through processBlock and every metering +// output (meter atomics per block, log entries, FFT ring buffers, session values) +// is compared with a reference file in Tests/golden/. +// +// SPLMETER_UPDATE_GOLDEN=1 rewrite the golden files from the current code +// SPLMETER_GOLDEN_EXACT=1 require bit-identical values (same machine/compiler, +// used to verify refactors); default is a tight +// tolerance so the test also passes on other platforms + +#ifndef SPLMETER_GOLDEN_DIR + #error "SPLMETER_GOLDEN_DIR must be defined by the build" +#endif + +namespace +{ +constexpr double kSampleRate = 48000.0; +constexpr int kBlockSize = 480; // deliberately not a power of two +constexpr int kFftWindow = 4096; + +using SignalFn = std::function; + +struct Scenario +{ + const char* name; + int numChannels; + double seconds; + SignalFn signal; + std::function configure; +}; + +float sine (double freq, double amp, int n) +{ + return static_cast (amp * std::sin (2.0 * juce::MathConstants::pi * freq * n / kSampleRate)); +} + +// Deterministic white noise, one independent LCG stream per channel +float noise (int channel, int n, float amp) +{ + uint32_t seed = 12345u + 7919u * static_cast (channel) + static_cast (n) * 2654435761u; + seed ^= seed >> 15; seed *= 2246822519u; seed ^= seed >> 13; seed *= 3266489917u; seed ^= seed >> 16; + return amp * (static_cast (seed) / static_cast (UINT32_MAX) * 2.0f - 1.0f); +} + +void setParam (SPLMeterAudioProcessor& p, const char* id, float value) +{ + auto* param = p.apvts.getParameter (id); + REQUIRE (param != nullptr); + param->setValueNotifyingHost (param->convertTo0to1 (value)); +} + +std::vector scenarios() +{ + return { + { "mono_sine_1k", 1, 3.0, + [] (int, int n) { return sine (1000.0, 0.1, n); }, + [] (SPLMeterAudioProcessor&) {} }, + + { "stereo_noise_sine", 2, 3.0, + [] (int ch, int n) { return ch == 0 ? noise (ch, n, 0.2f) : sine (100.0, 0.3, n); }, + [] (SPLMeterAudioProcessor&) {} }, + + { "quad_silent_impulses", 4, 3.0, + [] (int ch, int n) + { + switch (ch) + { + case 0: return sine (440.0, 0.05, n); + case 1: return noise (ch, n, 0.02f); + case 2: return 0.0f; // silent input + default: return (n % 4800) == 0 ? 0.9f : 0.0f; // 10 Hz impulse train + } + }, + [] (SPLMeterAudioProcessor&) {} }, + + { "stereo_bandpass_lowfreq", 2, 3.0, + [] (int ch, int n) { return ch == 0 ? sine (5.0, 0.5, n) + sine (40.0, 0.1, n) + : sine (12500.0, 0.05, n); }, + [] (SPLMeterAudioProcessor& p) { setParam (p, "bandpassEnabled", 1.0f); } }, + + { "stereo_slow_muted", 2, 3.0, + [] (int ch, int n) { return ch == 0 ? noise (ch, n, 0.1f) : sine (2000.0, 0.5, n); }, + [] (SPLMeterAudioProcessor& p) + { + setParam (p, "splTimeWeight", 1.0f); // SLOW + setParam (p, "channelMute1", 1.0f); // input 2 muted + setParam (p, "calOffset", 110.0f); + } }, + }; +} + +// Runs a scenario and returns the captured outputs as "key value" lines. +std::vector> runScenario (const Scenario& sc) +{ + // Heap-allocated like in a host: the processor holds ~6 MB of FFT ring buffers + auto procPtr = std::make_unique(); + auto& proc = *procPtr; + + auto layout = proc.getBusesLayout(); + layout.inputBuses.getReference (0) = juce::AudioChannelSet::discreteChannels (sc.numChannels); + REQUIRE (proc.setBusesLayout (layout)); + + sc.configure (proc); + proc.setRateAndBufferSizeDetails (kSampleRate, kBlockSize); + proc.prepareToPlay (kSampleRate, kBlockSize); + + const int numBusChannels = juce::jmax (proc.getTotalNumInputChannels(), proc.getTotalNumOutputChannels()); + juce::AudioBuffer buffer (numBusChannels, kBlockSize); + juce::MidiBuffer midi; + + std::vector> out; + auto add = [&out] (const std::string& key, float v) { out.emplace_back (key, v); }; + + const int totalBlocks = static_cast (sc.seconds * kSampleRate) / kBlockSize; + for (int b = 0; b < totalBlocks; ++b) + { + buffer.clear(); + for (int ch = 0; ch < sc.numChannels; ++ch) + { + auto* d = buffer.getWritePointer (ch); + for (int s = 0; s < kBlockSize; ++s) + d[s] = sc.signal (ch, b * kBlockSize + s); + } + proc.processBlock (buffer, midi); + + if (b % 10 == 9) + { + const std::string k = "blk" + std::to_string (b) + "."; + add (k + "peakSPL", proc.getPeakSPL()); + add (k + "peakDBA", proc.getPeakDBASPL()); + add (k + "peakDBC", proc.getPeakDBCSPL()); + add (k + "rmsSPL", proc.getRMSSPL()); + add (k + "rmsDBA", proc.getRMSDBASPL()); + add (k + "rmsDBC", proc.getRMSDBCSPL()); + add (k + "rough", proc.getRoughness()); + add (k + "sharp", proc.getSharpness()); + add (k + "fluct", proc.getFluctuation()); + add (k + "impuls", proc.getImpulsiveness()); + add (k + "tonal", proc.getTonality()); + } + } + + const auto log = proc.copyLog(); + add ("log.count", static_cast (log.size())); + for (size_t i = 0; i < log.size(); ++i) + { + const auto& e = log[i]; + const std::string k = "log" + std::to_string (i) + "."; + add (k + "peakSPL", e.peakSPL); add (k + "peakDBA", e.peakDBASPL); add (k + "peakDBC", e.peakDBCSPL); + add (k + "rmsSPL", e.rmsSPL); add (k + "rmsDBA", e.rmsDBASPL); add (k + "rmsDBC", e.rmsDBCSPL); + add (k + "rough", e.roughness); add (k + "fluct", e.fluctuation); add (k + "sharp", e.sharpness); + add (k + "sone", e.loudnessSone); add (k + "impuls", e.impulsiveness); add (k + "tonal", e.tonality); + add (k + "annoy", e.psychoAnnoyance); + } + + std::vector fft (kFftWindow); + for (int ch : { -1, 0, 1 }) + { + proc.copyFftWindow (fft.data(), kFftWindow, ch); + for (int i = 0; i < kFftWindow; i += 7) + add ("fft" + std::to_string (ch) + "." + std::to_string (i), fft[(size_t) i]); + } + + add ("sessionPeakDBC", proc.getSessionPeakDBCSPL()); + add ("noiseDose", proc.getNoiseDosePct()); + + proc.releaseResources(); + return out; +} + +std::string formatValue (float v) +{ + char buf[64]; + std::snprintf (buf, sizeof (buf), "%.9g", static_cast (v)); // 9 digits round-trip a float exactly + return buf; +} + +bool envSet (const char* name) +{ + const char* v = std::getenv (name); + return v != nullptr && *v != '\0' && std::string (v) != "0"; +} + +// Tolerance for cross-platform runs: libm and FMA contraction differ between +// compilers/architectures. Tight enough that any real behaviour change fails. +bool closeEnough (const std::string& key, float expected, float actual) +{ + if (expected == actual) return true; + if (std::isnan (expected) || std::isnan (actual)) return std::isnan (expected) && std::isnan (actual); + const float diff = std::fabs (expected - actual); + if (key.rfind ("fft", 0) == 0) + return diff <= 1.0e-6f + 1.0e-5f * std::fabs (expected); + return diff <= 1.0e-3f + 1.0e-4f * std::fabs (expected); +} +} // namespace + +TEST_CASE ("Processor regression: outputs match golden files", "[regression]") +{ + juce::ScopedJuceInitialiser_GUI juceInit; + + const bool update = envSet ("SPLMETER_UPDATE_GOLDEN"); + const bool exact = envSet ("SPLMETER_GOLDEN_EXACT"); + const juce::File goldenDir (SPLMETER_GOLDEN_DIR); + + for (const auto& sc : scenarios()) + { + DYNAMIC_SECTION (sc.name) + { + const auto values = runScenario (sc); + const auto file = goldenDir.getChildFile (juce::String (sc.name) + ".txt"); + + if (update) + { + goldenDir.createDirectory(); + std::ostringstream os; + os << "# SPLMeter processor golden output: " << sc.name << "\n"; + for (const auto& [key, v] : values) + os << key << ' ' << formatValue (v) << '\n'; + REQUIRE (file.replaceWithText (os.str())); + WARN ("Golden file written: " << file.getFullPathName()); + continue; + } + + REQUIRE (file.existsAsFile()); + std::istringstream is (file.loadFileAsString().toStdString()); + std::vector> expected; + for (std::string line; std::getline (is, line);) + { + if (line.empty() || line[0] == '#') continue; + std::istringstream ls (line); + std::string key; std::string val; + ls >> key >> val; + expected.emplace_back (key, std::strtof (val.c_str(), nullptr)); + } + + REQUIRE (expected.size() == values.size()); + + int mismatches = 0; + for (size_t i = 0; i < values.size(); ++i) + { + const auto& [key, actual] = values[i]; + REQUIRE (key == expected[i].first); + const bool ok = exact ? (formatValue (actual) == formatValue (expected[i].second)) + : closeEnough (key, expected[i].second, actual); + if (! ok && ++mismatches <= 20) + UNSCOPED_INFO (key << ": expected " << formatValue (expected[i].second) + << ", got " << formatValue (actual)); + } + CHECK (mismatches == 0); + } + } +} + +//============================================================================== +// State compatibility: plugin state written by v3.5.2 (Tests/golden/state_v3.5.2.xml) +// must keep loading into newer versions. The fixture is created once from v3.5.2 +// (SPLMETER_WRITE_STATE_FIXTURE=1) and must never be regenerated afterwards. + +namespace +{ +std::unique_ptr makeV352StyleState() +{ + auto procPtr = std::make_unique(); + auto& proc = *procPtr; + + // Every parameter gets a non-default value + const auto& params = proc.getParameters(); + for (int i = 0; i < params.size(); ++i) + { + auto* p = params[i]; + const float def = p->getDefaultValue(); + const float v = def > 0.5f ? 0.13f + 0.002f * (float) (i % 50) + : 0.71f + 0.002f * (float) (i % 50); + p->setValueNotifyingHost (v); + } + + auto ui = proc.getUiState(); + ui.setProperty ("dawSync", true, nullptr); + ui.setProperty ("sdThreshold", 0.55, nullptr); + ui.setProperty ("logShowSPL", false, nullptr); + ui.setProperty ("logPsychoMetric", 3, nullptr); + ui.setProperty ("logFftEnabled", true, nullptr); + ui.setProperty ("spectroColourMap", 2, nullptr); + ui.setProperty ("longTermYMin", 35.0, nullptr); + ui.setProperty ("impulseFidelityFreq", 1000.0, nullptr); + + proc.setMidiCC (0, 7); + proc.setMidiCC (2, 11); + proc.setChannelName (0, "Mic left"); + proc.setChannelName (1, "Mic right"); + + return proc.createStateXml(); +} +} // namespace + +TEST_CASE ("State compatibility: v3.5.2 plugin state still loads", "[regression][state]") +{ + juce::ScopedJuceInitialiser_GUI juceInit; + + const auto fixture = juce::File (SPLMETER_GOLDEN_DIR).getChildFile ("state_v3.5.2.xml"); + + if (envSet ("SPLMETER_WRITE_STATE_FIXTURE")) + { + REQUIRE (makeV352StyleState()->writeTo (fixture)); + WARN ("State fixture written: " << fixture.getFullPathName()); + return; + } + + REQUIRE (fixture.existsAsFile()); + const auto savedXml = juce::XmlDocument::parse (fixture); + REQUIRE (savedXml != nullptr); + + // Load through the host path (binary blob, as a DAW would) + juce::MemoryBlock blob; + juce::AudioProcessor::copyXmlToBinary (*savedXml, blob); + + auto procPtr = std::make_unique(); + auto& proc = *procPtr; + proc.setStateInformation (blob.getData(), (int) blob.getSize()); + + const auto saved = juce::ValueTree::fromXml (*savedXml); + + SECTION ("every saved parameter is restored") + { + int checked = 0; + for (const auto& child : saved) + { + if (! child.hasType ("PARAM")) continue; + const auto id = child.getProperty ("id").toString(); + auto* p = proc.apvts.getParameter (id); + INFO ("parameter " << id); + REQUIRE (p != nullptr); // a removed/renamed parameter breaks old sessions + const float expected = (float) (double) child.getProperty ("value"); + CHECK (p->convertFrom0to1 (p->getValue()) == Catch::Approx (expected).margin (1.0e-4)); + ++checked; + } + CHECK (checked > 50); + } + + SECTION ("UIState, MIDI CC and channel names are restored") + { + const auto savedUi = saved.getChildWithName ("UIState"); + REQUIRE (savedUi.isValid()); + auto ui = proc.getUiState(); + for (int i = 0; i < savedUi.getNumProperties(); ++i) + { + const auto name = savedUi.getPropertyName (i); + INFO ("UIState property " << name.toString()); + CHECK (ui.getProperty (name).toString() == savedUi.getProperty (name).toString()); + } + CHECK (proc.isDawSync()); + CHECK (proc.getMidiCC (0) == 7); + CHECK (proc.getMidiCC (1) == -1); + CHECK (proc.getMidiCC (2) == 11); + CHECK (proc.getChannelName (0) == "Mic left"); + CHECK (proc.getChannelName (1) == "Mic right"); + } + + SECTION ("save after load round-trips unchanged") + { + juce::MemoryBlock again; + proc.getStateInformation (again); + auto proc2 = std::make_unique(); + proc2->setStateInformation (again.getData(), (int) again.getSize()); + CHECK (proc2->createStateXml()->isEquivalentTo (proc.createStateXml().get(), false)); + } +} diff --git a/Tests/golden/mono_sine_1k.txt b/Tests/golden/mono_sine_1k.txt new file mode 100644 index 0000000..e3e5e7d --- /dev/null +++ b/Tests/golden/mono_sine_1k.txt @@ -0,0 +1,2404 @@ +# SPLMeter processor golden output: mono_sine_1k +blk9.peakSPL -999 +blk9.peakDBA -999 +blk9.peakDBC -999 +blk9.rmsSPL -999 +blk9.rmsDBA -999 +blk9.rmsDBC -999 +blk9.rough 0 +blk9.sharp 0.922265947 +blk9.fluct 0 +blk9.impuls 5.5960412 +blk9.tonal 93.2348022 +blk19.peakSPL 107 +blk19.peakDBA 107.194679 +blk19.peakDBC 106.986877 +blk19.rmsSPL 101.998062 +blk19.rmsDBA 101.988815 +blk19.rmsDBC 101.995964 +blk19.rough 18.6338444 +blk19.sharp 0.922290206 +blk19.fluct 0 +blk19.impuls 3.98437166 +blk19.tonal 93.2420807 +blk29.peakSPL 107 +blk29.peakDBA 107.194679 +blk29.peakDBC 106.986877 +blk29.rmsSPL 103.358536 +blk29.rmsDBA 103.353844 +blk29.rmsDBC 103.357208 +blk29.rough 18.6338444 +blk29.sharp 0.922290385 +blk29.fluct 0 +blk29.impuls 3.41797757 +blk29.tonal 93.2421265 +blk39.peakSPL 107 +blk39.peakDBA 107.194679 +blk39.peakDBC 106.986877 +blk39.rmsSPL 103.768265 +blk39.rmsDBA 103.764694 +blk39.rmsDBC 103.76712 +blk39.rough 5.9468255 +blk39.sharp 0.922290385 +blk39.fluct 0 +blk39.impuls 3.18570089 +blk39.tonal 93.2421265 +blk49.peakSPL 107 +blk49.peakDBA 107.194679 +blk49.peakDBC 106.986877 +blk49.rmsSPL 103.909775 +blk49.rmsDBA 103.906563 +blk49.rmsDBC 103.908691 +blk49.rough 5.9468255 +blk49.sharp 0.922290385 +blk49.fluct 0 +blk49.impuls 3.08524489 +blk49.tonal 93.2421265 +blk59.peakSPL 107 +blk59.peakDBA 107.194679 +blk59.peakDBC 106.986877 +blk59.rmsSPL 103.909775 +blk59.rmsDBA 103.906563 +blk59.rmsDBC 103.908691 +blk59.rough 5.9027257 +blk59.sharp 0.922290385 +blk59.fluct 0 +blk59.impuls 3.04085279 +blk59.tonal 93.2421265 +blk69.peakSPL 107 +blk69.peakDBA 107.194679 +blk69.peakDBC 106.986877 +blk69.rmsSPL 103.960701 +blk69.rmsDBA 103.957611 +blk69.rmsDBC 103.959633 +blk69.rough 5.9027257 +blk69.sharp 0.922290385 +blk69.fluct 0 +blk69.impuls 3.02105308 +blk69.tonal 93.2421265 +blk79.peakSPL 107 +blk79.peakDBA 107.194679 +blk79.peakDBC 106.986877 +blk79.rmsSPL 103.979279 +blk79.rmsDBA 103.976242 +blk79.rmsDBC 103.978226 +blk79.rough 5.89879131 +blk79.sharp 0.922290385 +blk79.fluct 0 +blk79.impuls 3.01218557 +blk79.tonal 93.2421265 +blk89.peakSPL 107 +blk89.peakDBA 107.194679 +blk89.peakDBC 106.986877 +blk89.rmsSPL 103.986099 +blk89.rmsDBA 103.98307 +blk89.rmsDBC 103.985046 +blk89.rough 5.89879131 +blk89.sharp 0.922290385 +blk89.fluct 0 +blk89.impuls 3.00820732 +blk89.tonal 93.2421265 +blk99.peakSPL 107 +blk99.peakDBA 107.194679 +blk99.peakDBC 106.986877 +blk99.rmsSPL 103.988602 +blk99.rmsDBA 103.98558 +blk99.rmsDBC 103.987549 +blk99.rough 5.8984375 +blk99.sharp 0.922290385 +blk99.fluct 41.4477539 +blk99.impuls 3.00642085 +blk99.tonal 93.2421265 +blk109.peakSPL 107 +blk109.peakDBA 107.194679 +blk109.peakDBC 106.986877 +blk109.rmsSPL 103.988602 +blk109.rmsDBA 103.98558 +blk109.rmsDBC 103.987549 +blk109.rough 5.8984375 +blk109.sharp 0.922290385 +blk109.fluct 41.4477539 +blk109.impuls 3.00561833 +blk109.tonal 93.2421265 +blk119.peakSPL 107 +blk119.peakDBA 107.194679 +blk119.peakDBC 106.986877 +blk119.rmsSPL 103.989525 +blk119.rmsDBA 103.986504 +blk119.rmsDBC 103.988472 +blk119.rough 5.89840555 +blk119.sharp 0.922290385 +blk119.fluct 41.4477539 +blk119.impuls 3.00525784 +blk119.tonal 93.2421265 +blk129.peakSPL 107 +blk129.peakDBA 107.194679 +blk129.peakDBC 106.986877 +blk129.rmsSPL 103.989861 +blk129.rmsDBA 103.986847 +blk129.rmsDBC 103.988808 +blk129.rough 5.89840555 +blk129.sharp 0.922290385 +blk129.fluct 41.4477539 +blk129.impuls 3.00509572 +blk129.tonal 93.2421265 +blk139.peakSPL 107 +blk139.peakDBA 107.194679 +blk139.peakDBC 106.986877 +blk139.rmsSPL 103.98999 +blk139.rmsDBA 103.986969 +blk139.rmsDBC 103.988937 +blk139.rough 5.89840269 +blk139.sharp 0.922290385 +blk139.fluct 41.4477539 +blk139.impuls 3.005023 +blk139.tonal 93.2421265 +blk149.peakSPL 107 +blk149.peakDBA 107.194679 +blk149.peakDBC 106.986877 +blk149.rmsSPL 103.990036 +blk149.rmsDBA 103.987015 +blk149.rmsDBC 103.988983 +blk149.rough 5.89840269 +blk149.sharp 0.922290385 +blk149.fluct 41.4477539 +blk149.impuls 3.00499034 +blk149.tonal 93.2421265 +blk159.peakSPL 107 +blk159.peakDBA 107.194679 +blk159.peakDBC 106.986877 +blk159.rmsSPL 103.990036 +blk159.rmsDBA 103.987015 +blk159.rmsDBC 103.988983 +blk159.rough 5.89840269 +blk159.sharp 0.922290385 +blk159.fluct 41.4477539 +blk159.impuls 3.00497556 +blk159.tonal 93.2421265 +blk169.peakSPL 107 +blk169.peakDBA 107.194679 +blk169.peakDBC 106.986877 +blk169.rmsSPL 103.990051 +blk169.rmsDBA 103.98703 +blk169.rmsDBC 103.988998 +blk169.rough 5.89840269 +blk169.sharp 0.922290385 +blk169.fluct 41.4477539 +blk169.impuls 3.00496912 +blk169.tonal 93.2421265 +blk179.peakSPL 107 +blk179.peakDBA 107.194679 +blk179.peakDBC 106.986877 +blk179.rmsSPL 103.990051 +blk179.rmsDBA 103.987038 +blk179.rmsDBC 103.988998 +blk179.rough 5.89840269 +blk179.sharp 0.922290385 +blk179.fluct 41.4477539 +blk179.impuls 3.00496602 +blk179.tonal 93.2421265 +blk189.peakSPL 107 +blk189.peakDBA 107.194679 +blk189.peakDBC 106.986877 +blk189.rmsSPL 103.990059 +blk189.rmsDBA 103.987038 +blk189.rmsDBC 103.989006 +blk189.rough 5.89840269 +blk189.sharp 0.922290385 +blk189.fluct 41.4477539 +blk189.impuls 3.00496459 +blk189.tonal 93.2421265 +blk199.peakSPL 107 +blk199.peakDBA 107.194679 +blk199.peakDBC 106.986877 +blk199.rmsSPL 103.990059 +blk199.rmsDBA 103.987045 +blk199.rmsDBC 103.989006 +blk199.rough 5.89840269 +blk199.sharp 0.922290385 +blk199.fluct 2.0568068 +blk199.impuls 3.00496411 +blk199.tonal 93.2421265 +blk209.peakSPL 107 +blk209.peakDBA 107.194679 +blk209.peakDBC 106.986877 +blk209.rmsSPL 103.990059 +blk209.rmsDBA 103.987045 +blk209.rmsDBC 103.989006 +blk209.rough 5.89840269 +blk209.sharp 0.922290385 +blk209.fluct 2.0568068 +blk209.impuls 3.00496387 +blk209.tonal 93.2421265 +blk219.peakSPL 107 +blk219.peakDBA 106.988533 +blk219.peakDBC 106.983627 +blk219.rmsSPL 103.990059 +blk219.rmsDBA 103.987045 +blk219.rmsDBC 103.989006 +blk219.rough 5.89840269 +blk219.sharp 0.922290385 +blk219.fluct 2.0568068 +blk219.impuls 3.00496364 +blk219.tonal 93.2421265 +blk229.peakSPL 107 +blk229.peakDBA 106.988533 +blk229.peakDBC 106.983627 +blk229.rmsSPL 103.990059 +blk229.rmsDBA 103.987045 +blk229.rmsDBC 103.989006 +blk229.rough 5.89840269 +blk229.sharp 0.922290385 +blk229.fluct 2.0568068 +blk229.impuls 3.00496364 +blk229.tonal 93.2421265 +blk239.peakSPL 107 +blk239.peakDBA 106.988533 +blk239.peakDBC 106.983627 +blk239.rmsSPL 103.990059 +blk239.rmsDBA 103.987045 +blk239.rmsDBC 103.989006 +blk239.rough 5.89840269 +blk239.sharp 0.922290385 +blk239.fluct 2.0568068 +blk239.impuls 3.00496364 +blk239.tonal 93.2421265 +blk249.peakSPL 107 +blk249.peakDBA 106.988533 +blk249.peakDBC 106.983627 +blk249.rmsSPL 103.990059 +blk249.rmsDBA 103.987045 +blk249.rmsDBC 103.989006 +blk249.rough 5.89840269 +blk249.sharp 0.922290385 +blk249.fluct 2.0568068 +blk249.impuls 3.00496364 +blk249.tonal 93.2421265 +blk259.peakSPL 107 +blk259.peakDBA 106.988533 +blk259.peakDBC 106.983627 +blk259.rmsSPL 103.990059 +blk259.rmsDBA 103.987045 +blk259.rmsDBC 103.989006 +blk259.rough 5.89840269 +blk259.sharp 0.922290385 +blk259.fluct 2.0568068 +blk259.impuls 3.00496364 +blk259.tonal 93.2421265 +blk269.peakSPL 107 +blk269.peakDBA 106.988533 +blk269.peakDBC 106.983627 +blk269.rmsSPL 103.990059 +blk269.rmsDBA 103.987045 +blk269.rmsDBC 103.989006 +blk269.rough 5.89840269 +blk269.sharp 0.922290385 +blk269.fluct 2.0568068 +blk269.impuls 3.00496364 +blk269.tonal 93.2421265 +blk279.peakSPL 107 +blk279.peakDBA 106.988533 +blk279.peakDBC 106.983627 +blk279.rmsSPL 103.990059 +blk279.rmsDBA 103.987045 +blk279.rmsDBC 103.989006 +blk279.rough 5.89840269 +blk279.sharp 0.922290385 +blk279.fluct 2.0568068 +blk279.impuls 3.00496364 +blk279.tonal 93.2421265 +blk289.peakSPL 107 +blk289.peakDBA 106.988533 +blk289.peakDBC 106.983627 +blk289.rmsSPL 103.990059 +blk289.rmsDBA 103.987045 +blk289.rmsDBC 103.989006 +blk289.rough 5.89840269 +blk289.sharp 0.922290385 +blk289.fluct 2.0568068 +blk289.impuls 3.00496364 +blk289.tonal 93.2421265 +blk299.peakSPL 107 +blk299.peakDBA 106.988533 +blk299.peakDBC 106.983627 +blk299.rmsSPL 103.990059 +blk299.rmsDBA 103.987045 +blk299.rmsDBC 103.989006 +blk299.rough 5.89840269 +blk299.sharp 0.922290385 +blk299.fluct 0.409834325 +blk299.impuls 3.00496364 +blk299.tonal 93.2421265 +log.count 24 +log0.peakSPL 107 +log0.peakDBA 107.194679 +log0.peakDBC 106.986877 +log0.rmsSPL 101.998062 +log0.rmsDBA 101.988815 +log0.rmsDBC 101.995964 +log0.rough 0 +log0.fluct 0 +log0.sharp 0.922283471 +log0.sone 73.4597244 +log0.impuls 4.99696445 +log0.tonal 93.2400513 +log0.annoy 73.4597244 +log1.peakSPL 107 +log1.peakDBA 107.194679 +log1.peakDBC 106.986877 +log1.rmsSPL 103.358536 +log1.rmsDBA 103.353844 +log1.rmsDBC 103.357208 +log1.rough 18.6338444 +log1.fluct 0 +log1.sharp 0.922290325 +log1.sone 80.7496643 +log1.impuls 3.63648629 +log1.tonal 93.2421265 +log1.annoy 121.130775 +log2.peakSPL 107 +log2.peakDBA 107.194679 +log2.peakDBC 106.986877 +log2.rmsSPL 103.768265 +log2.rmsDBA 103.764694 +log2.rmsDBC 103.76712 +log2.rough 18.6338444 +log2.fluct 0 +log2.sharp 0.922290385 +log2.sone 83.0823212 +log2.impuls 3.22675419 +log2.tonal 93.2421265 +log2.annoy 125.105927 +log3.peakSPL 107 +log3.peakDBA 107.194679 +log3.peakDBC 106.986877 +log3.rmsSPL 103.909775 +log3.rmsDBA 103.906563 +log3.rmsDBC 103.908691 +log3.rough 5.9468255 +log3.fluct 0 +log3.sharp 0.922290385 +log3.sone 83.9033508 +log3.impuls 3.08524489 +log3.tonal 93.2421265 +log3.annoy 107.972664 +log4.peakSPL 107 +log4.peakDBA 107.194679 +log4.peakDBC 106.986877 +log4.rmsSPL 103.960701 +log4.rmsDBA 103.957611 +log4.rmsDBC 103.959633 +log4.rough 5.9027257 +log4.fluct 0 +log4.sharp 0.922290385 +log4.sone 84.200737 +log4.impuls 3.03432512 +log4.tonal 93.2421265 +log4.annoy 108.299713 +log5.peakSPL 107 +log5.peakDBA 107.194679 +log5.peakDBC 106.986877 +log5.rmsSPL 103.979279 +log5.rmsDBA 103.976242 +log5.rmsDBC 103.978226 +log5.rough 5.9027257 +log5.fluct 0 +log5.sharp 0.922290385 +log5.sone 84.3095398 +log5.impuls 3.01574206 +log5.tonal 93.2421265 +log5.annoy 108.452118 +log6.peakSPL 107 +log6.peakDBA 107.194679 +log6.peakDBC 106.986877 +log6.rmsSPL 103.986099 +log6.rmsDBA 103.98307 +log6.rmsDBC 103.985046 +log6.rough 5.89879131 +log6.fluct 0 +log6.sharp 0.922290385 +log6.sone 84.3494568 +log6.impuls 3.00892568 +log6.tonal 93.2421265 +log6.annoy 108.499992 +log7.peakSPL 107 +log7.peakDBA 107.194679 +log7.peakDBC 106.986877 +log7.rmsSPL 103.988602 +log7.rmsDBA 103.98558 +log7.rmsDBC 103.987549 +log7.rough 5.8984375 +log7.fluct 41.4477539 +log7.sharp 0.922290385 +log7.sone 84.364151 +log7.impuls 3.00642085 +log7.tonal 93.2421265 +log7.annoy 130.93129 +log8.peakSPL 107 +log8.peakDBA 107.194679 +log8.peakDBC 106.986877 +log8.rmsSPL 103.989525 +log8.rmsDBA 103.986504 +log8.rmsDBC 103.988472 +log8.rough 5.8984375 +log8.fluct 41.4477539 +log8.sharp 0.922290385 +log8.sone 84.3695297 +log8.impuls 3.0054996 +log8.tonal 93.2421265 +log8.annoy 130.940826 +log9.peakSPL 107 +log9.peakDBA 107.194679 +log9.peakDBC 106.986877 +log9.rmsSPL 103.989861 +log9.rmsDBA 103.986847 +log9.rmsDBC 103.988808 +log9.rough 5.89840555 +log9.fluct 41.4477539 +log9.sharp 0.922290385 +log9.sone 84.3715363 +log9.impuls 3.00516081 +log9.tonal 93.2421265 +log9.annoy 130.944305 +log10.peakSPL 107 +log10.peakDBA 107.194679 +log10.peakDBC 106.986877 +log10.rmsSPL 103.98999 +log10.rmsDBA 103.986969 +log10.rmsDBC 103.988937 +log10.rough 5.89840555 +log10.fluct 41.4477539 +log10.sharp 0.922290385 +log10.sone 84.372261 +log10.impuls 3.00503612 +log10.tonal 93.2421265 +log10.annoy 130.945587 +log11.peakSPL 107 +log11.peakDBA 107.194679 +log11.peakDBC 106.986877 +log11.rmsSPL 103.990036 +log11.rmsDBA 103.987015 +log11.rmsDBC 103.988983 +log11.rough 5.89840269 +log11.fluct 41.4477539 +log11.sharp 0.922290385 +log11.sone 84.3725433 +log11.impuls 3.00499034 +log11.tonal 93.2421265 +log11.annoy 130.946091 +log12.peakSPL 107 +log12.peakDBA 107.194679 +log12.peakDBC 106.986877 +log12.rmsSPL 103.990051 +log12.rmsDBA 103.98703 +log12.rmsDBC 103.988998 +log12.rough 5.89840269 +log12.fluct 41.4477539 +log12.sharp 0.922290385 +log12.sone 84.3726273 +log12.impuls 3.00497341 +log12.tonal 93.2421265 +log12.annoy 130.946243 +log13.peakSPL 107 +log13.peakDBA 107.194679 +log13.peakDBC 106.986877 +log13.rmsSPL 103.990051 +log13.rmsDBA 103.987038 +log13.rmsDBC 103.988998 +log13.rough 5.89840269 +log13.fluct 41.4477539 +log13.sharp 0.922290385 +log13.sone 84.3726501 +log13.impuls 3.00496721 +log13.tonal 93.2421265 +log13.annoy 130.946274 +log14.peakSPL 107 +log14.peakDBA 107.194679 +log14.peakDBC 106.986877 +log14.rmsSPL 103.990059 +log14.rmsDBA 103.987038 +log14.rmsDBC 103.989006 +log14.rough 5.89840269 +log14.fluct 41.4477539 +log14.sharp 0.922290385 +log14.sone 84.3726501 +log14.impuls 3.00496507 +log14.tonal 93.2421265 +log14.annoy 130.946274 +log15.peakSPL 107 +log15.peakDBA 107.194679 +log15.peakDBC 106.986877 +log15.rmsSPL 103.990059 +log15.rmsDBA 103.987045 +log15.rmsDBC 103.989006 +log15.rough 5.89840269 +log15.fluct 2.0568068 +log15.sharp 0.922290385 +log15.sone 84.3727112 +log15.impuls 3.00496411 +log15.tonal 93.2421265 +log15.annoy 113.524948 +log16.peakSPL 107 +log16.peakDBA 106.988533 +log16.peakDBC 106.983627 +log16.rmsSPL 103.990059 +log16.rmsDBA 103.987045 +log16.rmsDBC 103.989006 +log16.rough 5.89840269 +log16.fluct 2.0568068 +log16.sharp 0.922290385 +log16.sone 84.3727112 +log16.impuls 3.00496387 +log16.tonal 93.2421265 +log16.annoy 113.524948 +log17.peakSPL 107 +log17.peakDBA 106.988533 +log17.peakDBC 106.983627 +log17.rmsSPL 103.990059 +log17.rmsDBA 103.987045 +log17.rmsDBC 103.989006 +log17.rough 5.89840269 +log17.fluct 2.0568068 +log17.sharp 0.922290385 +log17.sone 84.3727112 +log17.impuls 3.00496364 +log17.tonal 93.2421265 +log17.annoy 113.524948 +log18.peakSPL 107 +log18.peakDBA 106.988533 +log18.peakDBC 106.983627 +log18.rmsSPL 103.990059 +log18.rmsDBA 103.987045 +log18.rmsDBC 103.989006 +log18.rough 5.89840269 +log18.fluct 2.0568068 +log18.sharp 0.922290385 +log18.sone 84.3727112 +log18.impuls 3.00496364 +log18.tonal 93.2421265 +log18.annoy 113.524948 +log19.peakSPL 107 +log19.peakDBA 106.988533 +log19.peakDBC 106.983627 +log19.rmsSPL 103.990059 +log19.rmsDBA 103.987045 +log19.rmsDBC 103.989006 +log19.rough 5.89840269 +log19.fluct 2.0568068 +log19.sharp 0.922290385 +log19.sone 84.3727112 +log19.impuls 3.00496364 +log19.tonal 93.2421265 +log19.annoy 113.524948 +log20.peakSPL 107 +log20.peakDBA 106.988533 +log20.peakDBC 106.983627 +log20.rmsSPL 103.990059 +log20.rmsDBA 103.987045 +log20.rmsDBC 103.989006 +log20.rough 5.89840269 +log20.fluct 2.0568068 +log20.sharp 0.922290385 +log20.sone 84.3727112 +log20.impuls 3.00496364 +log20.tonal 93.2421265 +log20.annoy 113.524948 +log21.peakSPL 107 +log21.peakDBA 106.988533 +log21.peakDBC 106.983627 +log21.rmsSPL 103.990059 +log21.rmsDBA 103.987045 +log21.rmsDBC 103.989006 +log21.rough 5.89840269 +log21.fluct 2.0568068 +log21.sharp 0.922290385 +log21.sone 84.3727112 +log21.impuls 3.00496364 +log21.tonal 93.2421265 +log21.annoy 113.524948 +log22.peakSPL 107 +log22.peakDBA 106.988533 +log22.peakDBC 106.983627 +log22.rmsSPL 103.990059 +log22.rmsDBA 103.987045 +log22.rmsDBC 103.989006 +log22.rough 5.89840269 +log22.fluct 2.0568068 +log22.sharp 0.922290385 +log22.sone 84.3727112 +log22.impuls 3.00496364 +log22.tonal 93.2421265 +log22.annoy 113.524948 +log23.peakSPL 107 +log23.peakDBA 106.988533 +log23.peakDBC 106.983627 +log23.rmsSPL 103.990059 +log23.rmsDBA 103.987045 +log23.rmsDBC 103.989006 +log23.rough 5.89840269 +log23.fluct 0.409834325 +log23.sharp 0.922290385 +log23.sone 84.3727112 +log23.impuls 3.00496364 +log23.tonal 93.2421265 +log23.annoy 110.760651 +fft-1.0 -0.0866025388 +fft-1.7 -0.0923879519 +fft-1.14 -0.0258819051 +fft-1.21 0.0608761422 +fft-1.28 0.100000001 +fft-1.35 0.0608761422 +fft-1.42 -0.0258819051 +fft-1.49 -0.0923879519 +fft-1.56 -0.0866025388 +fft-1.63 -0.0130526191 +fft-1.70 0.0707106814 +fft-1.77 0.0991444886 +fft-1.84 0.0500000007 +fft-1.91 -0.0382683426 +fft-1.98 -0.0965925828 +fft-1.105 -0.0793353319 +fft-1.112 -1.27578774e-13 +fft-1.119 0.0793353319 +fft-1.126 0.0965925828 +fft-1.133 0.0382683426 +fft-1.140 -0.0500000007 +fft-1.147 -0.0991444886 +fft-1.154 -0.0707106814 +fft-1.161 0.0130526191 +fft-1.168 0.0866025388 +fft-1.175 0.0923879519 +fft-1.182 0.0258819051 +fft-1.189 -0.0608761422 +fft-1.196 -0.100000001 +fft-1.203 -0.0608761422 +fft-1.210 0.0258819051 +fft-1.217 0.0923879519 +fft-1.224 0.0866025388 +fft-1.231 0.0130526191 +fft-1.238 -0.0707106814 +fft-1.245 -0.0991444886 +fft-1.252 -0.0500000007 +fft-1.259 0.0382683426 +fft-1.266 0.0965925828 +fft-1.273 0.0793353319 +fft-1.280 7.82817753e-14 +fft-1.287 -0.0793353319 +fft-1.294 -0.0965925828 +fft-1.301 -0.0382683426 +fft-1.308 0.0500000007 +fft-1.315 0.0991444886 +fft-1.322 0.0707106814 +fft-1.329 -0.0130526191 +fft-1.336 -0.0866025388 +fft-1.343 -0.0923879519 +fft-1.350 -0.0258819051 +fft-1.357 0.0608761422 +fft-1.364 0.100000001 +fft-1.371 0.0608761422 +fft-1.378 -0.0258819051 +fft-1.385 -0.0923879519 +fft-1.392 -0.0866025388 +fft-1.399 -0.0130526191 +fft-1.406 0.0707106814 +fft-1.413 0.0991444886 +fft-1.420 0.0500000007 +fft-1.427 -0.0382683426 +fft-1.434 -0.0965925828 +fft-1.441 -0.0793353319 +fft-1.448 -3.92782649e-13 +fft-1.455 0.0793353319 +fft-1.462 0.0965925828 +fft-1.469 0.0382683426 +fft-1.476 -0.0500000007 +fft-1.483 -0.0991444886 +fft-1.490 -0.0707106814 +fft-1.497 0.0130526191 +fft-1.504 0.0866025388 +fft-1.511 0.0923879519 +fft-1.518 0.0258819051 +fft-1.525 -0.0608761422 +fft-1.532 -0.100000001 +fft-1.539 -0.0608761422 +fft-1.546 0.0258819051 +fft-1.553 0.0923879519 +fft-1.560 0.0866025388 +fft-1.567 0.0130526191 +fft-1.574 -0.0707106814 +fft-1.581 -0.0991444886 +fft-1.588 -0.0500000007 +fft-1.595 0.0382683426 +fft-1.602 0.0965925828 +fft-1.609 0.0793353319 +fft-1.616 -2.03122143e-14 +fft-1.623 -0.0793353319 +fft-1.630 -0.0965925828 +fft-1.637 -0.0382683426 +fft-1.644 0.0500000007 +fft-1.651 0.0991444886 +fft-1.658 0.0707106814 +fft-1.665 -0.0130526191 +fft-1.672 -0.0866025388 +fft-1.679 -0.0923879519 +fft-1.686 -0.0258819051 +fft-1.693 0.0608761422 +fft-1.700 0.100000001 +fft-1.707 0.0608761422 +fft-1.714 -0.0258819051 +fft-1.721 -0.0923879519 +fft-1.728 -0.0866025388 +fft-1.735 -0.0130526191 +fft-1.742 0.0707106814 +fft-1.749 0.0991444886 +fft-1.756 0.0500000007 +fft-1.763 -0.0382683426 +fft-1.770 -0.0965925828 +fft-1.777 -0.0793353319 +fft-1.784 -2.94188664e-13 +fft-1.791 0.0793353319 +fft-1.798 0.0965925828 +fft-1.805 0.0382683426 +fft-1.812 -0.0500000007 +fft-1.819 -0.0991444886 +fft-1.826 -0.0707106814 +fft-1.833 0.0130526191 +fft-1.840 0.0866025388 +fft-1.847 0.0923879519 +fft-1.854 0.0258819051 +fft-1.861 -0.0608761422 +fft-1.868 -0.100000001 +fft-1.875 -0.0608761422 +fft-1.882 0.0258819051 +fft-1.889 0.0923879519 +fft-1.896 0.0866025388 +fft-1.903 0.0130526191 +fft-1.910 -0.0707106814 +fft-1.917 -0.0991444886 +fft-1.924 -0.0500000007 +fft-1.931 0.0382683426 +fft-1.938 0.0965925828 +fft-1.945 0.0793353319 +fft-1.952 2.44891672e-13 +fft-1.959 -0.0793353319 +fft-1.966 -0.0965925828 +fft-1.973 -0.0382683426 +fft-1.980 0.0500000007 +fft-1.987 0.0991444886 +fft-1.994 0.0707106814 +fft-1.1001 -0.0130526191 +fft-1.1008 -0.0866025388 +fft-1.1015 -0.0923879519 +fft-1.1022 -0.0258819051 +fft-1.1029 0.0608761422 +fft-1.1036 0.100000001 +fft-1.1043 0.0608761422 +fft-1.1050 -0.0258819051 +fft-1.1057 -0.0923879519 +fft-1.1064 -0.0866025388 +fft-1.1071 -0.0130526191 +fft-1.1078 0.0707106814 +fft-1.1085 0.0991444886 +fft-1.1092 0.0500000007 +fft-1.1099 -0.0382683426 +fft-1.1106 -0.0965925828 +fft-1.1113 -0.0793353319 +fft-1.1120 -1.9559468e-13 +fft-1.1127 0.0793353319 +fft-1.1134 0.0965925828 +fft-1.1141 0.0382683426 +fft-1.1148 -0.0500000007 +fft-1.1155 -0.0991444886 +fft-1.1162 -0.0707106814 +fft-1.1169 0.0130526191 +fft-1.1176 0.0866025388 +fft-1.1183 0.0923879519 +fft-1.1190 0.0258819051 +fft-1.1197 -0.0608761422 +fft-1.1204 -0.100000001 +fft-1.1211 -0.0608761422 +fft-1.1218 0.0258819051 +fft-1.1225 0.0923879519 +fft-1.1232 0.0866025388 +fft-1.1239 0.0130526191 +fft-1.1246 -0.0707106814 +fft-1.1253 -0.0991444886 +fft-1.1260 -0.0500000007 +fft-1.1267 0.0382683426 +fft-1.1274 0.0965925828 +fft-1.1281 0.0793353319 +fft-1.1288 1.46297688e-13 +fft-1.1295 -0.0793353319 +fft-1.1302 -0.0965925828 +fft-1.1309 -0.0382683426 +fft-1.1316 0.0500000007 +fft-1.1323 0.0991444886 +fft-1.1330 0.0707106814 +fft-1.1337 -0.0130526191 +fft-1.1344 -0.0866025388 +fft-1.1351 -0.0923879519 +fft-1.1358 -0.0258819051 +fft-1.1365 0.0608761422 +fft-1.1372 0.100000001 +fft-1.1379 0.0608761422 +fft-1.1386 -0.0258819051 +fft-1.1393 -0.0923879519 +fft-1.1400 -0.0866025388 +fft-1.1407 -0.0130526191 +fft-1.1414 0.0707106814 +fft-1.1421 0.0991444886 +fft-1.1428 0.0500000007 +fft-1.1435 -0.0382683426 +fft-1.1442 -0.0965925828 +fft-1.1449 -0.0793353319 +fft-1.1456 -9.70006952e-14 +fft-1.1463 0.0793353319 +fft-1.1470 0.0965925828 +fft-1.1477 0.0382683426 +fft-1.1484 -0.0500000007 +fft-1.1491 -0.0991444886 +fft-1.1498 -0.0707106814 +fft-1.1505 0.0130526191 +fft-1.1512 0.0866025388 +fft-1.1519 0.0923879519 +fft-1.1526 0.0258819051 +fft-1.1533 -0.0608761422 +fft-1.1540 -0.100000001 +fft-1.1547 -0.0608761422 +fft-1.1554 0.0258819051 +fft-1.1561 0.0923879519 +fft-1.1568 0.0866025388 +fft-1.1575 0.0130526191 +fft-1.1582 -0.0707106814 +fft-1.1589 -0.0991444886 +fft-1.1596 -0.0500000007 +fft-1.1603 0.0382683426 +fft-1.1610 0.0965925828 +fft-1.1617 0.0793353319 +fft-1.1624 4.77036962e-14 +fft-1.1631 -0.0793353319 +fft-1.1638 -0.0965925828 +fft-1.1645 -0.0382683426 +fft-1.1652 0.0500000007 +fft-1.1659 0.0991444886 +fft-1.1666 0.0707106814 +fft-1.1673 -0.0130526191 +fft-1.1680 -0.0866025388 +fft-1.1687 -0.0923879519 +fft-1.1694 -0.0258819051 +fft-1.1701 0.0608761422 +fft-1.1708 0.100000001 +fft-1.1715 0.0608761422 +fft-1.1722 -0.0258819051 +fft-1.1729 -0.0923879519 +fft-1.1736 -0.0866025388 +fft-1.1743 -0.0130526191 +fft-1.1750 0.0707106814 +fft-1.1757 0.0991444886 +fft-1.1764 0.0500000007 +fft-1.1771 -0.0382683426 +fft-1.1778 -0.0965925828 +fft-1.1785 -0.0793353319 +fft-1.1792 1.59329746e-15 +fft-1.1799 0.0793353319 +fft-1.1806 0.0965925828 +fft-1.1813 0.0382683426 +fft-1.1820 -0.0500000007 +fft-1.1827 -0.0991444886 +fft-1.1834 -0.0707106814 +fft-1.1841 0.0130526191 +fft-1.1848 0.0866025388 +fft-1.1855 0.0923879519 +fft-1.1862 0.0258819051 +fft-1.1869 -0.0608761422 +fft-1.1876 -0.100000001 +fft-1.1883 -0.0608761422 +fft-1.1890 0.0258819051 +fft-1.1897 0.0923879519 +fft-1.1904 0.0866025388 +fft-1.1911 0.0130526191 +fft-1.1918 -0.0707106814 +fft-1.1925 -0.0991444886 +fft-1.1932 -0.0500000007 +fft-1.1939 0.0382683426 +fft-1.1946 0.0965925828 +fft-1.1953 0.0793353319 +fft-1.1960 3.12907577e-13 +fft-1.1967 -0.0793353319 +fft-1.1974 -0.0965925828 +fft-1.1981 -0.0382683426 +fft-1.1988 0.0500000007 +fft-1.1995 0.0991444886 +fft-1.2002 0.0707106814 +fft-1.2009 -0.0130526191 +fft-1.2016 -0.0866025388 +fft-1.2023 -0.0923879519 +fft-1.2030 -0.0258819051 +fft-1.2037 0.0608761422 +fft-1.2044 0.100000001 +fft-1.2051 0.0608761422 +fft-1.2058 -0.0258819051 +fft-1.2065 -0.0923879519 +fft-1.2072 -0.0866025388 +fft-1.2079 -0.0130526191 +fft-1.2086 0.0707106814 +fft-1.2093 0.0991444886 +fft-1.2100 0.0500000007 +fft-1.2107 -0.0382683426 +fft-1.2114 -0.0965925828 +fft-1.2121 -0.0793353319 +fft-1.2128 -2.63610585e-13 +fft-1.2135 0.0793353319 +fft-1.2142 0.0965925828 +fft-1.2149 0.0382683426 +fft-1.2156 -0.0500000007 +fft-1.2163 -0.0991444886 +fft-1.2170 -0.0707106814 +fft-1.2177 0.0130526191 +fft-1.2184 0.0866025388 +fft-1.2191 0.0923879519 +fft-1.2198 0.0258819051 +fft-1.2205 -0.0608761422 +fft-1.2212 -0.100000001 +fft-1.2219 -0.0608761422 +fft-1.2226 0.0258819051 +fft-1.2233 0.0923879519 +fft-1.2240 0.0866025388 +fft-1.2247 0.0130526191 +fft-1.2254 -0.0707106814 +fft-1.2261 -0.0991444886 +fft-1.2268 -0.0500000007 +fft-1.2275 0.0382683426 +fft-1.2282 0.0965925828 +fft-1.2289 0.0793353319 +fft-1.2296 2.14313593e-13 +fft-1.2303 -0.0793353319 +fft-1.2310 -0.0965925828 +fft-1.2317 -0.0382683426 +fft-1.2324 0.0500000007 +fft-1.2331 0.0991444886 +fft-1.2338 0.0707106814 +fft-1.2345 -0.0130526191 +fft-1.2352 -0.0866025388 +fft-1.2359 -0.0923879519 +fft-1.2366 -0.0258819051 +fft-1.2373 0.0608761422 +fft-1.2380 0.100000001 +fft-1.2387 0.0608761422 +fft-1.2394 -0.0258819051 +fft-1.2401 -0.0923879519 +fft-1.2408 -0.0866025388 +fft-1.2415 -0.0130526191 +fft-1.2422 0.0707106814 +fft-1.2429 0.0991444886 +fft-1.2436 0.0500000007 +fft-1.2443 -0.0382683426 +fft-1.2450 -0.0965925828 +fft-1.2457 -0.0793353319 +fft-1.2464 -1.65016601e-13 +fft-1.2471 0.0793353319 +fft-1.2478 0.0965925828 +fft-1.2485 0.0382683426 +fft-1.2492 -0.0500000007 +fft-1.2499 -0.0991444886 +fft-1.2506 -0.0707106814 +fft-1.2513 0.0130526191 +fft-1.2520 0.0866025388 +fft-1.2527 0.0923879519 +fft-1.2534 0.0258819051 +fft-1.2541 -0.0608761422 +fft-1.2548 -0.100000001 +fft-1.2555 -0.0608761422 +fft-1.2562 0.0258819051 +fft-1.2569 0.0923879519 +fft-1.2576 0.0866025388 +fft-1.2583 0.0130526191 +fft-1.2590 -0.0707106814 +fft-1.2597 -0.0991444886 +fft-1.2604 -0.0500000007 +fft-1.2611 0.0382683426 +fft-1.2618 0.0965925828 +fft-1.2625 0.0793353319 +fft-1.2632 1.15719608e-13 +fft-1.2639 -0.0793353319 +fft-1.2646 -0.0965925828 +fft-1.2653 -0.0382683426 +fft-1.2660 0.0500000007 +fft-1.2667 0.0991444886 +fft-1.2674 0.0707106814 +fft-1.2681 -0.0130526191 +fft-1.2688 -0.0866025388 +fft-1.2695 -0.0923879519 +fft-1.2702 -0.0258819051 +fft-1.2709 0.0608761422 +fft-1.2716 0.100000001 +fft-1.2723 0.0608761422 +fft-1.2730 -0.0258819051 +fft-1.2737 -0.0923879519 +fft-1.2744 -0.0866025388 +fft-1.2751 -0.0130526191 +fft-1.2758 0.0707106814 +fft-1.2765 0.0991444886 +fft-1.2772 0.0500000007 +fft-1.2779 -0.0382683426 +fft-1.2786 -0.0965925828 +fft-1.2793 -0.0793353319 +fft-1.2800 -6.64226161e-14 +fft-1.2807 0.0793353319 +fft-1.2814 0.0965925828 +fft-1.2821 0.0382683426 +fft-1.2828 -0.0500000007 +fft-1.2835 -0.0991444886 +fft-1.2842 -0.0707106814 +fft-1.2849 0.0130526191 +fft-1.2856 0.0866025388 +fft-1.2863 0.0923879519 +fft-1.2870 0.0258819051 +fft-1.2877 -0.0608761422 +fft-1.2884 -0.100000001 +fft-1.2891 -0.0608761422 +fft-1.2898 0.0258819051 +fft-1.2905 0.0923879519 +fft-1.2912 0.0866025388 +fft-1.2919 0.0130526191 +fft-1.2926 -0.0707106814 +fft-1.2933 -0.0991444886 +fft-1.2940 -0.0500000007 +fft-1.2947 0.0382683426 +fft-1.2954 0.0965925828 +fft-1.2961 0.0793353319 +fft-1.2968 1.71256188e-14 +fft-1.2975 -0.0793353319 +fft-1.2982 -0.0965925828 +fft-1.2989 -0.0382683426 +fft-1.2996 0.0500000007 +fft-1.3003 0.0991444886 +fft-1.3010 0.0707106814 +fft-1.3017 -0.0130526191 +fft-1.3024 -0.0866025388 +fft-1.3031 -0.0923879519 +fft-1.3038 -0.0258819051 +fft-1.3045 0.0608761422 +fft-1.3052 0.100000001 +fft-1.3059 0.0608761422 +fft-1.3066 -0.0258819051 +fft-1.3073 -0.0923879519 +fft-1.3080 -0.0866025388 +fft-1.3087 -0.0130526191 +fft-1.3094 0.0707106814 +fft-1.3101 0.0991444886 +fft-1.3108 0.0500000007 +fft-1.3115 -0.0382683426 +fft-1.3122 -0.0965925828 +fft-1.3129 -0.0793353319 +fft-1.3136 -3.31626518e-13 +fft-1.3143 0.0793353319 +fft-1.3150 0.0965925828 +fft-1.3157 0.0382683426 +fft-1.3164 -0.0500000007 +fft-1.3171 -0.0991444886 +fft-1.3178 -0.0707106814 +fft-1.3185 0.0130526191 +fft-1.3192 0.0866025388 +fft-1.3199 0.0923879519 +fft-1.3206 0.0258819051 +fft-1.3213 -0.0608761422 +fft-1.3220 -0.100000001 +fft-1.3227 -0.0608761422 +fft-1.3234 0.0258819051 +fft-1.3241 0.0923879519 +fft-1.3248 0.0866025388 +fft-1.3255 0.0130526191 +fft-1.3262 -0.0707106814 +fft-1.3269 -0.0991444886 +fft-1.3276 -0.0500000007 +fft-1.3283 0.0382683426 +fft-1.3290 0.0965925828 +fft-1.3297 0.0793353319 +fft-1.3304 2.82329498e-13 +fft-1.3311 -0.0793353319 +fft-1.3318 -0.0965925828 +fft-1.3325 -0.0382683426 +fft-1.3332 0.0500000007 +fft-1.3339 0.0991444886 +fft-1.3346 0.0707106814 +fft-1.3353 -0.0130526191 +fft-1.3360 -0.0866025388 +fft-1.3367 -0.0923879519 +fft-1.3374 -0.0258819051 +fft-1.3381 0.0608761422 +fft-1.3388 0.100000001 +fft-1.3395 0.0608761422 +fft-1.3402 -0.0258819051 +fft-1.3409 -0.0923879519 +fft-1.3416 -0.0866025388 +fft-1.3423 -0.0130526191 +fft-1.3430 0.0707106814 +fft-1.3437 0.0991444886 +fft-1.3444 0.0500000007 +fft-1.3451 -0.0382683426 +fft-1.3458 -0.0965925828 +fft-1.3465 -0.0793353319 +fft-1.3472 -2.33032506e-13 +fft-1.3479 0.0793353319 +fft-1.3486 0.0965925828 +fft-1.3493 0.0382683426 +fft-1.3500 -0.0500000007 +fft-1.3507 -0.0991444886 +fft-1.3514 -0.0707106814 +fft-1.3521 0.0130526191 +fft-1.3528 0.0866025388 +fft-1.3535 0.0923879519 +fft-1.3542 0.0258819051 +fft-1.3549 -0.0608761422 +fft-1.3556 -0.100000001 +fft-1.3563 -0.0608761422 +fft-1.3570 0.0258819051 +fft-1.3577 0.0923879519 +fft-1.3584 0.0866025388 +fft-1.3591 0.0130526191 +fft-1.3598 -0.0707106814 +fft-1.3605 -0.0991444886 +fft-1.3612 -0.0500000007 +fft-1.3619 0.0382683426 +fft-1.3626 0.0965925828 +fft-1.3633 0.0793353319 +fft-1.3640 1.83735514e-13 +fft-1.3647 -0.0793353319 +fft-1.3654 -0.0965925828 +fft-1.3661 -0.0382683426 +fft-1.3668 0.0500000007 +fft-1.3675 0.0991444886 +fft-1.3682 0.0707106814 +fft-1.3689 -0.0130526191 +fft-1.3696 -0.0866025388 +fft-1.3703 -0.0923879519 +fft-1.3710 -0.0258819051 +fft-1.3717 0.0608761422 +fft-1.3724 0.100000001 +fft-1.3731 0.0608761422 +fft-1.3738 -0.0258819051 +fft-1.3745 -0.0923879519 +fft-1.3752 -0.0866025388 +fft-1.3759 -0.0130526191 +fft-1.3766 0.0707106814 +fft-1.3773 0.0991444886 +fft-1.3780 0.0500000007 +fft-1.3787 -0.0382683426 +fft-1.3794 -0.0965925828 +fft-1.3801 -0.0793353319 +fft-1.3808 -1.34438522e-13 +fft-1.3815 0.0793353319 +fft-1.3822 0.0965925828 +fft-1.3829 0.0382683426 +fft-1.3836 -0.0500000007 +fft-1.3843 -0.0991444886 +fft-1.3850 -0.0707106814 +fft-1.3857 0.0130526191 +fft-1.3864 0.0866025388 +fft-1.3871 0.0923879519 +fft-1.3878 0.0258819051 +fft-1.3885 -0.0608761422 +fft-1.3892 -0.100000001 +fft-1.3899 -0.0608761422 +fft-1.3906 0.0258819051 +fft-1.3913 0.0923879519 +fft-1.3920 0.0866025388 +fft-1.3927 0.0130526191 +fft-1.3934 -0.0707106814 +fft-1.3941 -0.0991444886 +fft-1.3948 -0.0500000007 +fft-1.3955 0.0382683426 +fft-1.3962 0.0965925828 +fft-1.3969 0.0793353319 +fft-1.3976 8.51415292e-14 +fft-1.3983 -0.0793353319 +fft-1.3990 -0.0965925828 +fft-1.3997 -0.0382683426 +fft-1.4004 0.0500000007 +fft-1.4011 0.0991444886 +fft-1.4018 0.0707106814 +fft-1.4025 -0.0130526191 +fft-1.4032 -0.0866025388 +fft-1.4039 -0.0923879519 +fft-1.4046 -0.0258819051 +fft-1.4053 0.0608761422 +fft-1.4060 0.100000001 +fft-1.4067 0.0608761422 +fft-1.4074 -0.0258819051 +fft-1.4081 -0.0923879519 +fft-1.4088 -0.0866025388 +fft-1.4095 -0.0130526191 +fft0.0 -0.0866025388 +fft0.7 -0.0923879519 +fft0.14 -0.0258819051 +fft0.21 0.0608761422 +fft0.28 0.100000001 +fft0.35 0.0608761422 +fft0.42 -0.0258819051 +fft0.49 -0.0923879519 +fft0.56 -0.0866025388 +fft0.63 -0.0130526191 +fft0.70 0.0707106814 +fft0.77 0.0991444886 +fft0.84 0.0500000007 +fft0.91 -0.0382683426 +fft0.98 -0.0965925828 +fft0.105 -0.0793353319 +fft0.112 -1.27578774e-13 +fft0.119 0.0793353319 +fft0.126 0.0965925828 +fft0.133 0.0382683426 +fft0.140 -0.0500000007 +fft0.147 -0.0991444886 +fft0.154 -0.0707106814 +fft0.161 0.0130526191 +fft0.168 0.0866025388 +fft0.175 0.0923879519 +fft0.182 0.0258819051 +fft0.189 -0.0608761422 +fft0.196 -0.100000001 +fft0.203 -0.0608761422 +fft0.210 0.0258819051 +fft0.217 0.0923879519 +fft0.224 0.0866025388 +fft0.231 0.0130526191 +fft0.238 -0.0707106814 +fft0.245 -0.0991444886 +fft0.252 -0.0500000007 +fft0.259 0.0382683426 +fft0.266 0.0965925828 +fft0.273 0.0793353319 +fft0.280 7.82817753e-14 +fft0.287 -0.0793353319 +fft0.294 -0.0965925828 +fft0.301 -0.0382683426 +fft0.308 0.0500000007 +fft0.315 0.0991444886 +fft0.322 0.0707106814 +fft0.329 -0.0130526191 +fft0.336 -0.0866025388 +fft0.343 -0.0923879519 +fft0.350 -0.0258819051 +fft0.357 0.0608761422 +fft0.364 0.100000001 +fft0.371 0.0608761422 +fft0.378 -0.0258819051 +fft0.385 -0.0923879519 +fft0.392 -0.0866025388 +fft0.399 -0.0130526191 +fft0.406 0.0707106814 +fft0.413 0.0991444886 +fft0.420 0.0500000007 +fft0.427 -0.0382683426 +fft0.434 -0.0965925828 +fft0.441 -0.0793353319 +fft0.448 -3.92782649e-13 +fft0.455 0.0793353319 +fft0.462 0.0965925828 +fft0.469 0.0382683426 +fft0.476 -0.0500000007 +fft0.483 -0.0991444886 +fft0.490 -0.0707106814 +fft0.497 0.0130526191 +fft0.504 0.0866025388 +fft0.511 0.0923879519 +fft0.518 0.0258819051 +fft0.525 -0.0608761422 +fft0.532 -0.100000001 +fft0.539 -0.0608761422 +fft0.546 0.0258819051 +fft0.553 0.0923879519 +fft0.560 0.0866025388 +fft0.567 0.0130526191 +fft0.574 -0.0707106814 +fft0.581 -0.0991444886 +fft0.588 -0.0500000007 +fft0.595 0.0382683426 +fft0.602 0.0965925828 +fft0.609 0.0793353319 +fft0.616 -2.03122143e-14 +fft0.623 -0.0793353319 +fft0.630 -0.0965925828 +fft0.637 -0.0382683426 +fft0.644 0.0500000007 +fft0.651 0.0991444886 +fft0.658 0.0707106814 +fft0.665 -0.0130526191 +fft0.672 -0.0866025388 +fft0.679 -0.0923879519 +fft0.686 -0.0258819051 +fft0.693 0.0608761422 +fft0.700 0.100000001 +fft0.707 0.0608761422 +fft0.714 -0.0258819051 +fft0.721 -0.0923879519 +fft0.728 -0.0866025388 +fft0.735 -0.0130526191 +fft0.742 0.0707106814 +fft0.749 0.0991444886 +fft0.756 0.0500000007 +fft0.763 -0.0382683426 +fft0.770 -0.0965925828 +fft0.777 -0.0793353319 +fft0.784 -2.94188664e-13 +fft0.791 0.0793353319 +fft0.798 0.0965925828 +fft0.805 0.0382683426 +fft0.812 -0.0500000007 +fft0.819 -0.0991444886 +fft0.826 -0.0707106814 +fft0.833 0.0130526191 +fft0.840 0.0866025388 +fft0.847 0.0923879519 +fft0.854 0.0258819051 +fft0.861 -0.0608761422 +fft0.868 -0.100000001 +fft0.875 -0.0608761422 +fft0.882 0.0258819051 +fft0.889 0.0923879519 +fft0.896 0.0866025388 +fft0.903 0.0130526191 +fft0.910 -0.0707106814 +fft0.917 -0.0991444886 +fft0.924 -0.0500000007 +fft0.931 0.0382683426 +fft0.938 0.0965925828 +fft0.945 0.0793353319 +fft0.952 2.44891672e-13 +fft0.959 -0.0793353319 +fft0.966 -0.0965925828 +fft0.973 -0.0382683426 +fft0.980 0.0500000007 +fft0.987 0.0991444886 +fft0.994 0.0707106814 +fft0.1001 -0.0130526191 +fft0.1008 -0.0866025388 +fft0.1015 -0.0923879519 +fft0.1022 -0.0258819051 +fft0.1029 0.0608761422 +fft0.1036 0.100000001 +fft0.1043 0.0608761422 +fft0.1050 -0.0258819051 +fft0.1057 -0.0923879519 +fft0.1064 -0.0866025388 +fft0.1071 -0.0130526191 +fft0.1078 0.0707106814 +fft0.1085 0.0991444886 +fft0.1092 0.0500000007 +fft0.1099 -0.0382683426 +fft0.1106 -0.0965925828 +fft0.1113 -0.0793353319 +fft0.1120 -1.9559468e-13 +fft0.1127 0.0793353319 +fft0.1134 0.0965925828 +fft0.1141 0.0382683426 +fft0.1148 -0.0500000007 +fft0.1155 -0.0991444886 +fft0.1162 -0.0707106814 +fft0.1169 0.0130526191 +fft0.1176 0.0866025388 +fft0.1183 0.0923879519 +fft0.1190 0.0258819051 +fft0.1197 -0.0608761422 +fft0.1204 -0.100000001 +fft0.1211 -0.0608761422 +fft0.1218 0.0258819051 +fft0.1225 0.0923879519 +fft0.1232 0.0866025388 +fft0.1239 0.0130526191 +fft0.1246 -0.0707106814 +fft0.1253 -0.0991444886 +fft0.1260 -0.0500000007 +fft0.1267 0.0382683426 +fft0.1274 0.0965925828 +fft0.1281 0.0793353319 +fft0.1288 1.46297688e-13 +fft0.1295 -0.0793353319 +fft0.1302 -0.0965925828 +fft0.1309 -0.0382683426 +fft0.1316 0.0500000007 +fft0.1323 0.0991444886 +fft0.1330 0.0707106814 +fft0.1337 -0.0130526191 +fft0.1344 -0.0866025388 +fft0.1351 -0.0923879519 +fft0.1358 -0.0258819051 +fft0.1365 0.0608761422 +fft0.1372 0.100000001 +fft0.1379 0.0608761422 +fft0.1386 -0.0258819051 +fft0.1393 -0.0923879519 +fft0.1400 -0.0866025388 +fft0.1407 -0.0130526191 +fft0.1414 0.0707106814 +fft0.1421 0.0991444886 +fft0.1428 0.0500000007 +fft0.1435 -0.0382683426 +fft0.1442 -0.0965925828 +fft0.1449 -0.0793353319 +fft0.1456 -9.70006952e-14 +fft0.1463 0.0793353319 +fft0.1470 0.0965925828 +fft0.1477 0.0382683426 +fft0.1484 -0.0500000007 +fft0.1491 -0.0991444886 +fft0.1498 -0.0707106814 +fft0.1505 0.0130526191 +fft0.1512 0.0866025388 +fft0.1519 0.0923879519 +fft0.1526 0.0258819051 +fft0.1533 -0.0608761422 +fft0.1540 -0.100000001 +fft0.1547 -0.0608761422 +fft0.1554 0.0258819051 +fft0.1561 0.0923879519 +fft0.1568 0.0866025388 +fft0.1575 0.0130526191 +fft0.1582 -0.0707106814 +fft0.1589 -0.0991444886 +fft0.1596 -0.0500000007 +fft0.1603 0.0382683426 +fft0.1610 0.0965925828 +fft0.1617 0.0793353319 +fft0.1624 4.77036962e-14 +fft0.1631 -0.0793353319 +fft0.1638 -0.0965925828 +fft0.1645 -0.0382683426 +fft0.1652 0.0500000007 +fft0.1659 0.0991444886 +fft0.1666 0.0707106814 +fft0.1673 -0.0130526191 +fft0.1680 -0.0866025388 +fft0.1687 -0.0923879519 +fft0.1694 -0.0258819051 +fft0.1701 0.0608761422 +fft0.1708 0.100000001 +fft0.1715 0.0608761422 +fft0.1722 -0.0258819051 +fft0.1729 -0.0923879519 +fft0.1736 -0.0866025388 +fft0.1743 -0.0130526191 +fft0.1750 0.0707106814 +fft0.1757 0.0991444886 +fft0.1764 0.0500000007 +fft0.1771 -0.0382683426 +fft0.1778 -0.0965925828 +fft0.1785 -0.0793353319 +fft0.1792 1.59329746e-15 +fft0.1799 0.0793353319 +fft0.1806 0.0965925828 +fft0.1813 0.0382683426 +fft0.1820 -0.0500000007 +fft0.1827 -0.0991444886 +fft0.1834 -0.0707106814 +fft0.1841 0.0130526191 +fft0.1848 0.0866025388 +fft0.1855 0.0923879519 +fft0.1862 0.0258819051 +fft0.1869 -0.0608761422 +fft0.1876 -0.100000001 +fft0.1883 -0.0608761422 +fft0.1890 0.0258819051 +fft0.1897 0.0923879519 +fft0.1904 0.0866025388 +fft0.1911 0.0130526191 +fft0.1918 -0.0707106814 +fft0.1925 -0.0991444886 +fft0.1932 -0.0500000007 +fft0.1939 0.0382683426 +fft0.1946 0.0965925828 +fft0.1953 0.0793353319 +fft0.1960 3.12907577e-13 +fft0.1967 -0.0793353319 +fft0.1974 -0.0965925828 +fft0.1981 -0.0382683426 +fft0.1988 0.0500000007 +fft0.1995 0.0991444886 +fft0.2002 0.0707106814 +fft0.2009 -0.0130526191 +fft0.2016 -0.0866025388 +fft0.2023 -0.0923879519 +fft0.2030 -0.0258819051 +fft0.2037 0.0608761422 +fft0.2044 0.100000001 +fft0.2051 0.0608761422 +fft0.2058 -0.0258819051 +fft0.2065 -0.0923879519 +fft0.2072 -0.0866025388 +fft0.2079 -0.0130526191 +fft0.2086 0.0707106814 +fft0.2093 0.0991444886 +fft0.2100 0.0500000007 +fft0.2107 -0.0382683426 +fft0.2114 -0.0965925828 +fft0.2121 -0.0793353319 +fft0.2128 -2.63610585e-13 +fft0.2135 0.0793353319 +fft0.2142 0.0965925828 +fft0.2149 0.0382683426 +fft0.2156 -0.0500000007 +fft0.2163 -0.0991444886 +fft0.2170 -0.0707106814 +fft0.2177 0.0130526191 +fft0.2184 0.0866025388 +fft0.2191 0.0923879519 +fft0.2198 0.0258819051 +fft0.2205 -0.0608761422 +fft0.2212 -0.100000001 +fft0.2219 -0.0608761422 +fft0.2226 0.0258819051 +fft0.2233 0.0923879519 +fft0.2240 0.0866025388 +fft0.2247 0.0130526191 +fft0.2254 -0.0707106814 +fft0.2261 -0.0991444886 +fft0.2268 -0.0500000007 +fft0.2275 0.0382683426 +fft0.2282 0.0965925828 +fft0.2289 0.0793353319 +fft0.2296 2.14313593e-13 +fft0.2303 -0.0793353319 +fft0.2310 -0.0965925828 +fft0.2317 -0.0382683426 +fft0.2324 0.0500000007 +fft0.2331 0.0991444886 +fft0.2338 0.0707106814 +fft0.2345 -0.0130526191 +fft0.2352 -0.0866025388 +fft0.2359 -0.0923879519 +fft0.2366 -0.0258819051 +fft0.2373 0.0608761422 +fft0.2380 0.100000001 +fft0.2387 0.0608761422 +fft0.2394 -0.0258819051 +fft0.2401 -0.0923879519 +fft0.2408 -0.0866025388 +fft0.2415 -0.0130526191 +fft0.2422 0.0707106814 +fft0.2429 0.0991444886 +fft0.2436 0.0500000007 +fft0.2443 -0.0382683426 +fft0.2450 -0.0965925828 +fft0.2457 -0.0793353319 +fft0.2464 -1.65016601e-13 +fft0.2471 0.0793353319 +fft0.2478 0.0965925828 +fft0.2485 0.0382683426 +fft0.2492 -0.0500000007 +fft0.2499 -0.0991444886 +fft0.2506 -0.0707106814 +fft0.2513 0.0130526191 +fft0.2520 0.0866025388 +fft0.2527 0.0923879519 +fft0.2534 0.0258819051 +fft0.2541 -0.0608761422 +fft0.2548 -0.100000001 +fft0.2555 -0.0608761422 +fft0.2562 0.0258819051 +fft0.2569 0.0923879519 +fft0.2576 0.0866025388 +fft0.2583 0.0130526191 +fft0.2590 -0.0707106814 +fft0.2597 -0.0991444886 +fft0.2604 -0.0500000007 +fft0.2611 0.0382683426 +fft0.2618 0.0965925828 +fft0.2625 0.0793353319 +fft0.2632 1.15719608e-13 +fft0.2639 -0.0793353319 +fft0.2646 -0.0965925828 +fft0.2653 -0.0382683426 +fft0.2660 0.0500000007 +fft0.2667 0.0991444886 +fft0.2674 0.0707106814 +fft0.2681 -0.0130526191 +fft0.2688 -0.0866025388 +fft0.2695 -0.0923879519 +fft0.2702 -0.0258819051 +fft0.2709 0.0608761422 +fft0.2716 0.100000001 +fft0.2723 0.0608761422 +fft0.2730 -0.0258819051 +fft0.2737 -0.0923879519 +fft0.2744 -0.0866025388 +fft0.2751 -0.0130526191 +fft0.2758 0.0707106814 +fft0.2765 0.0991444886 +fft0.2772 0.0500000007 +fft0.2779 -0.0382683426 +fft0.2786 -0.0965925828 +fft0.2793 -0.0793353319 +fft0.2800 -6.64226161e-14 +fft0.2807 0.0793353319 +fft0.2814 0.0965925828 +fft0.2821 0.0382683426 +fft0.2828 -0.0500000007 +fft0.2835 -0.0991444886 +fft0.2842 -0.0707106814 +fft0.2849 0.0130526191 +fft0.2856 0.0866025388 +fft0.2863 0.0923879519 +fft0.2870 0.0258819051 +fft0.2877 -0.0608761422 +fft0.2884 -0.100000001 +fft0.2891 -0.0608761422 +fft0.2898 0.0258819051 +fft0.2905 0.0923879519 +fft0.2912 0.0866025388 +fft0.2919 0.0130526191 +fft0.2926 -0.0707106814 +fft0.2933 -0.0991444886 +fft0.2940 -0.0500000007 +fft0.2947 0.0382683426 +fft0.2954 0.0965925828 +fft0.2961 0.0793353319 +fft0.2968 1.71256188e-14 +fft0.2975 -0.0793353319 +fft0.2982 -0.0965925828 +fft0.2989 -0.0382683426 +fft0.2996 0.0500000007 +fft0.3003 0.0991444886 +fft0.3010 0.0707106814 +fft0.3017 -0.0130526191 +fft0.3024 -0.0866025388 +fft0.3031 -0.0923879519 +fft0.3038 -0.0258819051 +fft0.3045 0.0608761422 +fft0.3052 0.100000001 +fft0.3059 0.0608761422 +fft0.3066 -0.0258819051 +fft0.3073 -0.0923879519 +fft0.3080 -0.0866025388 +fft0.3087 -0.0130526191 +fft0.3094 0.0707106814 +fft0.3101 0.0991444886 +fft0.3108 0.0500000007 +fft0.3115 -0.0382683426 +fft0.3122 -0.0965925828 +fft0.3129 -0.0793353319 +fft0.3136 -3.31626518e-13 +fft0.3143 0.0793353319 +fft0.3150 0.0965925828 +fft0.3157 0.0382683426 +fft0.3164 -0.0500000007 +fft0.3171 -0.0991444886 +fft0.3178 -0.0707106814 +fft0.3185 0.0130526191 +fft0.3192 0.0866025388 +fft0.3199 0.0923879519 +fft0.3206 0.0258819051 +fft0.3213 -0.0608761422 +fft0.3220 -0.100000001 +fft0.3227 -0.0608761422 +fft0.3234 0.0258819051 +fft0.3241 0.0923879519 +fft0.3248 0.0866025388 +fft0.3255 0.0130526191 +fft0.3262 -0.0707106814 +fft0.3269 -0.0991444886 +fft0.3276 -0.0500000007 +fft0.3283 0.0382683426 +fft0.3290 0.0965925828 +fft0.3297 0.0793353319 +fft0.3304 2.82329498e-13 +fft0.3311 -0.0793353319 +fft0.3318 -0.0965925828 +fft0.3325 -0.0382683426 +fft0.3332 0.0500000007 +fft0.3339 0.0991444886 +fft0.3346 0.0707106814 +fft0.3353 -0.0130526191 +fft0.3360 -0.0866025388 +fft0.3367 -0.0923879519 +fft0.3374 -0.0258819051 +fft0.3381 0.0608761422 +fft0.3388 0.100000001 +fft0.3395 0.0608761422 +fft0.3402 -0.0258819051 +fft0.3409 -0.0923879519 +fft0.3416 -0.0866025388 +fft0.3423 -0.0130526191 +fft0.3430 0.0707106814 +fft0.3437 0.0991444886 +fft0.3444 0.0500000007 +fft0.3451 -0.0382683426 +fft0.3458 -0.0965925828 +fft0.3465 -0.0793353319 +fft0.3472 -2.33032506e-13 +fft0.3479 0.0793353319 +fft0.3486 0.0965925828 +fft0.3493 0.0382683426 +fft0.3500 -0.0500000007 +fft0.3507 -0.0991444886 +fft0.3514 -0.0707106814 +fft0.3521 0.0130526191 +fft0.3528 0.0866025388 +fft0.3535 0.0923879519 +fft0.3542 0.0258819051 +fft0.3549 -0.0608761422 +fft0.3556 -0.100000001 +fft0.3563 -0.0608761422 +fft0.3570 0.0258819051 +fft0.3577 0.0923879519 +fft0.3584 0.0866025388 +fft0.3591 0.0130526191 +fft0.3598 -0.0707106814 +fft0.3605 -0.0991444886 +fft0.3612 -0.0500000007 +fft0.3619 0.0382683426 +fft0.3626 0.0965925828 +fft0.3633 0.0793353319 +fft0.3640 1.83735514e-13 +fft0.3647 -0.0793353319 +fft0.3654 -0.0965925828 +fft0.3661 -0.0382683426 +fft0.3668 0.0500000007 +fft0.3675 0.0991444886 +fft0.3682 0.0707106814 +fft0.3689 -0.0130526191 +fft0.3696 -0.0866025388 +fft0.3703 -0.0923879519 +fft0.3710 -0.0258819051 +fft0.3717 0.0608761422 +fft0.3724 0.100000001 +fft0.3731 0.0608761422 +fft0.3738 -0.0258819051 +fft0.3745 -0.0923879519 +fft0.3752 -0.0866025388 +fft0.3759 -0.0130526191 +fft0.3766 0.0707106814 +fft0.3773 0.0991444886 +fft0.3780 0.0500000007 +fft0.3787 -0.0382683426 +fft0.3794 -0.0965925828 +fft0.3801 -0.0793353319 +fft0.3808 -1.34438522e-13 +fft0.3815 0.0793353319 +fft0.3822 0.0965925828 +fft0.3829 0.0382683426 +fft0.3836 -0.0500000007 +fft0.3843 -0.0991444886 +fft0.3850 -0.0707106814 +fft0.3857 0.0130526191 +fft0.3864 0.0866025388 +fft0.3871 0.0923879519 +fft0.3878 0.0258819051 +fft0.3885 -0.0608761422 +fft0.3892 -0.100000001 +fft0.3899 -0.0608761422 +fft0.3906 0.0258819051 +fft0.3913 0.0923879519 +fft0.3920 0.0866025388 +fft0.3927 0.0130526191 +fft0.3934 -0.0707106814 +fft0.3941 -0.0991444886 +fft0.3948 -0.0500000007 +fft0.3955 0.0382683426 +fft0.3962 0.0965925828 +fft0.3969 0.0793353319 +fft0.3976 8.51415292e-14 +fft0.3983 -0.0793353319 +fft0.3990 -0.0965925828 +fft0.3997 -0.0382683426 +fft0.4004 0.0500000007 +fft0.4011 0.0991444886 +fft0.4018 0.0707106814 +fft0.4025 -0.0130526191 +fft0.4032 -0.0866025388 +fft0.4039 -0.0923879519 +fft0.4046 -0.0258819051 +fft0.4053 0.0608761422 +fft0.4060 0.100000001 +fft0.4067 0.0608761422 +fft0.4074 -0.0258819051 +fft0.4081 -0.0923879519 +fft0.4088 -0.0866025388 +fft0.4095 -0.0130526191 +fft1.0 0 +fft1.7 0 +fft1.14 0 +fft1.21 0 +fft1.28 0 +fft1.35 0 +fft1.42 0 +fft1.49 0 +fft1.56 0 +fft1.63 0 +fft1.70 0 +fft1.77 0 +fft1.84 0 +fft1.91 0 +fft1.98 0 +fft1.105 0 +fft1.112 0 +fft1.119 0 +fft1.126 0 +fft1.133 0 +fft1.140 0 +fft1.147 0 +fft1.154 0 +fft1.161 0 +fft1.168 0 +fft1.175 0 +fft1.182 0 +fft1.189 0 +fft1.196 0 +fft1.203 0 +fft1.210 0 +fft1.217 0 +fft1.224 0 +fft1.231 0 +fft1.238 0 +fft1.245 0 +fft1.252 0 +fft1.259 0 +fft1.266 0 +fft1.273 0 +fft1.280 0 +fft1.287 0 +fft1.294 0 +fft1.301 0 +fft1.308 0 +fft1.315 0 +fft1.322 0 +fft1.329 0 +fft1.336 0 +fft1.343 0 +fft1.350 0 +fft1.357 0 +fft1.364 0 +fft1.371 0 +fft1.378 0 +fft1.385 0 +fft1.392 0 +fft1.399 0 +fft1.406 0 +fft1.413 0 +fft1.420 0 +fft1.427 0 +fft1.434 0 +fft1.441 0 +fft1.448 0 +fft1.455 0 +fft1.462 0 +fft1.469 0 +fft1.476 0 +fft1.483 0 +fft1.490 0 +fft1.497 0 +fft1.504 0 +fft1.511 0 +fft1.518 0 +fft1.525 0 +fft1.532 0 +fft1.539 0 +fft1.546 0 +fft1.553 0 +fft1.560 0 +fft1.567 0 +fft1.574 0 +fft1.581 0 +fft1.588 0 +fft1.595 0 +fft1.602 0 +fft1.609 0 +fft1.616 0 +fft1.623 0 +fft1.630 0 +fft1.637 0 +fft1.644 0 +fft1.651 0 +fft1.658 0 +fft1.665 0 +fft1.672 0 +fft1.679 0 +fft1.686 0 +fft1.693 0 +fft1.700 0 +fft1.707 0 +fft1.714 0 +fft1.721 0 +fft1.728 0 +fft1.735 0 +fft1.742 0 +fft1.749 0 +fft1.756 0 +fft1.763 0 +fft1.770 0 +fft1.777 0 +fft1.784 0 +fft1.791 0 +fft1.798 0 +fft1.805 0 +fft1.812 0 +fft1.819 0 +fft1.826 0 +fft1.833 0 +fft1.840 0 +fft1.847 0 +fft1.854 0 +fft1.861 0 +fft1.868 0 +fft1.875 0 +fft1.882 0 +fft1.889 0 +fft1.896 0 +fft1.903 0 +fft1.910 0 +fft1.917 0 +fft1.924 0 +fft1.931 0 +fft1.938 0 +fft1.945 0 +fft1.952 0 +fft1.959 0 +fft1.966 0 +fft1.973 0 +fft1.980 0 +fft1.987 0 +fft1.994 0 +fft1.1001 0 +fft1.1008 0 +fft1.1015 0 +fft1.1022 0 +fft1.1029 0 +fft1.1036 0 +fft1.1043 0 +fft1.1050 0 +fft1.1057 0 +fft1.1064 0 +fft1.1071 0 +fft1.1078 0 +fft1.1085 0 +fft1.1092 0 +fft1.1099 0 +fft1.1106 0 +fft1.1113 0 +fft1.1120 0 +fft1.1127 0 +fft1.1134 0 +fft1.1141 0 +fft1.1148 0 +fft1.1155 0 +fft1.1162 0 +fft1.1169 0 +fft1.1176 0 +fft1.1183 0 +fft1.1190 0 +fft1.1197 0 +fft1.1204 0 +fft1.1211 0 +fft1.1218 0 +fft1.1225 0 +fft1.1232 0 +fft1.1239 0 +fft1.1246 0 +fft1.1253 0 +fft1.1260 0 +fft1.1267 0 +fft1.1274 0 +fft1.1281 0 +fft1.1288 0 +fft1.1295 0 +fft1.1302 0 +fft1.1309 0 +fft1.1316 0 +fft1.1323 0 +fft1.1330 0 +fft1.1337 0 +fft1.1344 0 +fft1.1351 0 +fft1.1358 0 +fft1.1365 0 +fft1.1372 0 +fft1.1379 0 +fft1.1386 0 +fft1.1393 0 +fft1.1400 0 +fft1.1407 0 +fft1.1414 0 +fft1.1421 0 +fft1.1428 0 +fft1.1435 0 +fft1.1442 0 +fft1.1449 0 +fft1.1456 0 +fft1.1463 0 +fft1.1470 0 +fft1.1477 0 +fft1.1484 0 +fft1.1491 0 +fft1.1498 0 +fft1.1505 0 +fft1.1512 0 +fft1.1519 0 +fft1.1526 0 +fft1.1533 0 +fft1.1540 0 +fft1.1547 0 +fft1.1554 0 +fft1.1561 0 +fft1.1568 0 +fft1.1575 0 +fft1.1582 0 +fft1.1589 0 +fft1.1596 0 +fft1.1603 0 +fft1.1610 0 +fft1.1617 0 +fft1.1624 0 +fft1.1631 0 +fft1.1638 0 +fft1.1645 0 +fft1.1652 0 +fft1.1659 0 +fft1.1666 0 +fft1.1673 0 +fft1.1680 0 +fft1.1687 0 +fft1.1694 0 +fft1.1701 0 +fft1.1708 0 +fft1.1715 0 +fft1.1722 0 +fft1.1729 0 +fft1.1736 0 +fft1.1743 0 +fft1.1750 0 +fft1.1757 0 +fft1.1764 0 +fft1.1771 0 +fft1.1778 0 +fft1.1785 0 +fft1.1792 0 +fft1.1799 0 +fft1.1806 0 +fft1.1813 0 +fft1.1820 0 +fft1.1827 0 +fft1.1834 0 +fft1.1841 0 +fft1.1848 0 +fft1.1855 0 +fft1.1862 0 +fft1.1869 0 +fft1.1876 0 +fft1.1883 0 +fft1.1890 0 +fft1.1897 0 +fft1.1904 0 +fft1.1911 0 +fft1.1918 0 +fft1.1925 0 +fft1.1932 0 +fft1.1939 0 +fft1.1946 0 +fft1.1953 0 +fft1.1960 0 +fft1.1967 0 +fft1.1974 0 +fft1.1981 0 +fft1.1988 0 +fft1.1995 0 +fft1.2002 0 +fft1.2009 0 +fft1.2016 0 +fft1.2023 0 +fft1.2030 0 +fft1.2037 0 +fft1.2044 0 +fft1.2051 0 +fft1.2058 0 +fft1.2065 0 +fft1.2072 0 +fft1.2079 0 +fft1.2086 0 +fft1.2093 0 +fft1.2100 0 +fft1.2107 0 +fft1.2114 0 +fft1.2121 0 +fft1.2128 0 +fft1.2135 0 +fft1.2142 0 +fft1.2149 0 +fft1.2156 0 +fft1.2163 0 +fft1.2170 0 +fft1.2177 0 +fft1.2184 0 +fft1.2191 0 +fft1.2198 0 +fft1.2205 0 +fft1.2212 0 +fft1.2219 0 +fft1.2226 0 +fft1.2233 0 +fft1.2240 0 +fft1.2247 0 +fft1.2254 0 +fft1.2261 0 +fft1.2268 0 +fft1.2275 0 +fft1.2282 0 +fft1.2289 0 +fft1.2296 0 +fft1.2303 0 +fft1.2310 0 +fft1.2317 0 +fft1.2324 0 +fft1.2331 0 +fft1.2338 0 +fft1.2345 0 +fft1.2352 0 +fft1.2359 0 +fft1.2366 0 +fft1.2373 0 +fft1.2380 0 +fft1.2387 0 +fft1.2394 0 +fft1.2401 0 +fft1.2408 0 +fft1.2415 0 +fft1.2422 0 +fft1.2429 0 +fft1.2436 0 +fft1.2443 0 +fft1.2450 0 +fft1.2457 0 +fft1.2464 0 +fft1.2471 0 +fft1.2478 0 +fft1.2485 0 +fft1.2492 0 +fft1.2499 0 +fft1.2506 0 +fft1.2513 0 +fft1.2520 0 +fft1.2527 0 +fft1.2534 0 +fft1.2541 0 +fft1.2548 0 +fft1.2555 0 +fft1.2562 0 +fft1.2569 0 +fft1.2576 0 +fft1.2583 0 +fft1.2590 0 +fft1.2597 0 +fft1.2604 0 +fft1.2611 0 +fft1.2618 0 +fft1.2625 0 +fft1.2632 0 +fft1.2639 0 +fft1.2646 0 +fft1.2653 0 +fft1.2660 0 +fft1.2667 0 +fft1.2674 0 +fft1.2681 0 +fft1.2688 0 +fft1.2695 0 +fft1.2702 0 +fft1.2709 0 +fft1.2716 0 +fft1.2723 0 +fft1.2730 0 +fft1.2737 0 +fft1.2744 0 +fft1.2751 0 +fft1.2758 0 +fft1.2765 0 +fft1.2772 0 +fft1.2779 0 +fft1.2786 0 +fft1.2793 0 +fft1.2800 0 +fft1.2807 0 +fft1.2814 0 +fft1.2821 0 +fft1.2828 0 +fft1.2835 0 +fft1.2842 0 +fft1.2849 0 +fft1.2856 0 +fft1.2863 0 +fft1.2870 0 +fft1.2877 0 +fft1.2884 0 +fft1.2891 0 +fft1.2898 0 +fft1.2905 0 +fft1.2912 0 +fft1.2919 0 +fft1.2926 0 +fft1.2933 0 +fft1.2940 0 +fft1.2947 0 +fft1.2954 0 +fft1.2961 0 +fft1.2968 0 +fft1.2975 0 +fft1.2982 0 +fft1.2989 0 +fft1.2996 0 +fft1.3003 0 +fft1.3010 0 +fft1.3017 0 +fft1.3024 0 +fft1.3031 0 +fft1.3038 0 +fft1.3045 0 +fft1.3052 0 +fft1.3059 0 +fft1.3066 0 +fft1.3073 0 +fft1.3080 0 +fft1.3087 0 +fft1.3094 0 +fft1.3101 0 +fft1.3108 0 +fft1.3115 0 +fft1.3122 0 +fft1.3129 0 +fft1.3136 0 +fft1.3143 0 +fft1.3150 0 +fft1.3157 0 +fft1.3164 0 +fft1.3171 0 +fft1.3178 0 +fft1.3185 0 +fft1.3192 0 +fft1.3199 0 +fft1.3206 0 +fft1.3213 0 +fft1.3220 0 +fft1.3227 0 +fft1.3234 0 +fft1.3241 0 +fft1.3248 0 +fft1.3255 0 +fft1.3262 0 +fft1.3269 0 +fft1.3276 0 +fft1.3283 0 +fft1.3290 0 +fft1.3297 0 +fft1.3304 0 +fft1.3311 0 +fft1.3318 0 +fft1.3325 0 +fft1.3332 0 +fft1.3339 0 +fft1.3346 0 +fft1.3353 0 +fft1.3360 0 +fft1.3367 0 +fft1.3374 0 +fft1.3381 0 +fft1.3388 0 +fft1.3395 0 +fft1.3402 0 +fft1.3409 0 +fft1.3416 0 +fft1.3423 0 +fft1.3430 0 +fft1.3437 0 +fft1.3444 0 +fft1.3451 0 +fft1.3458 0 +fft1.3465 0 +fft1.3472 0 +fft1.3479 0 +fft1.3486 0 +fft1.3493 0 +fft1.3500 0 +fft1.3507 0 +fft1.3514 0 +fft1.3521 0 +fft1.3528 0 +fft1.3535 0 +fft1.3542 0 +fft1.3549 0 +fft1.3556 0 +fft1.3563 0 +fft1.3570 0 +fft1.3577 0 +fft1.3584 0 +fft1.3591 0 +fft1.3598 0 +fft1.3605 0 +fft1.3612 0 +fft1.3619 0 +fft1.3626 0 +fft1.3633 0 +fft1.3640 0 +fft1.3647 0 +fft1.3654 0 +fft1.3661 0 +fft1.3668 0 +fft1.3675 0 +fft1.3682 0 +fft1.3689 0 +fft1.3696 0 +fft1.3703 0 +fft1.3710 0 +fft1.3717 0 +fft1.3724 0 +fft1.3731 0 +fft1.3738 0 +fft1.3745 0 +fft1.3752 0 +fft1.3759 0 +fft1.3766 0 +fft1.3773 0 +fft1.3780 0 +fft1.3787 0 +fft1.3794 0 +fft1.3801 0 +fft1.3808 0 +fft1.3815 0 +fft1.3822 0 +fft1.3829 0 +fft1.3836 0 +fft1.3843 0 +fft1.3850 0 +fft1.3857 0 +fft1.3864 0 +fft1.3871 0 +fft1.3878 0 +fft1.3885 0 +fft1.3892 0 +fft1.3899 0 +fft1.3906 0 +fft1.3913 0 +fft1.3920 0 +fft1.3927 0 +fft1.3934 0 +fft1.3941 0 +fft1.3948 0 +fft1.3955 0 +fft1.3962 0 +fft1.3969 0 +fft1.3976 0 +fft1.3983 0 +fft1.3990 0 +fft1.3997 0 +fft1.4004 0 +fft1.4011 0 +fft1.4018 0 +fft1.4025 0 +fft1.4032 0 +fft1.4039 0 +fft1.4046 0 +fft1.4053 0 +fft1.4060 0 +fft1.4067 0 +fft1.4074 0 +fft1.4081 0 +fft1.4088 0 +fft1.4095 0 +sessionPeakDBC 106.986877 +noiseDose 0.817020595 diff --git a/Tests/golden/quad_silent_impulses.txt b/Tests/golden/quad_silent_impulses.txt new file mode 100644 index 0000000..d9ecfa0 --- /dev/null +++ b/Tests/golden/quad_silent_impulses.txt @@ -0,0 +1,2404 @@ +# SPLMeter processor golden output: quad_silent_impulses +blk9.peakSPL -999 +blk9.peakDBA -999 +blk9.peakDBC -999 +blk9.rmsSPL -999 +blk9.rmsDBA -999 +blk9.rmsDBC -999 +blk9.rough 0 +blk9.sharp 0.769288719 +blk9.fluct 0 +blk9.impuls 24.4081154 +blk9.tonal 59.3514252 +blk19.peakSPL 116.676651 +blk19.peakDBA 111.45639 +blk19.peakDBC 133.158508 +blk19.rmsSPL 90.4442444 +blk19.rmsDBA 86.2707062 +blk19.rmsDBC 101.929375 +blk19.rough 22.496336 +blk19.sharp 0.783458889 +blk19.fluct 0 +blk19.impuls 23.0651741 +blk19.tonal 58.7791634 +blk29.peakSPL 116.676651 +blk29.peakDBA 111.489624 +blk29.peakDBC 133.170715 +blk29.rmsSPL 91.7446899 +blk29.rmsDBA 87.5884247 +blk29.rmsDBC 102.599426 +blk29.rough 22.496336 +blk29.sharp 0.78807193 +blk29.fluct 0 +blk29.impuls 22.4500389 +blk29.tonal 57.5039139 +blk39.peakSPL 116.708641 +blk39.peakDBA 111.489624 +blk39.peakDBC 133.356903 +blk39.rmsSPL 92.164772 +blk39.rmsDBA 87.9958649 +blk39.rmsDBC 102.715744 +blk39.rough 16.7796135 +blk39.sharp 0.812423885 +blk39.fluct 0 +blk39.impuls 22.3131638 +blk39.tonal 57.8425026 +blk49.peakSPL 116.708641 +blk49.peakDBA 111.489624 +blk49.peakDBC 133.356903 +blk49.rmsSPL 92.3222656 +blk49.rmsDBA 88.1490631 +blk49.rmsDBC 102.5681 +blk49.rough 16.7796135 +blk49.sharp 0.766449928 +blk49.fluct 0 +blk49.impuls 22.1099815 +blk49.tonal 58.0927086 +blk59.peakSPL 116.708641 +blk59.peakDBA 111.489624 +blk59.peakDBC 133.356903 +blk59.rmsSPL 92.3222656 +blk59.rmsDBA 88.1490631 +blk59.rmsDBC 102.5681 +blk59.rough 16.4423008 +blk59.sharp 0.788481474 +blk59.fluct 0 +blk59.impuls 21.9327278 +blk59.tonal 58.2500076 +blk69.peakSPL 116.722519 +blk69.peakDBA 111.489624 +blk69.peakDBC 133.356903 +blk69.rmsSPL 92.3884125 +blk69.rmsDBA 88.2410431 +blk69.rmsDBC 103.492332 +blk69.rough 16.4423008 +blk69.sharp 0.826996744 +blk69.fluct 0 +blk69.impuls 22.1799049 +blk69.tonal 57.655159 +blk79.peakSPL 116.722519 +blk79.peakDBA 111.489624 +blk79.peakDBC 133.356903 +blk79.rmsSPL 92.3946762 +blk79.rmsDBA 88.2281723 +blk79.rmsDBC 103.249908 +blk79.rough 16.5513477 +blk79.sharp 0.812689304 +blk79.fluct 0 +blk79.impuls 22.0979233 +blk79.tonal 57.0562859 +blk89.peakSPL 116.722519 +blk89.peakDBA 111.489624 +blk89.peakDBC 133.356903 +blk89.rmsSPL 92.3690948 +blk89.rmsDBA 88.1886978 +blk89.rmsDBC 102.95974 +blk89.rough 16.5513477 +blk89.sharp 0.817818999 +blk89.fluct 0 +blk89.impuls 21.9202919 +blk89.tonal 57.6656265 +blk99.peakSPL 116.722519 +blk99.peakDBA 111.489624 +blk99.peakDBC 133.418411 +blk99.rmsSPL 92.3874283 +blk99.rmsDBA 88.1942978 +blk99.rmsDBC 102.761436 +blk99.rough 16.6408024 +blk99.sharp 0.803359985 +blk99.fluct 41.6153793 +blk99.impuls 21.9385738 +blk99.tonal 56.9868736 +blk109.peakSPL 116.722519 +blk109.peakDBA 111.489624 +blk109.peakDBC 133.418411 +blk109.rmsSPL 92.3874283 +blk109.rmsDBA 88.1942978 +blk109.rmsDBC 102.761436 +blk109.rough 16.6408024 +blk109.sharp 0.796357691 +blk109.fluct 41.6153793 +blk109.impuls 22.1763248 +blk109.tonal 57.7371254 +blk119.peakSPL 116.727982 +blk119.peakDBA 111.489624 +blk119.peakDBC 133.418411 +blk119.rmsSPL 92.3835297 +blk119.rmsDBA 88.2247009 +blk119.rmsDBC 103.542435 +blk119.rough 16.2515163 +blk119.sharp 0.767771363 +blk119.fluct 41.6153793 +blk119.impuls 21.8799496 +blk119.tonal 58.4968224 +blk129.peakSPL 116.727982 +blk129.peakDBA 111.489624 +blk129.peakDBC 133.418411 +blk129.rmsSPL 92.4104919 +blk129.rmsDBA 88.2449417 +blk129.rmsDBC 103.23159 +blk129.rough 16.2515163 +blk129.sharp 0.787817121 +blk129.fluct 41.6153793 +blk129.impuls 21.8971558 +blk129.tonal 57.8241844 +blk139.peakSPL 116.727982 +blk139.peakDBA 111.489624 +blk139.peakDBC 133.418411 +blk139.rmsSPL 92.3674469 +blk139.rmsDBA 88.1707306 +blk139.rmsDBC 102.940765 +blk139.rough 16.7096519 +blk139.sharp 0.780374229 +blk139.fluct 41.6153793 +blk139.impuls 21.8467808 +blk139.tonal 58.0643654 +blk149.peakSPL 116.727982 +blk149.peakDBA 111.489624 +blk149.peakDBC 133.429916 +blk149.rmsSPL 92.3858261 +blk149.rmsDBA 88.1829987 +blk149.rmsDBC 102.776764 +blk149.rough 16.7096519 +blk149.sharp 0.785311341 +blk149.fluct 41.6153793 +blk149.impuls 22.0688534 +blk149.tonal 59.2431679 +blk159.peakSPL 116.727982 +blk159.peakDBA 111.489624 +blk159.peakDBC 133.429916 +blk159.rmsSPL 92.3858261 +blk159.rmsDBA 88.1829987 +blk159.rmsDBC 102.776764 +blk159.rough 16.4004536 +blk159.sharp 0.770800769 +blk159.fluct 41.6153793 +blk159.impuls 21.9708233 +blk159.tonal 59.5416183 +blk169.peakSPL 116.727982 +blk169.peakDBA 111.489624 +blk169.peakDBC 133.429916 +blk169.rmsSPL 92.3578033 +blk169.rmsDBA 88.1880951 +blk169.rmsDBC 103.526245 +blk169.rough 16.4004536 +blk169.sharp 0.80722785 +blk169.fluct 41.6153793 +blk169.impuls 21.8535252 +blk169.tonal 56.7269974 +blk179.peakSPL 116.727982 +blk179.peakDBA 111.489624 +blk179.peakDBC 133.429916 +blk179.rmsSPL 92.3532333 +blk179.rmsDBA 88.181366 +blk179.rmsDBC 103.210411 +blk179.rough 16.7999954 +blk179.sharp 0.788031638 +blk179.fluct 41.6153793 +blk179.impuls 22.0081768 +blk179.tonal 57.6577339 +blk189.peakSPL 116.727982 +blk189.peakDBA 111.489624 +blk189.peakDBC 133.429916 +blk189.rmsSPL 92.3374405 +blk189.rmsDBA 88.1746216 +blk189.rmsDBC 102.933304 +blk189.rough 16.7999954 +blk189.sharp 0.810176909 +blk189.fluct 41.6153793 +blk189.impuls 22.1610813 +blk189.tonal 57.735424 +blk199.peakSPL 116.727982 +blk199.peakDBA 111.489624 +blk199.peakDBC 133.429916 +blk199.rmsSPL 92.3746948 +blk199.rmsDBA 88.196846 +blk199.rmsDBC 102.785263 +blk199.rough 16.5756989 +blk199.sharp 0.81011945 +blk199.fluct 6.14215708 +blk199.impuls 21.9312992 +blk199.tonal 56.8622551 +blk209.peakSPL 116.727982 +blk209.peakDBA 111.489624 +blk209.peakDBC 133.429916 +blk209.rmsSPL 92.3746948 +blk209.rmsDBA 88.196846 +blk209.rmsDBC 102.785263 +blk209.rough 16.5756989 +blk209.sharp 0.785986066 +blk209.fluct 6.14215708 +blk209.impuls 21.8877239 +blk209.tonal 58.6167831 +blk219.peakSPL 116.727982 +blk219.peakDBA 111.489624 +blk219.peakDBC 133.429916 +blk219.rmsSPL 92.4027023 +blk219.rmsDBA 88.2326431 +blk219.rmsDBC 103.582535 +blk219.rough 16.6030426 +blk219.sharp 0.801878691 +blk219.fluct 6.14215708 +blk219.impuls 22.0357685 +blk219.tonal 57.7978859 +blk229.peakSPL 116.727982 +blk229.peakDBA 109.406296 +blk229.peakDBC 133.429916 +blk229.rmsSPL 92.3501892 +blk229.rmsDBA 88.1889191 +blk229.rmsDBC 103.178238 +blk229.rough 16.6030426 +blk229.sharp 0.786502004 +blk229.fluct 6.14215708 +blk229.impuls 21.9097824 +blk229.tonal 57.5396919 +blk239.peakSPL 116.727982 +blk239.peakDBA 111.1744 +blk239.peakDBC 133.469437 +blk239.rmsSPL 92.3560333 +blk239.rmsDBA 88.1706772 +blk239.rmsDBC 102.978493 +blk239.rough 16.5539074 +blk239.sharp 0.8177163 +blk239.fluct 6.14215708 +blk239.impuls 22.0567894 +blk239.tonal 58.3250504 +blk249.peakSPL 116.727982 +blk249.peakDBA 111.1744 +blk249.peakDBC 133.596954 +blk249.rmsSPL 92.350647 +blk249.rmsDBA 88.1573257 +blk249.rmsDBC 102.764534 +blk249.rough 16.5539074 +blk249.sharp 0.832680762 +blk249.fluct 6.14215708 +blk249.impuls 22.2057362 +blk249.tonal 56.8310661 +blk259.peakSPL 116.727982 +blk259.peakDBA 111.1744 +blk259.peakDBC 133.596954 +blk259.rmsSPL 92.350647 +blk259.rmsDBA 88.1573257 +blk259.rmsDBC 102.764534 +blk259.rough 16.5552998 +blk259.sharp 0.79201144 +blk259.fluct 6.14215708 +blk259.impuls 22.0827599 +blk259.tonal 57.7003403 +blk269.peakSPL 116.727982 +blk269.peakDBA 111.409439 +blk269.peakDBC 133.596954 +blk269.rmsSPL 92.3907013 +blk269.rmsDBA 88.2318878 +blk269.rmsDBC 103.591644 +blk269.rough 16.5552998 +blk269.sharp 0.813010991 +blk269.fluct 6.14215708 +blk269.impuls 22.1223068 +blk269.tonal 57.8491631 +blk279.peakSPL 116.727982 +blk279.peakDBA 111.409439 +blk279.peakDBC 133.596954 +blk279.rmsSPL 92.3510437 +blk279.rmsDBA 88.1683655 +blk279.rmsDBC 103.220451 +blk279.rough 16.3163624 +blk279.sharp 0.791444123 +blk279.fluct 6.14215708 +blk279.impuls 21.8211384 +blk279.tonal 57.604763 +blk289.peakSPL 116.727982 +blk289.peakDBA 111.409439 +blk289.peakDBC 133.596954 +blk289.rmsSPL 92.3664703 +blk289.rmsDBA 88.1965103 +blk289.rmsDBC 102.962769 +blk289.rough 16.3163624 +blk289.sharp 0.794244528 +blk289.fluct 6.14215708 +blk289.impuls 22.1218491 +blk289.tonal 57.731781 +blk299.peakSPL 116.727982 +blk299.peakDBA 111.409439 +blk299.peakDBC 133.596954 +blk299.rmsSPL 92.3654022 +blk299.rmsDBA 88.1867981 +blk299.rmsDBC 102.7024 +blk299.rough 16.5616302 +blk299.sharp 0.816687763 +blk299.fluct 5.768363 +blk299.impuls 22.1540089 +blk299.tonal 58.5050354 +log.count 24 +log0.peakSPL 116.676651 +log0.peakDBA 111.45639 +log0.peakDBC 133.158508 +log0.rmsSPL 90.4442444 +log0.rmsDBA 86.2707062 +log0.rmsDBC 101.929375 +log0.rough 0 +log0.fluct 0 +log0.sharp 1.06241131 +log0.sone 24.7108097 +log0.impuls 25.6899834 +log0.tonal 47.909771 +log0.annoy 24.7108097 +log1.peakSPL 116.676651 +log1.peakDBA 111.489624 +log1.peakDBC 133.170715 +log1.rmsSPL 91.7446899 +log1.rmsDBA 87.5884247 +log1.rmsDBC 102.599426 +log1.rough 22.496336 +log1.fluct 0 +log1.sharp 0.87580353 +log1.sone 27.0741196 +log1.impuls 23.7721386 +log1.tonal 54.3929291 +log1.annoy 36.6827583 +log2.peakSPL 116.708641 +log2.peakDBA 111.489624 +log2.peakDBC 133.356903 +log2.rmsSPL 92.164772 +log2.rmsDBA 87.9958649 +log2.rmsDBC 102.715744 +log2.rough 22.496336 +log2.fluct 0 +log2.sharp 0.789618134 +log2.sone 27.8496304 +log2.impuls 22.9157143 +log2.tonal 58.5528297 +log2.annoy 37.845787 +log3.peakSPL 116.708641 +log3.peakDBA 111.489624 +log3.peakDBC 133.356903 +log3.rmsSPL 92.3222656 +log3.rmsDBA 88.1490631 +log3.rmsDBC 102.5681 +log3.rough 16.7796135 +log3.fluct 0 +log3.sharp 0.766449928 +log3.sone 28.1469383 +log3.impuls 22.1099815 +log3.tonal 58.0927086 +log3.annoy 36.9093704 +log4.peakSPL 116.722519 +log4.peakDBA 111.489624 +log4.peakDBC 133.356903 +log4.rmsSPL 92.3884125 +log4.rmsDBA 88.2410431 +log4.rmsDBC 103.492332 +log4.rough 16.4423008 +log4.fluct 0 +log4.sharp 1.11453462 +log4.sone 28.3269691 +log4.impuls 23.7916851 +log4.tonal 46.3992386 +log4.annoy 37.0786476 +log5.peakSPL 116.722519 +log5.peakDBA 111.489624 +log5.peakDBC 133.356903 +log5.rmsSPL 92.3946762 +log5.rmsDBA 88.2281723 +log5.rmsDBC 103.249908 +log5.rough 16.4423008 +log5.fluct 0 +log5.sharp 0.888485909 +log5.sone 28.3017101 +log5.impuls 23.1769943 +log5.tonal 54.5961113 +log5.annoy 37.0424652 +log6.peakSPL 116.722519 +log6.peakDBA 111.489624 +log6.peakDBC 133.356903 +log6.rmsSPL 92.3690948 +log6.rmsDBA 88.1886978 +log6.rmsDBC 102.95974 +log6.rough 16.5513477 +log6.fluct 0 +log6.sharp 0.816742301 +log6.sone 28.2243729 +log6.impuls 22.4802094 +log6.tonal 56.8528175 +log6.annoy 36.960537 +log7.peakSPL 116.722519 +log7.peakDBA 111.489624 +log7.peakDBC 133.418411 +log7.rmsSPL 92.3874283 +log7.rmsDBA 88.1942978 +log7.rmsDBC 102.761436 +log7.rough 16.6408024 +log7.fluct 41.6153793 +log7.sharp 0.803359985 +log7.sone 28.2353363 +log7.impuls 21.9385738 +log7.tonal 56.9868736 +log7.annoy 41.8508835 +log8.peakSPL 116.727982 +log8.peakDBA 111.489624 +log8.peakDBC 133.418411 +log8.rmsSPL 92.3835297 +log8.rmsDBA 88.2247009 +log8.rmsDBC 103.542435 +log8.rough 16.6408024 +log8.fluct 41.6153793 +log8.sharp 1.05090559 +log8.sone 28.2949009 +log8.impuls 23.5609379 +log8.tonal 46.8593521 +log8.annoy 41.950676 +log9.peakSPL 116.727982 +log9.peakDBA 111.489624 +log9.peakDBC 133.418411 +log9.rmsSPL 92.4104919 +log9.rmsDBA 88.2449417 +log9.rmsDBC 103.23159 +log9.rough 16.2515163 +log9.fluct 41.6153793 +log9.sharp 0.881686032 +log9.sone 28.3346291 +log9.impuls 22.9460869 +log9.tonal 54.5039024 +log9.annoy 41.9136238 +log10.peakSPL 116.727982 +log10.peakDBA 111.489624 +log10.peakDBC 133.418411 +log10.rmsSPL 92.3674469 +log10.rmsDBA 88.1707306 +log10.rmsDBC 102.940765 +log10.rough 16.2515163 +log10.fluct 41.6153793 +log10.sharp 0.810462713 +log10.sone 28.1892433 +log10.impuls 22.3770695 +log10.tonal 58.6523323 +log10.annoy 41.6707954 +log11.peakSPL 116.727982 +log11.peakDBA 111.489624 +log11.peakDBC 133.429916 +log11.rmsSPL 92.3858261 +log11.rmsDBA 88.1829987 +log11.rmsDBC 102.776764 +log11.rough 16.7096519 +log11.fluct 41.6153793 +log11.sharp 0.785311341 +log11.sone 28.2132263 +log11.impuls 22.0688534 +log11.tonal 59.2431679 +log11.annoy 41.8319435 +log12.peakSPL 116.727982 +log12.peakDBA 111.489624 +log12.peakDBC 133.429916 +log12.rmsSPL 92.3578033 +log12.rmsDBA 88.1880951 +log12.rmsDBC 103.526245 +log12.rough 16.4004536 +log12.fluct 41.6153793 +log12.sharp 1.04235685 +log12.sone 28.223196 +log12.impuls 23.4956169 +log12.tonal 47.4876556 +log12.annoy 41.7670593 +log13.peakSPL 116.727982 +log13.peakDBA 111.489624 +log13.peakDBC 133.429916 +log13.rmsSPL 92.3532333 +log13.rmsDBA 88.181366 +log13.rmsDBC 103.210411 +log13.rough 16.4004536 +log13.fluct 41.6153793 +log13.sharp 0.879327893 +log13.sone 28.2100372 +log13.impuls 23.0792599 +log13.tonal 55.0525665 +log13.annoy 41.74506 +log14.peakSPL 116.727982 +log14.peakDBA 111.489624 +log14.peakDBC 133.429916 +log14.rmsSPL 92.3374405 +log14.rmsDBA 88.1746216 +log14.rmsDBC 102.933304 +log14.rough 16.7999954 +log14.fluct 41.6153793 +log14.sharp 0.848038614 +log14.sone 28.1968479 +log14.impuls 22.7211895 +log14.tonal 55.5875626 +log14.annoy 41.8281631 +log15.peakSPL 116.727982 +log15.peakDBA 111.489624 +log15.peakDBC 133.429916 +log15.rmsSPL 92.3746948 +log15.rmsDBA 88.196846 +log15.rmsDBC 102.785263 +log15.rough 16.5756989 +log15.fluct 6.14215708 +log15.sharp 0.81011945 +log15.sone 28.2403202 +log15.impuls 21.9312992 +log15.tonal 56.8622551 +log15.annoy 38.8539505 +log16.peakSPL 116.727982 +log16.peakDBA 111.489624 +log16.peakDBC 133.429916 +log16.rmsSPL 92.4027023 +log16.rmsDBA 88.2326431 +log16.rmsDBC 103.582535 +log16.rough 16.5756989 +log16.fluct 6.14215708 +log16.sharp 1.08070886 +log16.sone 28.3104763 +log16.impuls 23.6363106 +log16.tonal 46.8599358 +log16.annoy 38.9610367 +log17.peakSPL 116.727982 +log17.peakDBA 109.406296 +log17.peakDBC 133.429916 +log17.rmsSPL 92.3501892 +log17.rmsDBA 88.1889191 +log17.rmsDBC 103.178238 +log17.rough 16.6030426 +log17.fluct 6.14215708 +log17.sharp 0.883371592 +log17.sone 28.2248116 +log17.impuls 22.9964428 +log17.tonal 53.583519 +log17.annoy 38.8374939 +log18.peakSPL 116.727982 +log18.peakDBA 111.1744 +log18.peakDBC 133.469437 +log18.rmsSPL 92.3560333 +log18.rmsDBA 88.1706772 +log18.rmsDBC 102.978493 +log18.rough 16.6030426 +log18.fluct 6.14215708 +log18.sharp 0.823398948 +log18.sone 28.1891403 +log18.impuls 22.5999298 +log18.tonal 57.5183182 +log18.annoy 38.7830505 +log19.peakSPL 116.727982 +log19.peakDBA 111.1744 +log19.peakDBC 133.596954 +log19.rmsSPL 92.350647 +log19.rmsDBA 88.1573257 +log19.rmsDBC 102.764534 +log19.rough 16.5539074 +log19.fluct 6.14215708 +log19.sharp 0.832680762 +log19.sone 28.163065 +log19.impuls 22.2057362 +log19.tonal 56.8310661 +log19.annoy 38.7303391 +log20.peakSPL 116.727982 +log20.peakDBA 111.409439 +log20.peakDBC 133.596954 +log20.rmsSPL 92.3907013 +log20.rmsDBA 88.2318878 +log20.rmsDBC 103.591644 +log20.rough 16.5552998 +log20.fluct 6.14215708 +log20.sharp 1.11669886 +log20.sone 28.3089981 +log20.impuls 23.7087402 +log20.tonal 46.0440369 +log20.annoy 38.9533806 +log21.peakSPL 116.727982 +log21.peakDBA 111.409439 +log21.peakDBC 133.596954 +log21.rmsSPL 92.3510437 +log21.rmsDBA 88.1683655 +log21.rmsDBC 103.220451 +log21.rough 16.5552998 +log21.fluct 6.14215708 +log21.sharp 0.848850369 +log21.sone 28.1846237 +log21.impuls 22.9162254 +log21.tonal 55.2498398 +log21.annoy 38.7635918 +log22.peakSPL 116.727982 +log22.peakDBA 111.409439 +log22.peakDBC 133.596954 +log22.rmsSPL 92.3664703 +log22.rmsDBA 88.1965103 +log22.rmsDBC 102.962769 +log22.rough 16.3163624 +log22.fluct 6.14215708 +log22.sharp 0.824972451 +log22.sone 28.239666 +log22.impuls 22.6452026 +log22.tonal 56.1491623 +log22.annoy 38.7842407 +log23.peakSPL 116.727982 +log23.peakDBA 111.409439 +log23.peakDBC 133.596954 +log23.rmsSPL 92.3654022 +log23.rmsDBA 88.1867981 +log23.rmsDBC 102.7024 +log23.rough 16.5616302 +log23.fluct 5.768363 +log23.sharp 0.816687763 +log23.sone 28.2206593 +log23.impuls 22.1540089 +log23.tonal 58.5050354 +log23.annoy 38.7626801 +fft-1.0 0.00258461107 +fft-1.7 0.000406101579 +fft-1.14 -0.0132760191 +fft-1.21 -0.021452941 +fft-1.28 -0.0334947556 +fft-1.35 -0.0181820635 +fft-1.42 -0.0129094319 +fft-1.49 -0.0194467008 +fft-1.56 -0.0131715778 +fft-1.63 0.00235417509 +fft-1.70 0.00997313112 +fft-1.77 0.0191253815 +fft-1.84 0.0223276131 +fft-1.91 0.0215462372 +fft-1.98 0.0228091925 +fft-1.105 0.0222979356 +fft-1.112 0.0115817562 +fft-1.119 -0.0166494623 +fft-1.126 -0.0232842285 +fft-1.133 -0.028927153 +fft-1.140 -0.024882704 +fft-1.147 -0.0140650719 +fft-1.154 -0.02638066 +fft-1.161 -0.00397906173 +fft-1.168 7.30012543e-05 +fft-1.175 0.0139002213 +fft-1.182 0.0163707398 +fft-1.189 0.0269006826 +fft-1.196 0.0184442773 +fft-1.203 0.0325441845 +fft-1.210 0.0174659733 +fft-1.217 0.0128206182 +fft-1.224 -0.000894656288 +fft-1.231 -0.0172314886 +fft-1.238 -0.0149150072 +fft-1.245 -0.0327127017 +fft-1.252 -0.0229929052 +fft-1.259 -0.0218732841 +fft-1.266 -0.0251990445 +fft-1.273 -0.0151664009 +fft-1.280 0.00685866503 +fft-1.287 0.0168465003 +fft-1.294 0.0143533461 +fft-1.301 0.0258727204 +fft-1.308 0.0227229558 +fft-1.315 0.029177282 +fft-1.322 0.00809589494 +fft-1.329 0.0139913065 +fft-1.336 -0.01075482 +fft-1.343 -0.0168774351 +fft-1.350 -0.0269085225 +fft-1.357 -0.0209166314 +fft-1.364 -0.0232816748 +fft-1.371 -0.0154816005 +fft-1.378 -0.0112572713 +fft-1.385 -0.00142524636 +fft-1.392 0.017167151 +fft-1.399 0.0221051946 +fft-1.406 0.0283529647 +fft-1.413 0.0203716997 +fft-1.420 0.0183111839 +fft-1.427 0.0241281819 +fft-1.434 0.00112314615 +fft-1.441 0.00104189327 +fft-1.448 -0.00951723475 +fft-1.455 -0.018899681 +fft-1.462 -0.0203164369 +fft-1.469 -0.0193864554 +fft-1.476 -0.0264862701 +fft-1.483 -0.0247533005 +fft-1.490 -0.00626405235 +fft-1.497 0.00843601115 +fft-1.504 0.00195906498 +fft-1.511 0.0109582664 +fft-1.518 0.02524288 +fft-1.525 0.024835106 +fft-1.532 0.0300417729 +fft-1.539 0.0200407337 +fft-1.546 0.00933253858 +fft-1.553 -0.00206410652 +fft-1.560 -0.00622323994 +fft-1.567 -0.0160563197 +fft-1.574 -0.0337213352 +fft-1.581 -0.0295148101 +fft-1.588 -0.0180593692 +fft-1.595 -0.0145691838 +fft-1.602 0.000141623896 +fft-1.609 -0.00435922435 +fft-1.616 0.0186317787 +fft-1.623 0.0275428873 +fft-1.630 0.0249244794 +fft-1.637 0.019577615 +fft-1.644 0.0229656287 +fft-1.651 0.0127583463 +fft-1.658 -0.00744053628 +fft-1.665 -0.00716217235 +fft-1.672 -0.0129817277 +fft-1.679 -0.0152225569 +fft-1.686 -0.0211210847 +fft-1.693 -0.0327133685 +fft-1.700 -0.0230221562 +fft-1.707 -0.0166897923 +fft-1.714 -0.0101408735 +fft-1.721 0.014025392 +fft-1.728 0.00946176425 +fft-1.735 0.0269368235 +fft-1.742 0.0286511555 +fft-1.749 0.0156518035 +fft-1.756 0.0122650098 +fft-1.763 0.0122851152 +fft-1.770 -0.00272872369 +fft-1.777 -0.0044606342 +fft-1.784 -0.0193336345 +fft-1.791 -0.0184246711 +fft-1.798 -0.0308139324 +fft-1.805 -0.0247320756 +fft-1.812 -0.0144672161 +fft-1.819 -0.00519413128 +fft-1.826 0.00864752196 +fft-1.833 0.0044272719 +fft-1.840 0.0132351471 +fft-1.847 0.0233759992 +fft-1.854 0.021718692 +fft-1.861 0.0168349687 +fft-1.868 0.0131708421 +fft-1.875 0.0117897885 +fft-1.882 -0.0152467564 +fft-1.889 -0.0188927762 +fft-1.896 -0.0118489666 +fft-1.903 -0.0264666528 +fft-1.910 -0.0253095832 +fft-1.917 -0.0234738141 +fft-1.924 -0.011944592 +fft-1.931 0.003493367 +fft-1.938 0.00433128979 +fft-1.945 0.0149328709 +fft-1.952 0.029895464 +fft-1.959 0.0180512164 +fft-1.966 0.0173814148 +fft-1.973 0.0225115847 +fft-1.980 0.00982378796 +fft-1.987 -0.00412020693 +fft-1.994 -0.00126623362 +fft-1.1001 -0.0232627019 +fft-1.1008 -0.0302843228 +fft-1.1015 -0.0156785995 +fft-1.1022 -0.0295102112 +fft-1.1029 -0.00776981097 +fft-1.1036 -0.0051278891 +fft-1.1043 0.00604141504 +fft-1.1050 0.0178014953 +fft-1.1057 0.023014985 +fft-1.1064 0.032500051 +fft-1.1071 0.0154918386 +fft-1.1078 0.018837776 +fft-1.1085 0.0235833041 +fft-1.1092 0.00230005849 +fft-1.1099 0.00125503214 +fft-1.1106 -0.00663808687 +fft-1.1113 -0.0279535949 +fft-1.1120 -0.0175443552 +fft-1.1127 -0.0343161747 +fft-1.1134 -0.0118187657 +fft-1.1141 -0.0179303773 +fft-1.1148 -0.00397974253 +fft-1.1155 0.00336158555 +fft-1.1162 0.00566026568 +fft-1.1169 0.0215879567 +fft-1.1176 0.0244325791 +fft-1.1183 0.0204081535 +fft-1.1190 0.0268019475 +fft-1.1197 0.00558905303 +fft-1.1204 0.00201954669 +fft-1.1211 -0.00393122761 +fft-1.1218 -0.0188455824 +fft-1.1225 -0.031010583 +fft-1.1232 -0.0287676919 +fft-1.1239 -0.0304577649 +fft-1.1246 -0.018034786 +fft-1.1253 -0.0159122758 +fft-1.1260 0.00870464928 +fft-1.1267 0.0154870115 +fft-1.1274 0.0117704161 +fft-1.1281 0.0281122513 +fft-1.1288 0.028672345 +fft-1.1295 0.0146240462 +fft-1.1302 0.00969578326 +fft-1.1309 0.00791878439 +fft-1.1316 0.000934223179 +fft-1.1323 -0.00973889604 +fft-1.1330 -0.0119325276 +fft-1.1337 -0.0219036415 +fft-1.1344 -0.0236100033 +fft-1.1351 -0.0179859027 +fft-1.1358 -0.00997513719 +fft-1.1365 -0.000573300291 +fft-1.1372 0.00423664507 +fft-1.1379 0.0227425061 +fft-1.1386 0.0226215981 +fft-1.1393 0.0151072294 +fft-1.1400 0.0264483262 +fft-1.1407 0.0262381621 +fft-1.1414 0.0110511594 +fft-1.1421 0.00874941424 +fft-1.1428 -0.0106275454 +fft-1.1435 -0.00600121915 +fft-1.1442 -0.0122305602 +fft-1.1449 -0.0199596118 +fft-1.1456 -0.022311721 +fft-1.1463 -0.0101894932 +fft-1.1470 -0.00578362821 +fft-1.1477 -0.00186894997 +fft-1.1484 0.0150817977 +fft-1.1491 0.0199723095 +fft-1.1498 0.021485297 +fft-1.1505 0.0233914796 +fft-1.1512 0.027363481 +fft-1.1519 0.0118278936 +fft-1.1526 0.0116363969 +fft-1.1533 0.00299500441 +fft-1.1540 -0.00461144 +fft-1.1547 -0.0126602063 +fft-1.1554 -0.0241432227 +fft-1.1561 -0.0266579557 +fft-1.1568 -0.0190571025 +fft-1.1575 -0.0204533376 +fft-1.1582 -0.00127485953 +fft-1.1589 -0.00119977375 +fft-1.1596 0.0156012336 +fft-1.1603 0.0109377978 +fft-1.1610 0.0303792562 +fft-1.1617 0.0241009593 +fft-1.1624 0.0198476259 +fft-1.1631 0.0057324348 +fft-1.1638 0.00490872608 +fft-1.1645 -0.00375417201 +fft-1.1652 -0.00912451651 +fft-1.1659 -0.0221886486 +fft-1.1666 -0.0234448519 +fft-1.1673 -0.0323951542 +fft-1.1680 -0.0168865137 +fft-1.1687 -0.00325542875 +fft-1.1694 -0.010556194 +fft-1.1701 0.0117975771 +fft-1.1708 0.0161111467 +fft-1.1715 0.0140751209 +fft-1.1722 0.0297541451 +fft-1.1729 0.0305817295 +fft-1.1736 0.0130852796 +fft-1.1743 0.00346920267 +fft-1.1750 -0.0086868573 +fft-1.1757 -0.00500329211 +fft-1.1764 -0.0247263983 +fft-1.1771 -0.0249152575 +fft-1.1778 -0.0182666499 +fft-1.1785 -0.0282423869 +fft-1.1792 -0.00799923763 +fft-1.1799 -0.00453965366 +fft-1.1806 -0.00356114423 +fft-1.1813 0.0203191265 +fft-1.1820 0.0250005946 +fft-1.1827 0.0245611072 +fft-1.1834 0.0185070224 +fft-1.1841 0.0259318203 +fft-1.1848 0.024896251 +fft-1.1855 -0.00281084236 +fft-1.1862 -0.00846011098 +fft-1.1869 -0.0182191208 +fft-1.1876 -0.0174240377 +fft-1.1883 -0.0297947731 +fft-1.1890 -0.0150502538 +fft-1.1897 -0.028766321 +fft-1.1904 -0.00625209184 +fft-1.1911 -0.00748945307 +fft-1.1918 -0.00154351257 +fft-1.1925 0.0130826533 +fft-1.1932 0.0247302782 +fft-1.1939 0.0302230567 +fft-1.1946 0.0337627307 +fft-1.1953 0.0200759284 +fft-1.1960 0.0128441537 +fft-1.1967 0.00196672813 +fft-1.1974 0.000928507186 +fft-1.1981 -0.0216665398 +fft-1.1988 -0.0186872501 +fft-1.1995 -0.0291786324 +fft-1.2002 -0.0234230515 +fft-1.2009 -0.0122141391 +fft-1.2016 -0.0132677387 +fft-1.2023 0.00733689731 +fft-1.2030 0.0154048614 +fft-1.2037 0.0216649361 +fft-1.2044 0.0171937142 +fft-1.2051 0.0327679589 +fft-1.2058 0.0163525995 +fft-1.2065 0.00759829953 +fft-1.2072 0.0127797453 +fft-1.2079 -0.00998083502 +fft-1.2086 -0.0110859443 +fft-1.2093 -0.00936686061 +fft-1.2100 -0.017719686 +fft-1.2107 -0.0173218027 +fft-1.2114 -0.0149208866 +fft-1.2121 -0.00874727033 +fft-1.2128 -0.00192806497 +fft-1.2135 0.00550868781 +fft-1.2142 0.0228844769 +fft-1.2149 0.0251832381 +fft-1.2156 0.024464272 +fft-1.2163 0.0290537551 +fft-1.2170 0.0255069938 +fft-1.2177 0.0213622376 +fft-1.2184 0.00450781221 +fft-1.2191 0.000909934752 +fft-1.2198 -0.00697687548 +fft-1.2205 -0.0193412695 +fft-1.2212 -0.0318936855 +fft-1.2219 -0.0307923853 +fft-1.2226 -0.0096374806 +fft-1.2233 -0.0072663608 +fft-1.2240 -0.00383467972 +fft-1.2247 0.00954339374 +fft-1.2254 0.0128119048 +fft-1.2261 0.0289627425 +fft-1.2268 0.0299798418 +fft-1.2275 0.0305387378 +fft-1.2282 0.0211702995 +fft-1.2289 0.0117874118 +fft-1.2296 -0.00530680595 +fft-1.2303 -0.0184152089 +fft-1.2310 -0.0171797443 +fft-1.2317 -0.0280099791 +fft-1.2324 -0.0328123793 +fft-1.2331 -0.0208734293 +fft-1.2338 -0.0199712384 +fft-1.2345 -0.0137868542 +fft-1.2352 0.0112786237 +fft-1.2359 0.00867171027 +fft-1.2366 0.0268347058 +fft-1.2373 0.0147555005 +fft-1.2380 0.031396091 +fft-1.2387 0.0144465398 +fft-1.2394 0.00853207801 +fft-1.2401 0.00302556087 +fft-1.2408 0.00449537812 +fft-1.2415 -0.00930465199 +fft-1.2422 -0.0248971954 +fft-1.2429 -0.0165529139 +fft-1.2436 -0.0317797177 +fft-1.2443 -0.0150678065 +fft-1.2450 -0.0220887363 +fft-1.2457 0.00606378261 +fft-1.2464 0.00923348404 +fft-1.2471 0.0243487544 +fft-1.2478 0.0133501589 +fft-1.2485 0.0282563902 +fft-1.2492 0.0144643607 +fft-1.2499 0.0187816843 +fft-1.2506 0.0186770465 +fft-1.2513 0.00776212336 +fft-1.2520 -0.00530963251 +fft-1.2527 -0.0257062465 +fft-1.2534 -0.0242375452 +fft-1.2541 -0.0267971326 +fft-1.2548 -0.0228488464 +fft-1.2555 -0.014036024 +fft-1.2562 -0.00800194591 +fft-1.2569 -0.00361502264 +fft-1.2576 0.015889043 +fft-1.2583 0.0147434631 +fft-1.2590 0.0163722094 +fft-1.2597 0.0294277724 +fft-1.2604 0.0281713512 +fft-1.2611 0.0160042718 +fft-1.2618 0.00135559309 +fft-1.2625 -0.00494022109 +fft-1.2632 -0.0104140937 +fft-1.2639 -0.0274551623 +fft-1.2646 -0.0305567086 +fft-1.2653 -0.0218095034 +fft-1.2660 -0.0292743184 +fft-1.2667 -0.00801258534 +fft-1.2674 -0.00547238905 +fft-1.2681 -0.00158815971 +fft-1.2688 0.00482932106 +fft-1.2695 0.0261132456 +fft-1.2702 0.032706853 +fft-1.2709 0.0202644486 +fft-1.2716 0.0180690549 +fft-1.2723 0.0199180916 +fft-1.2730 0.00955113303 +fft-1.2737 -0.0081220679 +fft-1.2744 -0.00554604363 +fft-1.2751 -0.0300326087 +fft-1.2758 -0.0208000466 +fft-1.2765 -0.0208409056 +fft-1.2772 -0.0134999817 +fft-1.2779 -0.00429519545 +fft-1.2786 -0.00747362524 +fft-1.2793 0.0176635794 +fft-1.2800 0.0101240091 +fft-1.2807 0.0214633588 +fft-1.2814 0.0195704382 +fft-1.2821 0.0147528341 +fft-1.2828 0.0186094232 +fft-1.2835 0.00516159413 +fft-1.2842 -0.00765792141 +fft-1.2849 -0.0159440115 +fft-1.2856 -0.0253342353 +fft-1.2863 -0.0192974545 +fft-1.2870 -0.0267277136 +fft-1.2877 -0.0292395018 +fft-1.2884 -0.0189904049 +fft-1.2891 -0.0124132372 +fft-1.2898 -0.00442222599 +fft-1.2905 0.0207247883 +fft-1.2912 0.0135990428 +fft-1.2919 0.0323330685 +fft-1.2926 0.0270850882 +fft-1.2933 0.021175785 +fft-1.2940 0.00605446938 +fft-1.2947 0.00227874028 +fft-1.2954 -0.00030759722 +fft-1.2961 -0.0112651447 +fft-1.2968 -0.0288492031 +fft-1.2975 -0.0231607519 +fft-1.2982 -0.0230041388 +fft-1.2989 -0.0103288107 +fft-1.2996 -0.00297740381 +fft-1.3003 -0.00285553234 +fft-1.3010 0.0165696926 +fft-1.3017 0.013212461 +fft-1.3024 0.0228619408 +fft-1.3031 0.0269860979 +fft-1.3038 0.0315559693 +fft-1.3045 0.0152154053 +fft-1.3052 0.0191231966 +fft-1.3059 0.00436551962 +fft-1.3066 -0.00748886028 +fft-1.3073 -0.00811821874 +fft-1.3080 -0.0242219903 +fft-1.3087 -0.0188116357 +fft-1.3094 -0.0207242258 +fft-1.3101 -0.0126925204 +fft-1.3108 -0.00609640032 +fft-1.3115 0.0102762729 +fft-1.3122 0.00265194569 +fft-1.3129 0.0169860851 +fft-1.3136 0.0291555766 +fft-1.3143 0.0212092772 +fft-1.3150 0.0284348205 +fft-1.3157 0.0235681087 +fft-1.3164 0.00576440431 +fft-1.3171 -0.00960503798 +fft-1.3178 -0.00678117014 +fft-1.3185 -0.0254194345 +fft-1.3192 -0.034199439 +fft-1.3199 -0.0281739496 +fft-1.3206 -0.0296293907 +fft-1.3213 -0.022492379 +fft-1.3220 -0.00573849818 +fft-1.3227 0.0138071422 +fft-1.3234 0.0131468801 +fft-1.3241 0.011388869 +fft-1.3248 0.0243794303 +fft-1.3255 0.0199730676 +fft-1.3262 0.0226422176 +fft-1.3269 0.00731697818 +fft-1.3276 0.00952644181 +fft-1.3283 -0.0160704311 +fft-1.3290 -0.0139694139 +fft-1.3297 -0.0295924451 +fft-1.3304 -0.0262104552 +fft-1.3311 -0.0137769142 +fft-1.3318 -0.0170861948 +fft-1.3325 -0.00694637559 +fft-1.3332 0.000278868189 +fft-1.3339 0.00161491381 +fft-1.3346 0.0204288159 +fft-1.3353 0.0168768726 +fft-1.3360 0.0234672595 +fft-1.3367 0.0295668058 +fft-1.3374 0.0249861293 +fft-1.3381 0.0133831166 +fft-1.3388 0.00711909775 +fft-1.3395 -0.0113470722 +fft-1.3402 -0.0227566417 +fft-1.3409 -0.0180819724 +fft-1.3416 -0.0157396868 +fft-1.3423 -0.0218582116 +fft-1.3430 -0.0173253119 +fft-1.3437 -0.00901653059 +fft-1.3444 -0.00333710713 +fft-1.3451 0.0127047049 +fft-1.3458 0.0200256947 +fft-1.3465 0.0335474536 +fft-1.3472 0.0166973546 +fft-1.3479 0.0113421585 +fft-1.3486 0.0118817119 +fft-1.3493 0.000629264629 +fft-1.3500 -0.00786081702 +fft-1.3507 -0.00709686941 +fft-1.3514 -0.0276945252 +fft-1.3521 -0.02869156 +fft-1.3528 -0.0176427774 +fft-1.3535 -0.0236476157 +fft-1.3542 -0.00279797707 +fft-1.3549 -0.0100797834 +fft-1.3556 0.0128156729 +fft-1.3563 0.0144163137 +fft-1.3570 0.0193868522 +fft-1.3577 0.0318943933 +fft-1.3584 0.0292255729 +fft-1.3591 0.0230259653 +fft-1.3598 0.00972779933 +fft-1.3605 0.00931757968 +fft-1.3612 -0.0111484211 +fft-1.3619 -0.0150899002 +fft-1.3626 -0.017737573 +fft-1.3633 -0.033386495 +fft-1.3640 -0.023909064 +fft-1.3647 -0.0193308443 +fft-1.3654 -0.0108258193 +fft-1.3661 -0.00221205759 +fft-1.3668 0.0122891804 +fft-1.3675 0.0105179036 +fft-1.3682 0.0269939769 +fft-1.3689 0.0311191585 +fft-1.3696 0.0281094462 +fft-1.3703 0.0128244273 +fft-1.3710 0.00876935944 +fft-1.3717 9.10246745e-05 +fft-1.3724 -0.0101560047 +fft-1.3731 -0.0247484166 +fft-1.3738 -0.0168779306 +fft-1.3745 -0.019365916 +fft-1.3752 -0.0218073633 +fft-1.3759 -0.0122603811 +fft-1.3766 -0.00938062835 +fft-1.3773 0.00816858746 +fft-1.3780 0.022935085 +fft-1.3787 0.0145803355 +fft-1.3794 0.0193227306 +fft-1.3801 0.0145171992 +fft-1.3808 0.015697835 +fft-1.3815 0.0131690418 +fft-1.3822 -0.00589732779 +fft-1.3829 -0.00136564206 +fft-1.3836 -0.0203152318 +fft-1.3843 -0.019334577 +fft-1.3850 -0.0154010998 +fft-1.3857 -0.0247372668 +fft-1.3864 -0.0090399161 +fft-1.3871 -0.00458677206 +fft-1.3878 0.00940634869 +fft-1.3885 0.0189918801 +fft-1.3892 0.0257715881 +fft-1.3899 0.0318482965 +fft-1.3906 0.0299173128 +fft-1.3913 0.0175950155 +fft-1.3920 0.0214439947 +fft-1.3927 0.00659052329 +fft-1.3934 0.00699292962 +fft-1.3941 -0.00880037621 +fft-1.3948 -0.0203045532 +fft-1.3955 -0.0312376134 +fft-1.3962 -0.0278051235 +fft-1.3969 -0.0283908546 +fft-1.3976 -0.0154507076 +fft-1.3983 0.00336652482 +fft-1.3990 0.0134902578 +fft-1.3997 0.0171190649 +fft-1.4004 0.0259596333 +fft-1.4011 0.0160047859 +fft-1.4018 0.0247189887 +fft-1.4025 0.0184490308 +fft-1.4032 0.00652956497 +fft-1.4039 -0.00330398069 +fft-1.4046 0.00135935284 +fft-1.4053 -0.0166091565 +fft-1.4060 -0.0311642215 +fft-1.4067 -0.0346073732 +fft-1.4074 -0.0219000764 +fft-1.4081 -0.0117526036 +fft-1.4088 -0.00439332332 +fft-1.4095 -0.00678267051 +fft0.0 0.0144515894 +fft0.7 -0.00548671558 +fft0.14 -0.0245451871 +fft0.21 -0.039667666 +fft0.28 -0.0484291576 +fft0.35 -0.049424693 +fft0.42 -0.042494636 +fft0.49 -0.0287502632 +fft0.56 -0.0103955846 +fft0.63 0.00962609798 +fft0.70 0.0281041693 +fft0.77 0.0420755409 +fft0.84 0.0492998026 +fft0.91 0.0486184955 +fft0.98 0.0401408747 +fft0.105 0.0252263807 +fft0.112 0.00626666145 +fft0.119 -0.0136979613 +fft0.126 -0.0314660184 +fft0.133 -0.0441882797 +fft0.140 -0.0498246439 +fft0.147 -0.0474712737 +fft0.154 -0.0375055522 +fft0.161 -0.0215255544 +fft0.168 -0.00209378265 +fft0.175 0.017673742 +fft0.182 0.0346071571 +fft0.189 0.0459910743 +fft0.196 0.0500000007 +fft0.203 0.0459910743 +fft0.210 0.0346071571 +fft0.217 0.017673742 +fft0.224 -0.00209378265 +fft0.231 -0.0215255544 +fft0.238 -0.0375055522 +fft0.245 -0.0474712737 +fft0.252 -0.0498246439 +fft0.259 -0.0441882797 +fft0.266 -0.0314660184 +fft0.273 -0.0136979613 +fft0.280 0.00626666145 +fft0.287 0.0252263807 +fft0.294 0.0401408747 +fft0.301 0.0486184955 +fft0.308 0.0492998026 +fft0.315 0.0420755409 +fft0.322 0.0281041693 +fft0.329 0.00962609798 +fft0.336 -0.0103955846 +fft0.343 -0.0287502632 +fft0.350 -0.042494636 +fft0.357 -0.049424693 +fft0.364 -0.0484291576 +fft0.371 -0.039667666 +fft0.378 -0.0245451871 +fft0.385 -0.00548671558 +fft0.392 0.0144515894 +fft0.399 0.0320724808 +fft0.406 0.0445503257 +fft0.413 0.049884215 +fft0.420 0.0472188182 +fft0.427 0.0369815566 +fft0.434 0.0208140388 +fft0.441 0.00130884745 +fft0.448 -0.0184062272 +fft0.455 -0.0351697356 +fft0.462 -0.0462935306 +fft0.469 -0.0499938317 +fft0.476 -0.0456772745 +fft0.483 -0.034036044 +fft0.490 -0.0169368964 +fft0.497 0.00287820143 +fft0.504 0.0222317595 +fft0.511 0.0380202979 +fft0.518 0.0477120169 +fft0.525 0.0497527793 +fft0.532 0.0438153334 +fft0.539 0.0308517944 +fft0.546 0.0129409526 +fft0.553 -0.00704506179 +fft0.560 -0.0259013511 +fft0.567 -0.0406041779 +fft0.574 -0.0487958379 +fft0.581 -0.0491627455 +fft0.588 -0.0416460633 +fft0.595 -0.0274511408 +fft0.602 -0.00885423739 +fft0.609 0.0111625055 +fft0.616 0.0293892622 +fft0.623 0.0429032445 +fft0.630 0.0495373905 +fft0.637 0.0482278727 +fft0.644 0.0391846746 +fft0.651 0.0238579381 +fft0.658 0.00470541557 +fft0.665 -0.0152016534 +fft0.672 -0.0326710306 +fft0.679 -0.0449013785 +fft0.686 -0.0499314778 +fft0.693 -0.0469547138 +fft0.700 -0.0364484303 +fft0.707 -0.020097388 +fft0.714 -0.000523589202 +fft0.721 0.0191341713 +fft0.728 0.0357236341 +fft0.735 0.0465845615 +fft0.742 0.0499753281 +fft0.749 0.0453522019 +fft0.756 0.0334565304 +fft0.763 0.0161958709 +fft0.770 -0.00366190984 +fft0.777 -0.0229324773 +fft0.784 -0.0385256633 +fft0.791 -0.0479409881 +fft0.798 -0.0496686399 +fft0.805 -0.0434315763 +fft0.812 -0.0302299559 +fft0.819 -0.0121807503 +fft0.826 0.00782172289 +fft0.833 0.026569929 +fft0.840 0.04105746 +fft0.847 0.0489611402 +fft0.854 0.0490135588 +fft0.861 0.0412063077 +fft0.868 0.0267913397 +fft0.875 0.00808019098 +fft0.882 -0.0119266724 +fft0.889 -0.0300210118 +fft0.896 -0.0433012694 +fft0.903 -0.0496378653 +fft0.910 -0.0480146855 +fft0.917 -0.0386920087 +fft0.924 -0.0231648013 +fft0.931 -0.00392295467 +fft0.938 0.0159479659 +fft0.945 0.0332615189 +fft0.952 0.0452413522 +fft0.959 0.049966421 +fft0.966 0.0466790199 +fft0.973 0.0359063148 +fft0.980 0.0193757787 +fft0.987 -0.000261798181 +fft0.994 -0.0198573954 +fft0.1001 -0.0362687185 +fft0.1008 -0.0468640998 +fft0.1015 -0.0499444939 +fft0.1022 -0.0450159386 +fft0.1029 -0.0328687616 +fft0.1036 -0.0154508501 +fft0.1043 0.00444471464 +fft0.1050 0.0236275382 +fft0.1057 0.0390215218 +fft0.1064 0.0481581278 +fft0.1071 0.0495722443 +fft0.1078 0.0430371016 +fft0.1085 0.0296006594 +fft0.1092 0.0114175435 +fft0.1099 -0.00859645475 +fft0.1106 -0.0272319522 +fft0.1113 -0.0415006131 +fft0.1120 -0.0491143614 +fft0.1127 -0.0488522798 +fft0.1134 -0.0407563895 +fft0.1141 -0.0261249281 +fft0.1148 -0.00730415154 +fft0.1155 0.0126878973 +fft0.1162 0.0306453519 +fft0.1169 0.0436886102 +fft0.1176 0.0497260951 +fft0.1183 0.0477896519 +fft0.1190 0.0381898023 +fft0.1197 0.0224659499 +fft0.1204 0.00313952588 +fft0.1211 -0.0166903436 +fft0.1218 -0.0338437967 +fft0.1225 -0.0455701649 +fft0.1232 -0.0499890335 +fft0.1239 -0.0463918112 +fft0.1246 -0.0353553407 +fft0.1253 -0.01864939 +fft0.1260 0.00104712101 +fft0.1267 0.0205757171 +fft0.1274 0.0368048549 +fft0.1281 0.0471320748 +fft0.1288 0.0499013364 +fft0.1295 0.0446685702 +fft0.1302 0.0322728828 +fft0.1309 0.0147020165 +fft0.1316 -0.00522642303 +fft0.1323 -0.0243167691 +fft0.1330 -0.0395077504 +fft0.1337 -0.0483633876 +fft0.1344 -0.0494636148 +fft0.1351 -0.0426320098 +fft0.1358 -0.0289640594 +fft0.1365 -0.0106515195 +fft0.1372 0.00936906599 +fft0.1379 0.027887255 +fft0.1386 0.0419335291 +fft0.1393 0.049255468 +fft0.1400 0.0486789457 +fft0.1407 0.040296413 +fft0.1414 0.0254520699 +fft0.1421 0.00652630953 +fft0.1428 -0.0134459911 +fft0.1435 -0.0312621333 +fft0.1442 -0.0440651737 +fft0.1449 -0.0498020537 +fft0.1456 -0.047552824 +fft0.1463 -0.0376781709 +fft0.1470 -0.0217615552 +fft0.1477 -0.00235532247 +fft0.1484 0.017428603 +fft0.1491 0.0344177298 +fft0.1498 0.045887731 +fft0.1505 0.0499993153 +fft0.1512 0.0460931584 +fft0.1519 0.0347956382 +fft0.1526 0.0179183967 +fft0.1533 -0.00183218543 +fft0.1540 -0.0212889649 +fft0.1547 -0.0373319089 +fft0.1554 -0.0473884195 +fft0.1561 -0.0498458669 +fft0.1568 -0.0443101786 +fft0.1575 -0.031669043 +fft0.1582 -0.0139495553 +fft0.1589 0.00600684201 +fft0.1596 0.0250000004 +fft0.1603 0.0399842337 +fft0.1610 0.0485567153 +fft0.1617 0.049342785 +fft0.1624 0.0422163978 +fft0.1631 0.0283203125 +fft0.1638 0.00988286734 +fft0.1645 -0.0101393647 +fft0.1652 -0.028535679 +fft0.1659 -0.0423560962 +fft0.1666 -0.0493844189 +fft0.1673 -0.0484936014 +fft0.1680 -0.0398264974 +fft0.1687 -0.0247729328 +fft0.1694 -0.00574685773 +fft0.1701 0.0142007675 +fft0.1708 0.0318711996 +fft0.1715 0.0444308631 +fft0.1722 0.0498657227 +fft0.1729 0.0473042689 +fft0.1736 0.0371572413 +fft0.1743 0.0210517906 +fft0.1750 0.00157053792 +fft0.1757 -0.0181625616 +fft0.1764 -0.0349831656 +fft0.1771 -0.046193976 +fft0.1778 -0.0499972589 +fft0.1785 -0.0457831286 +fft0.1792 -0.0342273563 +fft0.1799 -0.0171829853 +fft0.1806 0.00261679781 +fft0.1813 0.0219969582 +fft0.1820 0.0378497541 +fft0.1827 0.0476330742 +fft0.1834 0.0497780964 +fft0.1841 0.0439408571 +fft0.1848 0.0310573895 +fft0.1855 0.013193652 +fft0.1862 -0.00678577879 +fft0.1869 -0.0256770626 +fft0.1876 -0.0404508486 +fft0.1883 -0.0487380587 +fft0.1890 -0.049209781 +fft0.1897 -0.0417903699 +fft0.1904 -0.0276695769 +fft0.1911 -0.00911177602 +fft0.1918 0.010907162 +fft0.1925 0.0291770604 +fft0.1932 0.0427682139 +fft0.1939 0.0495011844 +fft0.1946 0.0482962914 +fft0.1953 0.0393467508 +fft0.1960 0.0240876842 +fft0.1967 0.00496598752 +fft0.1974 -0.0149520393 +fft0.1981 -0.0324724019 +fft0.1988 -0.044785589 +fft0.1995 -0.0499170907 +fft0.2002 -0.0470440388 +fft0.2009 -0.0366271436 +fft0.2016 -0.0203368329 +fft0.2023 -0.000785365875 +fft0.2030 0.0188920386 +fft0.2037 0.0355399735 +fft0.2044 0.0464888252 +fft0.2051 0.0499828644 +fft0.2058 0.0454618037 +fft0.2065 0.0336506255 +fft0.2072 0.0164433327 +fft0.2079 -0.00340076443 +fft0.2086 -0.0226995256 +fft0.2093 -0.0383582562 +fft0.2100 -0.0478659756 +fft0.2107 -0.0496980473 +fft0.2114 -0.0435606912 +fft0.2121 -0.0304380711 +fft0.2128 -0.0124344947 +fft0.2135 0.00756304106 +fft0.2142 0.0263477899 +fft0.2149 0.0409074873 +fft0.2156 0.0489073806 +fft0.2163 0.0490646325 +fft0.2170 0.0413540304 +fft0.2177 0.0270120166 +fft0.2184 0.00833843742 +fft0.2191 -0.0116722686 +fft0.2198 -0.0298112445 +fft0.2205 -0.0431697778 +fft0.2212 -0.0496057346 +fft0.2219 -0.0480870642 +fft0.2226 -0.0388572998 +fft0.2233 -0.0233964901 +fft0.2240 -0.00418389216 +fft0.2247 0.0156996232 +fft0.2254 0.0330655947 +fft0.2261 0.0451292656 +fft0.2268 0.0499561429 +fft0.2275 0.0467722006 +fft0.2282 0.0360880122 +fft0.2289 0.0196168553 +fft0.2296 -3.28865421e-14 +fft0.2303 -0.0196168553 +fft0.2310 -0.0360880122 +fft0.2317 -0.0467722006 +fft0.2324 -0.0499561429 +fft0.2331 -0.0451292656 +fft0.2338 -0.0330655947 +fft0.2345 -0.0156996232 +fft0.2352 0.00418389216 +fft0.2359 0.0233964901 +fft0.2366 0.0388572998 +fft0.2373 0.0480870642 +fft0.2380 0.0496057346 +fft0.2387 0.0431697778 +fft0.2394 0.0298112445 +fft0.2401 0.0116722686 +fft0.2408 -0.00833843742 +fft0.2415 -0.0270120166 +fft0.2422 -0.0413540304 +fft0.2429 -0.0490646325 +fft0.2436 -0.0489073806 +fft0.2443 -0.0409074873 +fft0.2450 -0.0263477899 +fft0.2457 -0.00756304106 +fft0.2464 0.0124344947 +fft0.2471 0.0304380711 +fft0.2478 0.0435606912 +fft0.2485 0.0496980473 +fft0.2492 0.0478659756 +fft0.2499 0.0383582562 +fft0.2506 0.0226995256 +fft0.2513 0.00340076443 +fft0.2520 -0.0164433327 +fft0.2527 -0.0336506255 +fft0.2534 -0.0454618037 +fft0.2541 -0.0499828644 +fft0.2548 -0.0464888252 +fft0.2555 -0.0355399735 +fft0.2562 -0.0188920386 +fft0.2569 0.000785365875 +fft0.2576 0.0203368329 +fft0.2583 0.0366271436 +fft0.2590 0.0470440388 +fft0.2597 0.0499170907 +fft0.2604 0.044785589 +fft0.2611 0.0324724019 +fft0.2618 0.0149520393 +fft0.2625 -0.00496598752 +fft0.2632 -0.0240876842 +fft0.2639 -0.0393467508 +fft0.2646 -0.0482962914 +fft0.2653 -0.0495011844 +fft0.2660 -0.0427682139 +fft0.2667 -0.0291770604 +fft0.2674 -0.010907162 +fft0.2681 0.00911177602 +fft0.2688 0.0276695769 +fft0.2695 0.0417903699 +fft0.2702 0.049209781 +fft0.2709 0.0487380587 +fft0.2716 0.0404508486 +fft0.2723 0.0256770626 +fft0.2730 0.00678577879 +fft0.2737 -0.013193652 +fft0.2744 -0.0310573895 +fft0.2751 -0.0439408571 +fft0.2758 -0.0497780964 +fft0.2765 -0.0476330742 +fft0.2772 -0.0378497541 +fft0.2779 -0.0219969582 +fft0.2786 -0.00261679781 +fft0.2793 0.0171829853 +fft0.2800 0.0342273563 +fft0.2807 0.0457831286 +fft0.2814 0.0499972589 +fft0.2821 0.046193976 +fft0.2828 0.0349831656 +fft0.2835 0.0181625616 +fft0.2842 -0.00157053792 +fft0.2849 -0.0210517906 +fft0.2856 -0.0371572413 +fft0.2863 -0.0473042689 +fft0.2870 -0.0498657227 +fft0.2877 -0.0444308631 +fft0.2884 -0.0318711996 +fft0.2891 -0.0142007675 +fft0.2898 0.00574685773 +fft0.2905 0.0247729328 +fft0.2912 0.0398264974 +fft0.2919 0.0484936014 +fft0.2926 0.0493844189 +fft0.2933 0.0423560962 +fft0.2940 0.028535679 +fft0.2947 0.0101393647 +fft0.2954 -0.00988286734 +fft0.2961 -0.0283203125 +fft0.2968 -0.0422163978 +fft0.2975 -0.049342785 +fft0.2982 -0.0485567153 +fft0.2989 -0.0399842337 +fft0.2996 -0.0250000004 +fft0.3003 -0.00600684201 +fft0.3010 0.0139495553 +fft0.3017 0.031669043 +fft0.3024 0.0443101786 +fft0.3031 0.0498458669 +fft0.3038 0.0473884195 +fft0.3045 0.0373319089 +fft0.3052 0.0212889649 +fft0.3059 0.00183218543 +fft0.3066 -0.0179183967 +fft0.3073 -0.0347956382 +fft0.3080 -0.0460931584 +fft0.3087 -0.0499993153 +fft0.3094 -0.045887731 +fft0.3101 -0.0344177298 +fft0.3108 -0.017428603 +fft0.3115 0.00235532247 +fft0.3122 0.0217615552 +fft0.3129 0.0376781709 +fft0.3136 0.047552824 +fft0.3143 0.0498020537 +fft0.3150 0.0440651737 +fft0.3157 0.0312621333 +fft0.3164 0.0134459911 +fft0.3171 -0.00652630953 +fft0.3178 -0.0254520699 +fft0.3185 -0.040296413 +fft0.3192 -0.0486789457 +fft0.3199 -0.049255468 +fft0.3206 -0.0419335291 +fft0.3213 -0.027887255 +fft0.3220 -0.00936906599 +fft0.3227 0.0106515195 +fft0.3234 0.0289640594 +fft0.3241 0.0426320098 +fft0.3248 0.0494636148 +fft0.3255 0.0483633876 +fft0.3262 0.0395077504 +fft0.3269 0.0243167691 +fft0.3276 0.00522642303 +fft0.3283 -0.0147020165 +fft0.3290 -0.0322728828 +fft0.3297 -0.0446685702 +fft0.3304 -0.0499013364 +fft0.3311 -0.0471320748 +fft0.3318 -0.0368048549 +fft0.3325 -0.0205757171 +fft0.3332 -0.00104712101 +fft0.3339 0.01864939 +fft0.3346 0.0353553407 +fft0.3353 0.0463918112 +fft0.3360 0.0499890335 +fft0.3367 0.0455701649 +fft0.3374 0.0338437967 +fft0.3381 0.0166903436 +fft0.3388 -0.00313952588 +fft0.3395 -0.0224659499 +fft0.3402 -0.0381898023 +fft0.3409 -0.0477896519 +fft0.3416 -0.0497260951 +fft0.3423 -0.0436886102 +fft0.3430 -0.0306453519 +fft0.3437 -0.0126878973 +fft0.3444 0.00730415154 +fft0.3451 0.0261249281 +fft0.3458 0.0407563895 +fft0.3465 0.0488522798 +fft0.3472 0.0491143614 +fft0.3479 0.0415006131 +fft0.3486 0.0272319522 +fft0.3493 0.00859645475 +fft0.3500 -0.0114175435 +fft0.3507 -0.0296006594 +fft0.3514 -0.0430371016 +fft0.3521 -0.0495722443 +fft0.3528 -0.0481581278 +fft0.3535 -0.0390215218 +fft0.3542 -0.0236275382 +fft0.3549 -0.00444471464 +fft0.3556 0.0154508501 +fft0.3563 0.0328687616 +fft0.3570 0.0450159386 +fft0.3577 0.0499444939 +fft0.3584 0.0468640998 +fft0.3591 0.0362687185 +fft0.3598 0.0198573954 +fft0.3605 0.000261798181 +fft0.3612 -0.0193757787 +fft0.3619 -0.0359063148 +fft0.3626 -0.0466790199 +fft0.3633 -0.049966421 +fft0.3640 -0.0452413522 +fft0.3647 -0.0332615189 +fft0.3654 -0.0159479659 +fft0.3661 0.00392295467 +fft0.3668 0.0231648013 +fft0.3675 0.0386920087 +fft0.3682 0.0480146855 +fft0.3689 0.0496378653 +fft0.3696 0.0433012694 +fft0.3703 0.0300210118 +fft0.3710 0.0119266724 +fft0.3717 -0.00808019098 +fft0.3724 -0.0267913397 +fft0.3731 -0.0412063077 +fft0.3738 -0.0490135588 +fft0.3745 -0.0489611402 +fft0.3752 -0.04105746 +fft0.3759 -0.026569929 +fft0.3766 -0.00782172289 +fft0.3773 0.0121807503 +fft0.3780 0.0302299559 +fft0.3787 0.0434315763 +fft0.3794 0.0496686399 +fft0.3801 0.0479409881 +fft0.3808 0.0385256633 +fft0.3815 0.0229324773 +fft0.3822 0.00366190984 +fft0.3829 -0.0161958709 +fft0.3836 -0.0334565304 +fft0.3843 -0.0453522019 +fft0.3850 -0.0499753281 +fft0.3857 -0.0465845615 +fft0.3864 -0.0357236341 +fft0.3871 -0.0191341713 +fft0.3878 0.000523589202 +fft0.3885 0.020097388 +fft0.3892 0.0364484303 +fft0.3899 0.0469547138 +fft0.3906 0.0499314778 +fft0.3913 0.0449013785 +fft0.3920 0.0326710306 +fft0.3927 0.0152016534 +fft0.3934 -0.00470541557 +fft0.3941 -0.0238579381 +fft0.3948 -0.0391846746 +fft0.3955 -0.0482278727 +fft0.3962 -0.0495373905 +fft0.3969 -0.0429032445 +fft0.3976 -0.0293892622 +fft0.3983 -0.0111625055 +fft0.3990 0.00885423739 +fft0.3997 0.0274511408 +fft0.4004 0.0416460633 +fft0.4011 0.0491627455 +fft0.4018 0.0487958379 +fft0.4025 0.0406041779 +fft0.4032 0.0259013511 +fft0.4039 0.00704506179 +fft0.4046 -0.0129409526 +fft0.4053 -0.0308517944 +fft0.4060 -0.0438153334 +fft0.4067 -0.0497527793 +fft0.4074 -0.0477120169 +fft0.4081 -0.0380202979 +fft0.4088 -0.0222317595 +fft0.4095 -0.00287820143 +fft1.0 -0.0092823673 +fft1.7 0.00629891874 +fft1.14 -0.00200685137 +fft1.21 -0.00323821651 +fft1.28 -0.0185603518 +fft1.35 0.013060567 +fft1.42 0.0166757721 +fft1.49 -0.0101431366 +fft1.56 -0.015947571 +fft1.63 -0.00491774781 +fft1.70 -0.00815790799 +fft1.77 -0.00382477744 +fft1.84 -0.00464457739 +fft1.91 -0.00552602019 +fft1.98 0.00547750946 +fft1.105 0.0193694904 +fft1.112 0.0168968514 +fft1.119 -0.0196009614 +fft1.126 -0.0151024377 +fft1.133 -0.0136660263 +fft1.140 5.92374781e-05 +fft1.147 0.0193411298 +fft1.154 -0.0152557679 +fft1.161 0.0135674309 +fft1.168 0.00223978516 +fft1.175 0.0101267006 +fft1.182 -0.0018656766 +fft1.189 0.00781028951 +fft1.196 -0.0131114479 +fft1.203 0.0190972947 +fft1.210 0.000324790482 +fft1.217 0.0079674935 +fft1.224 0.000304470042 +fft1.231 -0.0129374219 +fft1.238 0.00767553784 +fft1.245 -0.0179541279 +fft1.252 0.00383883459 +fft1.259 0.00044171093 +fft1.266 -0.0189320706 +fft1.273 -0.0166348405 +fft1.280 0.00745066861 +fft1.287 0.00846661814 +fft1.294 -0.0114341825 +fft1.301 0.00312694535 +fft1.308 -0.00385389081 +fft1.315 0.016279025 +fft1.322 -0.0119123794 +fft1.329 0.0183565151 +fft1.336 -0.0111140562 +fft1.343 -0.00500460714 +fft1.350 -0.0113224098 +fft1.357 0.0075914287 +fft1.364 0.00186580652 +fft1.371 0.00870446395 +fft1.378 0.00203064433 +fft1.385 0.00263622287 +fft1.392 0.0198827125 +fft1.399 0.0121379085 +fft1.406 0.0121556045 +fft1.413 -0.00914081652 +fft1.420 -0.0105964513 +fft1.427 0.0112748072 +fft1.434 -0.0185677465 +fft1.441 0.000774939021 +fft1.448 -0.000628242502 +fft1.455 -0.00262962584 +fft1.462 0.00566065544 +fft1.469 0.0112209199 +fft1.476 -0.00729526486 +fft1.483 -0.0154705578 +fft1.490 0.0044087912 +fft1.497 0.0139938211 +fft1.504 -0.0183136296 +fft1.511 -0.016103765 +fft1.518 0.00277374266 +fft1.525 -8.25655443e-05 +fft1.532 0.0162682105 +fft1.539 0.009229674 +fft1.546 0.00572412461 +fft1.553 0.00291684852 +fft1.560 0.0134548713 +fft1.567 0.0084915394 +fft1.574 -0.0186468326 +fft1.581 -0.0098668756 +fft1.588 0.00552732451 +fft1.595 -0.00168722623 +fft1.602 0.00913748518 +fft1.609 -0.0198809542 +fft1.616 0.00787429325 +fft1.623 0.0121825291 +fft1.630 0.000311567768 +fft1.637 -0.00907264464 +fft1.644 0.00674658269 +fft1.651 0.00165875431 +fft1.658 -0.0195864886 +fft1.665 0.000877308834 +fft1.672 0.00670757517 +fft1.679 0.0144562647 +fft1.686 0.00768930884 +fft1.693 -0.0184720196 +fft1.700 -0.00959588028 +fft1.707 -0.0132821985 +fft1.714 -0.0197581574 +fft1.721 0.00891661365 +fft1.728 -0.0168001056 +fft1.735 0.00728908507 +fft1.742 0.00732698431 +fft1.749 -0.0140485931 +fft1.756 -0.00892651174 +fft1.763 0.00837435946 +fft1.770 -0.00179553742 +fft1.777 0.0140112089 +fft1.784 -0.000141607525 +fft1.791 0.0110916467 +fft1.798 -0.0119592231 +fft1.805 -0.00603257539 +fft1.812 0.0012955236 +fft1.819 0.00179248804 +fft1.826 0.00947332103 +fft1.833 -0.0177153852 +fft1.840 -0.0145871658 +fft1.847 -0.00220914232 +fft1.854 -0.00557617657 +fft1.861 -0.0075363717 +fft1.868 -0.000449656247 +fft1.875 0.015499386 +fft1.882 -0.0185668413 +fft1.889 -0.00776453968 +fft1.896 0.0196033362 +fft1.903 -0.00329544186 +fft1.910 -0.00260448083 +fft1.917 -0.00825561956 +fft1.924 -0.000724383572 +fft1.931 0.0109096887 +fft1.938 -0.00728538632 +fft1.945 -0.00339577673 +fft1.952 0.0145495767 +fft1.959 -0.0138639873 +fft1.966 -0.0119161922 +fft1.973 0.00911685452 +fft1.980 0.00027179718 +fft1.987 -0.00797861535 +fft1.994 0.0173249282 +fft1.1001 -0.0102566862 +fft1.1008 -0.0137045467 +fft1.1015 0.018587295 +fft1.1022 -0.0140044857 +fft1.1029 0.0173291396 +fft1.1036 0.00519507146 +fft1.1043 0.0076381159 +fft1.1050 0.0119754523 +fft1.1057 0.00700845011 +fft1.1064 0.016841976 +fft1.1071 -0.0185885672 +fft1.1078 -0.00536154862 +fft1.1085 0.017565947 +fft1.1092 -0.00681742653 +fft1.1099 0.011106519 +fft1.1106 0.0139557784 +fft1.1113 -0.0144065758 +fft1.1120 0.0140256518 +fft1.1127 -0.0197800659 +fft1.1134 0.0171188582 +fft1.1141 -0.00973582733 +fft1.1148 -0.000655333977 +fft1.1155 -0.00596472621 +fft1.1162 -0.0193248205 +fft1.1169 -0.000512696512 +fft1.1176 -0.000860935426 +fft1.1183 -0.00697334623 +fft1.1190 0.0154140946 +fft1.1197 -0.0112878438 +fft1.1204 0.00089956756 +fft1.1211 0.00882788841 +fft1.1218 -0.00384736876 +fft1.1225 -0.0164509993 +fft1.1232 -0.00754634943 +fft1.1239 -0.0145237176 +fft1.1246 -0.000714230526 +fft1.1253 -0.0131751606 +fft1.1260 0.0163621772 +fft1.1267 0.0103983069 +fft1.1274 -0.0132640237 +fft1.1281 0.00909242872 +fft1.1288 0.007443354 +fft1.1295 -0.0154204769 +fft1.1302 -0.0128813153 +fft1.1309 0.00113555195 +fft1.1316 0.00709486939 +fft1.1323 0.00483897654 +fft1.1330 0.0156426951 +fft1.1337 0.00455610268 +fft1.1344 0.00224360707 +fft1.1351 0.00666020624 +fft1.1358 0.00901378412 +fft1.1365 0.00950491894 +fft1.1372 -0.000895775564 +fft1.1379 0.0175977591 +fft1.1386 0.00330966711 +fft1.1393 -0.0190410092 +fft1.1400 0.00421770802 +fft1.1407 0.0121799111 +fft1.1414 -0.00334975123 +fft1.1421 0.0109725185 +fft1.1428 -0.00780910021 +fft1.1435 0.019259695 +fft1.1442 0.0196040533 +fft1.1449 0.00988282915 +fft1.1456 0.00292938226 +fft1.1463 0.0172991846 +fft1.1470 0.0101942988 +fft1.1477 -0.00138257735 +fft1.1484 0.0127349924 +fft1.1491 0.00552688818 +fft1.1498 -0.00291713816 +fft1.1505 -0.00321635487 +fft1.1512 0.00863380451 +fft1.1519 -0.0111398501 +fft1.1526 0.005354397 +fft1.1533 0.00782219414 +fft1.1540 0.0120660849 +fft1.1547 0.0120114964 +fft1.1554 -0.000898024999 +fft1.1561 -0.00347004528 +fft1.1568 0.00619597174 +fft1.1575 -0.00923763402 +fft1.1582 0.0113998363 +fft1.1589 -0.0084063895 +fft1.1596 0.00620246632 +fft1.1603 -0.018108638 +fft1.1610 0.0122017981 +fft1.1617 -0.00114086631 +fft1.1624 -0.00252114655 +fft1.1631 -0.0168554429 +fft1.1638 -6.54149044e-05 +fft1.1645 0.0026310205 +fft1.1652 0.010286646 +fft1.1659 -0.00202119933 +fft1.1666 0.00249471422 +fft1.1673 -0.0162967052 +fft1.1680 0.00605347147 +fft1.1687 0.0182620753 +fft1.1694 -0.0153655307 +fft1.1701 0.00939438771 +fft1.1708 0.000351095194 +fft1.1715 -0.0162806213 +fft1.1722 0.00964256749 +fft1.1729 0.013859191 +fft1.1736 -0.0109866811 +fft1.1743 -0.0141133852 +fft1.1750 -0.0189442523 +fft1.1757 0.00815597735 +fft1.1764 -0.0144696292 +fft1.1771 -0.00363653782 +fft1.1778 0.0134639591 +fft1.1785 -0.0107016442 +fft1.1792 0.0182288811 +fft1.1799 0.008103678 +fft1.1806 -0.00973908603 +fft1.1813 0.018641293 +fft1.1820 0.0121514341 +fft1.1827 0.00148913858 +fft1.1834 -0.0127640516 +fft1.1841 0.00792278536 +fft1.1848 0.0187351126 +fft1.1855 -0.0188153367 +fft1.1862 -0.0101344436 +fft1.1869 -0.0107611772 +fft1.1876 0.00560277188 +fft1.1883 -0.0108514875 +fft1.1890 0.0191092733 +fft1.1897 -0.0157422721 +fft1.1904 0.0151653932 +fft1.1911 -0.00586713059 +fft1.1918 -0.0139941871 +fft1.1925 -0.00301175471 +fft1.1932 0.00669234246 +fft1.1939 0.010944929 +fft1.1946 0.0192291699 +fft1.1953 0.00080510613 +fft1.1960 0.00160062313 +fft1.1967 -0.00103253126 +fft1.1974 0.0168090537 +fft1.1981 -0.0108606769 +fft1.1988 0.00741108879 +fft1.1995 -0.00844017323 +fft1.2002 0.000197935093 +fft1.2009 0.0121988654 +fft1.2016 -0.00619864464 +fft1.2023 0.0154591603 +fft1.2030 0.0119176842 +fft1.2037 0.00778990006 +fft1.2044 -0.0121013969 +fft1.2051 0.0155530497 +fft1.2058 -0.0127566047 +fft1.2065 -0.0184540264 +fft1.2072 0.00911615789 +fft1.2079 -0.0165609047 +fft1.2086 0.000527637021 +fft1.2093 0.019624535 +fft1.2100 0.0124266027 +fft1.2107 0.0150544401 +fft1.2114 0.013718917 +fft1.2121 0.0129435295 +fft1.2128 0.00857836474 +fft1.2135 0.00345433457 +fft1.2142 0.0194211639 +fft1.2149 0.00945898984 +fft1.2156 2.11620318e-05 +fft1.2163 0.0090428777 +fft1.2170 0.00965995807 +fft1.2177 0.0157124605 +fft1.2184 0.000677187403 +fft1.2191 0.0134921381 +fft1.2198 0.0158574935 +fft1.2205 0.00448723789 +fft1.2212 -0.01418164 +fft1.2219 -0.0134977074 +fft1.2226 0.0195823386 +fft1.2233 0.00886376854 +fft1.2240 -0.00348546728 +fft1.2247 0.00338716502 +fft1.2254 -0.00744178519 +fft1.2261 0.0127962204 +fft1.2268 0.0100035407 +fft1.2275 0.014305274 +fft1.2282 0.00625258684 +fft1.2289 0.00395796774 +fft1.2296 -0.0106136119 +fft1.2303 -0.0172135606 +fft1.2310 0.00172852515 +fft1.2317 -0.00924775843 +fft1.2324 -0.0156686157 +fft1.2331 0.00338240853 +fft1.2338 -0.00687688217 +fft1.2345 -0.0118740844 +fft1.2352 0.0183733553 +fft1.2359 -0.00605306961 +fft1.2366 0.0148121119 +fft1.2373 -0.0185760632 +fft1.2380 0.0131864445 +fft1.2387 -0.0142766973 +fft1.2394 -0.0127470884 +fft1.2401 -0.00562114688 +fft1.2408 0.0173291937 +fft1.2415 0.00840271171 +fft1.2422 -0.00844036229 +fft1.2429 0.0159588065 +fft1.2436 -0.0146520529 +fft1.2443 0.0107718753 +fft1.2450 -0.0178296845 +fft1.2457 0.0196906067 +fft1.2464 0.00603247387 +fft1.2471 0.0182594359 +fft1.2478 -0.0168603733 +fft1.2485 0.00681473222 +fft1.2492 -0.0189372543 +fft1.2499 -0.000794888707 +fft1.2506 0.0146545665 +fft1.2513 0.0121234823 +fft1.2520 0.00582406763 +fft1.2527 -0.0177618694 +fft1.2534 -0.00301328651 +fft1.2541 -0.00361140119 +fft1.2548 0.00079113245 +fft1.2555 0.00746792555 +fft1.2562 0.00288814772 +fft1.2569 -0.00801541097 +fft1.2576 0.0114412541 +fft1.2583 -0.00714021781 +fft1.2590 -0.0142996199 +fft1.2597 0.00893845502 +fft1.2604 0.0115571143 +fft1.2611 -0.000463856442 +fft1.2618 -0.0122408532 +fft1.2625 -0.00491445512 +fft1.2632 0.00325949653 +fft1.2639 -0.0155635737 +fft1.2646 -0.0128171276 +fft1.2653 0.00588217704 +fft1.2660 -0.015780421 +fft1.2667 0.0131518887 +fft1.2674 -3.76164899e-05 +fft1.2681 -0.0122880954 +fft1.2688 -0.0180109348 +fft1.2695 0.0104361223 +fft1.2702 0.0162039232 +fft1.2709 -0.00820916053 +fft1.2716 -0.00431274064 +fft1.2723 0.0141591188 +fft1.2730 0.0123164868 +fft1.2737 -0.00305048469 +fft1.2744 0.0199653022 +fft1.2751 -0.0161243603 +fft1.2758 0.0081780022 +fft1.2765 0.00595126394 +fft1.2772 0.0108497906 +fft1.2779 0.0134065673 +fft1.2786 -0.0123304529 +fft1.2793 0.0181441717 +fft1.2800 -0.013979339 +fft1.2807 -0.00285641197 +fft1.2814 -0.0108563816 +fft1.2821 -0.0166883077 +fft1.2828 0.00223568198 +fft1.2835 -0.00783937331 +fft1.2842 -0.0137453051 +fft1.2849 -0.0108362315 +fft1.2856 -0.0135112284 +fft1.2863 0.00870936178 +fft1.2870 -0.00358970277 +fft1.2877 -0.0140481424 +fft1.2884 -0.00610960927 +fft1.2891 -0.0106257079 +fft1.2898 -0.0145913092 +fft1.2905 0.0166766457 +fft1.2912 -0.0126284119 +fft1.2919 0.0161725376 +fft1.2926 0.00478575937 +fft1.2933 -4.52518452e-06 +fft1.2940 -0.0164267402 +fft1.2947 -0.00558188418 +fft1.2954 0.0092676729 +fft1.2961 0.0057900236 +fft1.2968 -0.0154820094 +fft1.2975 0.00302128075 +fft1.2982 0.0025484371 +fft1.2989 0.0193266124 +fft1.2996 0.0190451927 +fft1.3003 0.00029577731 +fft1.3010 0.0191898309 +fft1.3017 -0.00524412142 +fft1.3024 0.00141370296 +fft1.3031 0.00412632944 +fft1.3038 0.0157235172 +fft1.3045 -0.00690109842 +fft1.3052 0.0169574264 +fft1.3059 0.00689885346 +fft1.3066 0.00294067618 +fft1.3073 0.0185592007 +fft1.3080 -0.00235082372 +fft1.3087 0.0123760458 +fft1.3094 0.00443927757 +fft1.3101 0.00903268997 +fft1.3108 0.00523580285 +fft1.3115 0.0181972235 +fft1.3122 -0.0164576638 +fft1.3129 -0.00370599981 +fft1.3136 0.0107583283 +fft1.3143 -0.0073834979 +fft1.3150 0.0128044672 +fft1.3157 0.0158740859 +fft1.3164 -0.00191718212 +fft1.3171 -0.0126837669 +fft1.3178 0.0118897296 +fft1.3185 -0.0105424561 +fft1.3192 -0.0197199322 +fft1.3199 -0.00709243258 +fft1.3206 -0.0173252523 +fft1.3213 -0.0170975029 +fft1.3220 -0.00210793014 +fft1.3227 0.0169627648 +fft1.3234 -0.0026702988 +fft1.3241 -0.0198542718 +fft1.3248 -0.000704753387 +fft1.3255 -0.00841725338 +fft1.3262 0.00577668659 +fft1.3269 -0.00968281273 +fft1.3276 0.0138264606 +fft1.3283 -0.0174388457 +fft1.3290 0.00433405396 +fft1.3297 -0.0145163201 +fft1.3304 -0.00251957285 +fft1.3311 0.0195782464 +fft1.3318 0.00263246521 +fft1.3325 0.00668296544 +fft1.3332 0.00160485739 +fft1.3339 -0.0154195623 +fft1.3346 0.00550229056 +fft1.3353 -0.0126380641 +fft1.3360 -0.00305451383 +fft1.3367 0.0135634467 +fft1.3374 0.0161284637 +fft1.3381 0.0100758886 +fft1.3388 0.0173777211 +fft1.3395 -0.000228193996 +fft1.3402 -0.00732348068 +fft1.3409 0.0116257071 +fft1.3416 0.0182467215 +fft1.3423 -2.78139105e-05 +fft1.3430 -0.00400527008 +fft1.3437 -0.00534516433 +fft1.3444 -0.0139783658 +fft1.3451 -0.000715519185 +fft1.3458 -0.00070500013 +fft1.3465 0.0182426255 +fft1.3472 -0.015719654 +fft1.3479 -0.018816296 +fft1.3486 -0.00346852769 +fft1.3493 -0.00733792549 +fft1.3500 -0.00430409051 +fft1.3507 0.0154069206 +fft1.3514 -0.0123519488 +fft1.3521 -0.00781087717 +fft1.3528 0.0128725721 +fft1.3535 -0.00827370863 +fft1.3542 0.0180315841 +fft1.3549 -0.0157148521 +fft1.3556 0.0101804966 +fft1.3563 -0.00403613457 +fft1.3570 -0.00624223473 +fft1.3577 0.0138442917 +fft1.3584 0.0115870452 +fft1.3591 0.00978321303 +fft1.3598 -0.000401796104 +fft1.3605 0.0183733609 +fft1.3612 -0.00292106392 +fft1.3619 0.00572651392 +fft1.3626 0.0112038748 +fft1.3633 -0.0168065671 +fft1.3640 -0.00257677678 +fft1.3647 -0.00540016778 +fft1.3654 -0.00570367323 +fft1.3661 -0.00834706984 +fft1.3668 0.00141355989 +fft1.3675 -0.0176562015 +fft1.3682 0.00597326737 +fft1.3689 0.0126004526 +fft1.3696 0.0129176229 +fft1.3703 -0.00437215669 +fft1.3710 0.00561204646 +fft1.3717 0.00826224033 +fft1.3724 0.0064793299 +fft1.3731 -0.00829052459 +fft1.3738 0.0152576994 +fft1.3745 0.0102293082 +fft1.3752 -0.00255726697 +fft1.3759 0.00204916717 +fft1.3766 -0.0109395338 +fft1.3773 0.00415642513 +fft1.3780 0.0156402159 +fft1.3787 -0.0142709063 +fft1.3794 -0.0110231778 +fft1.3801 -0.0189065896 +fft1.3808 -0.00712999189 +fft1.3815 0.00340560661 +fft1.3822 -0.0154565657 +fft1.3829 0.0134645868 +fft1.3836 -0.00717393402 +fft1.3843 0.00668304646 +fft1.3850 0.0191731285 +fft1.3857 -0.00288997288 +fft1.3864 0.0176438019 +fft1.3871 0.00996062718 +fft1.3878 0.0182891078 +fft1.3885 0.0178863741 +fft1.3892 0.015094745 +fft1.3899 0.0167418756 +fft1.3906 0.00990314689 +fft1.3913 -0.00971134845 +fft1.3920 0.0102169579 +fft1.3927 -0.002020607 +fft1.3934 0.0186912753 +fft1.3941 0.00625718571 +fft1.3948 -0.0014244318 +fft1.3955 -0.0142473532 +fft1.3962 -0.00607285509 +fft1.3969 -0.0138784647 +fft1.3976 -0.00151215307 +fft1.3983 0.0178955551 +fft1.3990 0.0181262773 +fft1.3997 0.00678698998 +fft1.4004 0.0102732033 +fft1.4011 -0.0171531737 +fft1.4018 0.000642139872 +fft1.4025 -0.0037061153 +fft1.4032 -0.0128422212 +fft1.4039 -0.0136530232 +fft1.4046 0.0156596582 +fft1.4053 -0.00236652 +fft1.4060 -0.0185131077 +fft1.4067 -0.0194619671 +fft1.4074 0.00391186448 +fft1.4081 0.0145150898 +fft1.4088 0.0134451129 +fft1.4095 -0.0106871398 +sessionPeakDBC 133.596954 +noiseDose 0.0213090908 diff --git a/Tests/golden/state_v3.5.2.xml b/Tests/golden/state_v3.5.2.xml new file mode 100644 index 0000000..e92c68c --- /dev/null +++ b/Tests/golden/state_v3.5.2.xml @@ -0,0 +1,85 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Tests/golden/stereo_bandpass_lowfreq.txt b/Tests/golden/stereo_bandpass_lowfreq.txt new file mode 100644 index 0000000..ad242b8 --- /dev/null +++ b/Tests/golden/stereo_bandpass_lowfreq.txt @@ -0,0 +1,2404 @@ +# SPLMeter processor golden output: stereo_bandpass_lowfreq +blk9.peakSPL -999 +blk9.peakDBA -999 +blk9.peakDBC -999 +blk9.rmsSPL -999 +blk9.rmsDBA -999 +blk9.rmsDBC -999 +blk9.rough 0 +blk9.sharp 1.35632598 +blk9.fluct 0 +blk9.impuls 8.20837784 +blk9.tonal 94.1074295 +blk19.peakSPL 104.860825 +blk19.peakDBA 89.5451965 +blk19.peakDBC 115.249191 +blk19.rmsSPL 96.7884827 +blk19.rmsDBA 83.0859222 +blk19.rmsDBC 109.769135 +blk19.rough 37.8685646 +blk19.sharp 1.33784246 +blk19.fluct 0 +blk19.impuls 6.48186636 +blk19.tonal 94.1527481 +blk29.peakSPL 104.860825 +blk29.peakDBA 89.5451965 +blk29.peakDBC 115.249191 +blk29.rmsSPL 98.2970581 +blk29.rmsDBA 84.4452896 +blk29.rmsDBC 111.130486 +blk29.rough 37.8685646 +blk29.sharp 1.3376019 +blk29.fluct 0 +blk29.impuls 5.86917543 +blk29.tonal 94.1535645 +blk39.peakSPL 104.860825 +blk39.peakDBA 89.5451965 +blk39.peakDBC 115.249191 +blk39.rmsSPL 98.7461395 +blk39.rmsDBA 84.8546753 +blk39.rmsDBC 111.540436 +blk39.rough 34.4859505 +blk39.sharp 1.33718717 +blk39.fluct 0 +blk39.impuls 5.62016582 +blk39.tonal 94.1543121 +blk49.peakSPL 104.860825 +blk49.peakDBA 89.5451965 +blk49.peakDBC 115.249191 +blk49.rmsSPL 98.9026642 +blk49.rmsDBA 84.9961395 +blk49.rmsDBC 111.682014 +blk49.rough 34.4859505 +blk49.sharp 1.33646679 +blk49.fluct 0 +blk49.impuls 5.50614691 +blk49.tonal 94.1559296 +blk59.peakSPL 104.860825 +blk59.peakDBA 89.5451965 +blk59.peakDBC 115.249191 +blk59.rmsSPL 98.9026642 +blk59.rmsDBA 84.9961395 +blk59.rmsDBC 111.682014 +blk59.rough 34.2627258 +blk59.sharp 1.33618689 +blk59.fluct 0 +blk59.impuls 5.44835758 +blk59.tonal 94.15728 +blk69.peakSPL 104.860825 +blk69.peakDBA 89.5451965 +blk69.peakDBC 115.249191 +blk69.rmsSPL 98.9583435 +blk69.rmsDBA 85.0469742 +blk69.rmsDBC 111.732956 +blk69.rough 34.2627258 +blk69.sharp 1.33647048 +blk69.fluct 0 +blk69.impuls 5.43004847 +blk69.tonal 94.1561127 +blk79.peakSPL 104.860825 +blk79.peakDBA 89.5451965 +blk79.peakDBC 115.249191 +blk79.rmsSPL 98.9779968 +blk79.rmsDBA 85.0655975 +blk79.rmsDBC 111.751549 +blk79.rough 34.2232628 +blk79.sharp 1.33696842 +blk79.fluct 0 +blk79.impuls 5.42149401 +blk79.tonal 94.1552353 +blk89.peakSPL 104.860825 +blk89.peakDBA 89.5451965 +blk89.peakDBC 115.249191 +blk89.rmsSPL 98.9860382 +blk89.rmsDBA 85.0723572 +blk89.rmsDBC 111.758369 +blk89.rough 34.2232628 +blk89.sharp 1.33628774 +blk89.fluct 0 +blk89.impuls 5.41989613 +blk89.tonal 94.1565781 +blk99.peakSPL 104.860825 +blk99.peakDBA 89.5451965 +blk99.peakDBC 115.249191 +blk99.rmsSPL 98.9883575 +blk99.rmsDBA 85.074913 +blk99.rmsDBC 111.760872 +blk99.rough 34.2606468 +blk99.sharp 1.33666968 +blk99.fluct 41.8369751 +blk99.impuls 5.41918945 +blk99.tonal 94.1555557 +blk109.peakSPL 104.860825 +blk109.peakDBA 89.5451965 +blk109.peakDBC 115.249191 +blk109.rmsSPL 98.9883575 +blk109.rmsDBA 85.074913 +blk109.rmsDBC 111.760872 +blk109.rough 34.2606468 +blk109.sharp 1.3369782 +blk109.fluct 41.8369751 +blk109.impuls 5.41601229 +blk109.tonal 94.1550293 +blk119.peakSPL 104.860825 +blk119.peakDBA 89.5451965 +blk119.peakDBC 115.249191 +blk119.rmsSPL 98.989624 +blk119.rmsDBA 85.0757904 +blk119.rmsDBC 111.761795 +blk119.rough 34.2345657 +blk119.sharp 1.33727491 +blk119.fluct 41.8369751 +blk119.impuls 5.41329098 +blk119.tonal 94.1545868 +blk129.peakSPL 104.860825 +blk129.peakDBA 89.5451965 +blk129.peakDBC 115.249191 +blk129.rmsSPL 98.9883804 +blk129.rmsDBA 85.0761719 +blk129.rmsDBC 111.762131 +blk129.rough 34.2345657 +blk129.sharp 1.33680177 +blk129.fluct 41.8369751 +blk129.impuls 5.41931677 +blk129.tonal 94.1555099 +blk139.peakSPL 104.860825 +blk139.peakDBA 89.5451965 +blk139.peakDBC 115.249191 +blk139.rmsSPL 98.9913559 +blk139.rmsDBA 85.0762482 +blk139.rmsDBC 111.76226 +blk139.rough 34.2315407 +blk139.sharp 1.33597791 +blk139.fluct 41.8369751 +blk139.impuls 5.4150424 +blk139.tonal 94.1576614 +blk149.peakSPL 104.860825 +blk149.peakDBA 89.5451965 +blk149.peakDBC 115.249191 +blk149.rmsSPL 98.9919815 +blk149.rmsDBA 85.0763474 +blk149.rmsDBC 111.762306 +blk149.rough 34.2315407 +blk149.sharp 1.33583164 +blk149.fluct 41.8369751 +blk149.impuls 5.41893339 +blk149.tonal 94.1580276 +blk159.peakSPL 104.860825 +blk159.peakDBA 89.5451965 +blk159.peakDBC 115.249191 +blk159.rmsSPL 98.9919815 +blk159.rmsDBA 85.0763474 +blk159.rmsDBC 111.762306 +blk159.rough 34.2579918 +blk159.sharp 1.33605182 +blk159.fluct 41.8369751 +blk159.impuls 5.42024326 +blk159.tonal 94.1571121 +blk169.peakSPL 104.860825 +blk169.peakDBA 89.5451965 +blk169.peakDBC 115.249191 +blk169.rmsSPL 98.9904633 +blk169.rmsDBA 85.0763092 +blk169.rmsDBC 111.762329 +blk169.rough 34.2579918 +blk169.sharp 1.33647597 +blk169.fluct 41.8369751 +blk169.impuls 5.41481113 +blk169.tonal 94.1565475 +blk179.peakSPL 104.860825 +blk179.peakDBA 89.5451965 +blk179.peakDBC 115.249191 +blk179.rmsSPL 98.9901047 +blk179.rmsDBA 85.0763702 +blk179.rmsDBC 111.762329 +blk179.rough 34.2123604 +blk179.sharp 1.3373574 +blk179.fluct 41.8369751 +blk179.impuls 5.41343307 +blk179.tonal 94.1541977 +blk189.peakSPL 104.860825 +blk189.peakDBA 89.5451965 +blk189.peakDBC 115.249191 +blk189.rmsSPL 98.9895248 +blk189.rmsDBA 85.0763168 +blk189.rmsDBC 111.762337 +blk189.rough 34.2123604 +blk189.sharp 1.33619905 +blk189.fluct 41.8369751 +blk189.impuls 5.4201827 +blk189.tonal 94.156311 +blk199.peakSPL 104.860825 +blk199.peakDBA 89.5451965 +blk199.peakDBC 115.249191 +blk199.rmsSPL 98.9907379 +blk199.rmsDBA 85.0763702 +blk199.rmsDBC 111.762329 +blk199.rough 34.2238922 +blk199.sharp 1.33674324 +blk199.fluct 9.02338409 +blk199.impuls 5.41042852 +blk199.tonal 94.1557693 +blk209.peakSPL 104.860825 +blk209.peakDBA 89.5451965 +blk209.peakDBC 115.249191 +blk209.rmsSPL 98.9907379 +blk209.rmsDBA 85.0763702 +blk209.rmsDBC 111.762329 +blk209.rough 34.2238922 +blk209.sharp 1.3361299 +blk209.fluct 9.02338409 +blk209.impuls 5.41876364 +blk209.tonal 94.1568298 +blk219.peakSPL 104.49794 +blk219.peakDBA 88.3605118 +blk219.peakDBC 114.833916 +blk219.rmsSPL 98.9914322 +blk219.rmsDBA 85.0763245 +blk219.rmsDBC 111.762337 +blk219.rough 34.2369728 +blk219.sharp 1.33642232 +blk219.fluct 9.02338409 +blk219.impuls 5.41568184 +blk219.tonal 94.1565475 +blk229.peakSPL 104.49794 +blk229.peakDBA 88.3609619 +blk229.peakDBC 114.833923 +blk229.rmsSPL 98.9901428 +blk229.rmsDBA 85.0763702 +blk229.rmsDBC 111.762329 +blk229.rough 34.2369728 +blk229.sharp 1.33670151 +blk229.fluct 9.02338409 +blk229.impuls 5.41783094 +blk229.tonal 94.1557541 +blk239.peakSPL 104.49794 +blk239.peakDBA 88.3609619 +blk239.peakDBC 114.833923 +blk239.rmsSPL 98.9892731 +blk239.rmsDBA 85.0763245 +blk239.rmsDBC 111.762337 +blk239.rough 34.2591667 +blk239.sharp 1.33709157 +blk239.fluct 9.02338409 +blk239.impuls 5.41553974 +blk239.tonal 94.1544113 +blk249.peakSPL 104.49794 +blk249.peakDBA 88.3611298 +blk249.peakDBC 114.833931 +blk249.rmsSPL 98.9898682 +blk249.rmsDBA 85.0763702 +blk249.rmsDBC 111.762329 +blk249.rough 34.2591667 +blk249.sharp 1.33718741 +blk249.fluct 9.02338409 +blk249.impuls 5.41216135 +blk249.tonal 94.1544647 +blk259.peakSPL 104.49794 +blk259.peakDBA 88.3611298 +blk259.peakDBC 114.833931 +blk259.rmsSPL 98.9898682 +blk259.rmsDBA 85.0763702 +blk259.rmsDBC 111.762329 +blk259.rough 34.2230034 +blk259.sharp 1.33715177 +blk259.fluct 9.02338409 +blk259.impuls 5.40767813 +blk259.tonal 94.1549606 +blk269.peakSPL 104.499626 +blk269.peakDBA 88.3611298 +blk269.peakDBC 114.833931 +blk269.rmsSPL 98.9901581 +blk269.rmsDBA 85.0763245 +blk269.rmsDBC 111.762337 +blk269.rough 34.2230034 +blk269.sharp 1.3361361 +blk269.fluct 9.02338409 +blk269.impuls 5.41834068 +blk269.tonal 94.1568146 +blk279.peakSPL 104.500839 +blk279.peakDBA 88.3611298 +blk279.peakDBC 114.833931 +blk279.rmsSPL 98.991272 +blk279.rmsDBA 85.0763702 +blk279.rmsDBC 111.762329 +blk279.rough 34.2247047 +blk279.sharp 1.33584821 +blk279.fluct 9.02338409 +blk279.impuls 5.41439819 +blk279.tonal 94.1577911 +blk289.peakSPL 104.500839 +blk289.peakDBA 88.3611298 +blk289.peakDBC 114.833954 +blk289.rmsSPL 98.9906616 +blk289.rmsDBA 85.0763245 +blk289.rmsDBC 111.762337 +blk289.rough 34.2247047 +blk289.sharp 1.33589506 +blk289.fluct 9.02338409 +blk289.impuls 5.41961765 +blk289.tonal 94.1577606 +blk299.peakSPL 104.502075 +blk299.peakDBA 88.3611298 +blk299.peakDBC 114.833954 +blk299.rmsSPL 98.9919205 +blk299.rmsDBA 85.0763702 +blk299.rmsDBC 111.762329 +blk299.rough 34.2600861 +blk299.sharp 1.33622372 +blk299.fluct 8.8342247 +blk299.impuls 5.42284107 +blk299.tonal 94.1565628 +log.count 24 +log0.peakSPL 104.860825 +log0.peakDBA 89.5451965 +log0.peakDBC 115.249191 +log0.rmsSPL 96.7884827 +log0.rmsDBA 83.0859222 +log0.rmsDBC 109.769135 +log0.rough 0 +log0.fluct 0 +log0.sharp 1.33126402 +log0.sone 19.815979 +log0.impuls 7.74924803 +log0.tonal 94.1628494 +log0.annoy 19.815979 +log1.peakSPL 104.860825 +log1.peakDBA 89.5451965 +log1.peakDBC 115.249191 +log1.rmsSPL 98.2970581 +log1.rmsDBA 84.4452896 +log1.rmsDBC 111.130486 +log1.rough 37.8685646 +log1.fluct 0 +log1.sharp 1.33810949 +log1.sone 21.7739162 +log1.impuls 6.10459042 +log1.tonal 94.1522751 +log1.annoy 30.9631767 +log2.peakSPL 104.860825 +log2.peakDBA 89.5451965 +log2.peakDBC 115.249191 +log2.rmsSPL 98.7461395 +log2.rmsDBA 84.8546753 +log2.rmsDBC 111.540436 +log2.rough 37.8685646 +log2.fluct 0 +log2.sharp 1.33739364 +log2.sone 22.400631 +log2.impuls 5.64178753 +log2.tonal 94.1507568 +log2.annoy 31.9623013 +log3.peakSPL 104.860825 +log3.peakDBA 89.5451965 +log3.peakDBC 115.249191 +log3.rmsSPL 98.9026642 +log3.rmsDBA 84.9961395 +log3.rmsDBC 111.682014 +log3.rough 34.4859505 +log3.fluct 0 +log3.sharp 1.33646679 +log3.sone 22.6213608 +log3.impuls 5.50614691 +log3.tonal 94.1559296 +log3.annoy 31.8721199 +log4.peakSPL 104.860825 +log4.peakDBA 89.5451965 +log4.peakDBC 115.249191 +log4.rmsSPL 98.9583435 +log4.rmsDBA 85.0469742 +log4.rmsDBC 111.732956 +log4.rough 34.2627258 +log4.fluct 0 +log4.sharp 1.33730996 +log4.sone 22.70121 +log4.impuls 5.4413147 +log4.tonal 94.1503677 +log4.annoy 31.9675789 +log5.peakSPL 104.860825 +log5.peakDBA 89.5451965 +log5.peakDBC 115.249191 +log5.rmsSPL 98.9779968 +log5.rmsDBA 85.0655975 +log5.rmsDBC 111.751549 +log5.rough 34.2627258 +log5.fluct 0 +log5.sharp 1.33795285 +log5.sone 22.7305374 +log5.impuls 5.41739559 +log5.tonal 94.1529083 +log5.annoy 32.0136681 +log6.peakSPL 104.860825 +log6.peakDBA 89.5451965 +log6.peakDBC 115.249191 +log6.rmsSPL 98.9860382 +log6.rmsDBA 85.0723572 +log6.rmsDBC 111.758369 +log6.rough 34.2232628 +log6.fluct 0 +log6.sharp 1.33607244 +log6.sone 22.7411842 +log6.impuls 5.41360712 +log6.tonal 94.15345 +log6.annoy 32.0250511 +log7.peakSPL 104.860825 +log7.peakDBA 89.5451965 +log7.peakDBC 115.249191 +log7.rmsSPL 98.9883575 +log7.rmsDBA 85.074913 +log7.rmsDBC 111.760872 +log7.rough 34.2606468 +log7.fluct 41.8369751 +log7.sharp 1.33666968 +log7.sone 22.7452145 +log7.impuls 5.41918945 +log7.tonal 94.1555557 +log7.annoy 35.6300125 +log8.peakSPL 104.860825 +log8.peakDBA 89.5451965 +log8.peakDBC 115.249191 +log8.rmsSPL 98.989624 +log8.rmsDBA 85.0757904 +log8.rmsDBC 111.761795 +log8.rough 34.2606468 +log8.fluct 41.8369751 +log8.sharp 1.33717418 +log8.sone 22.7465973 +log8.impuls 5.4074626 +log8.tonal 94.1512985 +log8.annoy 35.6324921 +log9.peakSPL 104.860825 +log9.peakDBA 89.5451965 +log9.peakDBC 115.249191 +log9.rmsSPL 98.9883804 +log9.rmsDBA 85.0761719 +log9.rmsDBC 111.762131 +log9.rough 34.2345657 +log9.fluct 41.8369751 +log9.sharp 1.33795941 +log9.sone 22.7471981 +log9.impuls 5.40696526 +log9.tonal 94.1534195 +log9.annoy 35.6300316 +log10.peakSPL 104.860825 +log10.peakDBA 89.5451965 +log10.peakDBC 115.249191 +log10.rmsSPL 98.9913559 +log10.rmsDBA 85.0762482 +log10.rmsDBC 111.76226 +log10.rough 34.2345657 +log10.fluct 41.8369751 +log10.sharp 1.33524871 +log10.sone 22.7473183 +log10.impuls 5.40689564 +log10.tonal 94.1555328 +log10.annoy 35.6302452 +log11.peakSPL 104.860825 +log11.peakDBA 89.5451965 +log11.peakDBC 115.249191 +log11.rmsSPL 98.9919815 +log11.rmsDBA 85.0763474 +log11.rmsDBC 111.762306 +log11.rough 34.2315407 +log11.fluct 41.8369751 +log11.sharp 1.33583164 +log11.sone 22.7474766 +log11.impuls 5.41893339 +log11.tonal 94.1580276 +log11.annoy 35.6301193 +log12.peakSPL 104.860825 +log12.peakDBA 89.5451965 +log12.peakDBC 115.249191 +log12.rmsSPL 98.9904633 +log12.rmsDBA 85.0763092 +log12.rmsDBC 111.762329 +log12.rough 34.2579918 +log12.fluct 41.8369751 +log12.sharp 1.33686805 +log12.sone 22.7474174 +log12.impuls 5.40153027 +log12.tonal 94.1518784 +log12.annoy 35.6336021 +log13.peakSPL 104.860825 +log13.peakDBA 89.5451965 +log13.peakDBC 115.249191 +log13.rmsSPL 98.9901047 +log13.rmsDBA 85.0763702 +log13.rmsDBC 111.762329 +log13.rough 34.2579918 +log13.fluct 41.8369751 +log13.sharp 1.33698106 +log13.sone 22.7475147 +log13.impuls 5.41492605 +log13.tonal 94.15522 +log13.annoy 35.6337776 +log14.peakSPL 104.860825 +log14.peakDBA 89.5451965 +log14.peakDBC 115.249191 +log14.rmsSPL 98.9895248 +log14.rmsDBA 85.0763168 +log14.rmsDBC 111.762337 +log14.rough 34.2123604 +log14.fluct 41.8369751 +log14.sharp 1.3369627 +log14.sone 22.7474327 +log14.impuls 5.41061115 +log14.tonal 94.151329 +log14.annoy 35.6274376 +log15.peakSPL 104.860825 +log15.peakDBA 89.5451965 +log15.peakDBC 115.249191 +log15.rmsSPL 98.9907379 +log15.rmsDBA 85.0763702 +log15.rmsDBC 111.762329 +log15.rough 34.2238922 +log15.fluct 9.02338409 +log15.sharp 1.33674324 +log15.sone 22.7475147 +log15.impuls 5.41042852 +log15.tonal 94.1557693 +log15.annoy 33.7042198 +log16.peakSPL 104.49794 +log16.peakDBA 88.3605118 +log16.peakDBC 114.833916 +log16.rmsSPL 98.9914322 +log16.rmsDBA 85.0763245 +log16.rmsDBC 111.762337 +log16.rough 34.2238922 +log16.fluct 9.02338409 +log16.sharp 1.33641911 +log16.sone 22.7474403 +log16.impuls 5.40283632 +log16.tonal 94.1531601 +log16.annoy 33.7040939 +log17.peakSPL 104.49794 +log17.peakDBA 88.3609619 +log17.peakDBC 114.833923 +log17.rmsSPL 98.9901428 +log17.rmsDBA 85.0763702 +log17.rmsDBC 111.762329 +log17.rough 34.2369728 +log17.fluct 9.02338409 +log17.sharp 1.33743298 +log17.sone 22.7475147 +log17.impuls 5.41639233 +log17.tonal 94.1539307 +log17.annoy 33.7059937 +log18.peakSPL 104.49794 +log18.peakDBA 88.3609619 +log18.peakDBC 114.833923 +log18.rmsSPL 98.9892731 +log18.rmsDBA 85.0763245 +log18.rmsDBC 111.762337 +log18.rough 34.2369728 +log18.fluct 9.02338409 +log18.sharp 1.33729053 +log18.sone 22.7474403 +log18.impuls 5.40772486 +log18.tonal 94.1504517 +log18.annoy 33.7058678 +log19.peakSPL 104.49794 +log19.peakDBA 88.3611298 +log19.peakDBC 114.833931 +log19.rmsSPL 98.9898682 +log19.rmsDBA 85.0763702 +log19.rmsDBC 111.762329 +log19.rough 34.2591667 +log19.fluct 9.02338409 +log19.sharp 1.33718741 +log19.sone 22.7475147 +log19.impuls 5.41216135 +log19.tonal 94.1544647 +log19.annoy 33.7090034 +log20.peakSPL 104.499626 +log20.peakDBA 88.3611298 +log20.peakDBC 114.833931 +log20.rmsSPL 98.9901581 +log20.rmsDBA 85.0763245 +log20.rmsDBC 111.762337 +log20.rough 34.2230034 +log20.fluct 9.02338409 +log20.sharp 1.33687782 +log20.sone 22.7474403 +log20.impuls 5.40823936 +log20.tonal 94.1519241 +log20.annoy 33.7039719 +log21.peakSPL 104.500839 +log21.peakDBA 88.3611298 +log21.peakDBC 114.833931 +log21.rmsSPL 98.991272 +log21.rmsDBA 85.0763702 +log21.rmsDBC 111.762329 +log21.rough 34.2230034 +log21.fluct 9.02338409 +log21.sharp 1.33614051 +log21.sone 22.7475147 +log21.impuls 5.4222579 +log21.tonal 94.1560898 +log21.annoy 33.7040977 +log22.peakSPL 104.500839 +log22.peakDBA 88.3611298 +log22.peakDBC 114.833954 +log22.rmsSPL 98.9906616 +log22.rmsDBA 85.0763245 +log22.rmsDBC 111.762337 +log22.rough 34.2247047 +log22.fluct 9.02338409 +log22.sharp 1.33694744 +log22.sone 22.7474403 +log22.impuls 5.40542793 +log22.tonal 94.1512222 +log22.annoy 33.7042046 +log23.peakSPL 104.502075 +log23.peakDBA 88.3611298 +log23.peakDBC 114.833954 +log23.rmsSPL 98.9919205 +log23.rmsDBA 85.0763702 +log23.rmsDBC 111.762329 +log23.rough 34.2600861 +log23.fluct 8.8342247 +log23.sharp 1.33622372 +log23.sone 22.7475147 +log23.impuls 5.42284107 +log23.tonal 94.1565628 +log23.annoy 33.6915398 +fft-1.0 0.0168074574 +fft-1.7 -0.00771295931 +fft-1.14 -0.0190421641 +fft-1.21 -0.0025114906 +fft-1.28 0.0254634619 +fft-1.35 0.0356900133 +fft-1.42 0.0187584069 +fft-1.49 -0.00446555484 +fft-1.56 -0.00611699 +fft-1.63 0.0175842028 +fft-1.70 0.0421143323 +fft-1.77 0.0419974402 +fft-1.84 0.0192196127 +fft-1.91 0.00101084076 +fft-1.98 0.00946970657 +fft-1.105 0.0369116105 +fft-1.112 0.0544381589 +fft-1.119 0.0441688225 +fft-1.126 0.0191827882 +fft-1.133 0.00892827474 +fft-1.140 0.0263732746 +fft-1.147 0.0535384081 +fft-1.154 0.0615496561 +fft-1.161 0.0428433195 +fft-1.168 0.0196006857 +fft-1.175 0.0190049149 +fft-1.182 0.0429187939 +fft-1.189 0.0658046752 +fft-1.196 0.0632091686 +fft-1.203 0.0390367098 +fft-1.210 0.0211933572 +fft-1.217 0.0304588955 +fft-1.224 0.0573067069 +fft-1.231 0.0725295991 +fft-1.238 0.0598168969 +fft-1.245 0.0339467153 +fft-1.252 0.0243014395 +fft-1.259 0.042093046 +fft-1.266 0.0678565502 +fft-1.273 0.0731609389 +fft-1.280 0.0523216762 +fft-1.287 0.0287410095 +fft-1.294 0.0288042184 +fft-1.301 0.0524489507 +fft-1.308 0.073234722 +fft-1.315 0.0678352416 +fft-1.322 0.0420571081 +fft-1.329 0.0243634339 +fft-1.336 0.0341256447 +fft-1.343 0.0600165427 +fft-1.350 0.0726457015 +fft-1.357 0.0573428869 +fft-1.364 0.0305222105 +fft-1.371 0.0213744417 +fft-1.378 0.0393079259 +fft-1.385 0.0634555668 +fft-1.392 0.0659514517 +fft-1.399 0.0430141576 +fft-1.406 0.01916622 +fft-1.413 0.0198827963 +fft-1.420 0.0431772247 +fft-1.427 0.0618188307 +fft-1.434 0.0537081659 +fft-1.441 0.0265296698 +fft-1.448 0.0091810748 +fft-1.455 0.0195430666 +fft-1.462 0.0445360132 +fft-1.469 0.0547116399 +fft-1.476 0.0371023677 +fft-1.483 0.00968774967 +fft-1.490 0.00134209357 +fft-1.497 0.0196295753 +fft-1.504 0.0423697233 +fft-1.511 0.0423799083 +fft-1.518 0.0177982021 +fft-1.525 -0.00583727285 +fft-1.532 -0.00407214463 +fft-1.539 0.0191904474 +fft-1.546 0.0360455364 +fft-1.553 0.0257151797 +fft-1.560 -0.00227285177 +fft-1.567 -0.0187099818 +fft-1.574 -0.00728358701 +fft-1.581 0.017229734 +fft-1.588 0.0254491586 +fft-1.595 0.00616470678 +fft-1.602 -0.0211563092 +fft-1.609 -0.0280809719 +fft-1.616 -0.00892265141 +fft-1.623 0.0129189547 +fft-1.630 0.0110607259 +fft-1.637 -0.0144326827 +fft-1.644 -0.0371186882 +fft-1.651 -0.0336679071 +fft-1.658 -0.00988473743 +fft-1.665 0.00577057339 +fft-1.672 -0.00607047323 +fft-1.679 -0.0340781361 +fft-1.686 -0.0488591492 +fft-1.693 -0.0357402712 +fft-1.700 -0.01113219 +fft-1.707 -0.00422337279 +fft-1.714 -0.0244193748 +fft-1.721 -0.0508495867 +fft-1.728 -0.055644758 +fft-1.735 -0.0350209326 +fft-1.742 -0.0134976283 +fft-1.749 -0.0165465362 +fft-1.756 -0.0421777666 +fft-1.763 -0.0631576106 +fft-1.770 -0.057383813 +fft-1.777 -0.0325368717 +fft-1.784 -0.0175119545 +fft-1.791 -0.0301866382 +fft-1.798 -0.0574781075 +fft-1.805 -0.0699352846 +fft-1.812 -0.0545875169 +fft-1.819 -0.0294109937 +fft-1.826 -0.023276858 +fft-1.833 -0.0437464081 +fft-1.840 -0.0686361864 +fft-1.847 -0.0707606673 +fft-1.854 -0.048255261 +fft-1.861 -0.0266547836 +fft-1.868 -0.0304114483 +fft-1.875 -0.0556193367 +fft-1.882 -0.074371025 +fft-1.889 -0.0658856034 +fft-1.896 -0.0396884121 +fft-1.903 -0.0249859057 +fft-1.910 -0.0380883627 +fft-1.917 -0.0642170981 +fft-1.924 -0.0739888251 +fft-1.931 -0.0561917126 +fft-1.938 -0.030290382 +fft-1.945 -0.0247160513 +fft-1.952 -0.0451540947 +fft-1.959 -0.0682028085 +fft-1.966 -0.0674775243 +fft-1.973 -0.0430410989 +fft-1.980 -0.0213352982 +fft-1.987 -0.0256876424 +fft-1.994 -0.0502929538 +fft-1.1001 -0.0666896179 +fft-1.1008 -0.0555075333 +fft-1.1015 -0.0280758124 +fft-1.1022 -0.0137871038 +fft-1.1029 -0.027314363 +fft-1.1036 -0.0522457138 +fft-1.1043 -0.0593926907 +fft-1.1050 -0.0393493809 +fft-1.1057 -0.0129861049 +fft-1.1064 -0.00817189552 +fft-1.1071 -0.0286912955 +fft-1.1078 -0.0500249788 +fft-1.1085 -0.046701096 +fft-1.1092 -0.0207097754 +fft-1.1099 0.00071446225 +fft-1.1106 -0.00453129411 +fft-1.1113 -0.0287670977 +fft-1.1120 -0.0430986509 +fft-1.1127 -0.029649267 +fft-1.1134 -0.00150285196 +fft-1.1141 0.0118884984 +fft-1.1148 -0.00244766381 +fft-1.1155 -0.0265362449 +fft-1.1162 -0.0315074623 +fft-1.1169 -0.00980155822 +fft-1.1176 0.0163961276 +fft-1.1183 0.0198988244 +fft-1.1190 -0.00116002851 +fft-1.1197 -0.0212472249 +fft-1.1204 -0.0159128457 +fft-1.1211 0.0109351575 +fft-1.1218 0.0313867107 +fft-1.1225 0.0246589556 +fft-1.1232 0.000274688005 +fft-1.1239 -0.0125618735 +fft-1.1246 0.00245675072 +fft-1.1253 0.0305491686 +fft-1.1260 0.0423299 +fft-1.1267 0.0265839119 +fft-1.1274 0.00277380645 +fft-1.1281 -0.000672515482 +fft-1.1288 0.0219273251 +fft-1.1295 0.0471690372 +fft-1.1302 0.0486655235 +fft-1.1309 0.0264760517 +fft-1.1316 0.0070396699 +fft-1.1323 0.0136810616 +fft-1.1330 0.040591564 +fft-1.1337 0.0593058206 +fft-1.1344 0.0504517667 +fft-1.1351 0.0253549069 +fft-1.1358 0.0134042483 +fft-1.1365 0.0292697474 +fft-1.1372 0.0565370545 +fft-1.1379 0.0660147145 +fft-1.1386 0.0482939817 +fft-1.1393 0.0242415033 +fft-1.1400 0.0217226241 +fft-1.1407 0.0445183814 +fft-1.1414 0.0681065544 +fft-1.1421 0.067013219 +fft-1.1428 0.0432253629 +fft-1.1435 0.0239746086 +fft-1.1442 0.0313607529 +fft-1.1449 0.0577007122 +fft-1.1456 0.0740974545 +fft-1.1463 0.0626717582 +fft-1.1470 0.0365047492 +fft-1.1477 0.0250457693 +fft-1.1484 0.0412649438 +fft-1.1491 0.0671844557 +fft-1.1498 0.0739321336 +fft-1.1505 0.0539461896 +fft-1.1512 0.0294091646 +fft-1.1519 0.0275057759 +fft-1.1526 0.0501004308 +fft-1.1533 0.0716578662 +fft-1.1540 0.0677258745 +fft-1.1547 0.0422107354 +fft-1.1554 0.0230201017 +fft-1.1561 0.0309357736 +fft-1.1568 0.0564330518 +fft-1.1575 0.0703063309 +fft-1.1582 0.0562468097 +fft-1.1589 0.0290346555 +fft-1.1596 0.0180536136 +fft-1.1603 0.0345180891 +fft-1.1610 0.058964707 +fft-1.1617 0.0629643872 +fft-1.1624 0.0408343337 +fft-1.1631 0.0159779135 +fft-1.1638 0.01478271 +fft-1.1645 0.0371879861 +fft-1.1652 0.0567552559 +fft-1.1659 0.0501595587 +fft-1.1666 0.0232094936 +fft-1.1673 0.00436940975 +fft-1.1680 0.0130124399 +fft-1.1687 0.0378130153 +fft-1.1694 0.0493817516 +fft-1.1701 0.0330497101 +fft-1.1708 0.00523260795 +fft-1.1715 -0.00487758406 +fft-1.1722 0.0121286809 +fft-1.1729 0.0353855714 +fft-1.1736 0.0370288491 +fft-1.1743 0.0132782133 +fft-1.1750 -0.0113425367 +fft-1.1757 -0.0113572469 +fft-1.1764 0.0112477206 +fft-1.1771 0.0292426776 +fft-1.1778 0.0205290373 +fft-1.1785 -0.00720845163 +fft-1.1792 -0.0250704642 +fft-1.1799 -0.0151759451 +fft-1.1806 0.00939558446 +fft-1.1813 0.0191965383 +fft-1.1820 0.00126064615 +fft-1.1827 -0.0264321715 +fft-1.1834 -0.0350072607 +fft-1.1841 -0.0169002358 +fft-1.1848 0.0057084756 +fft-1.1855 0.00563674979 +fft-1.1862 -0.0189776532 +fft-1.1869 -0.0425964668 +fft-1.1876 -0.0407649577 +fft-1.1883 -0.0173871219 +fft-1.1890 -0.000367591158 +fft-1.1897 -0.010484796 +fft-1.1904 -0.0382115468 +fft-1.1911 -0.0543391556 +fft-1.1918 -0.0425558127 +fft-1.1925 -0.0176377445 +fft-1.1932 -0.00896633975 +fft-1.1939 -0.0277526081 +fft-1.1946 -0.0545298085 +fft-1.1953 -0.060865663 +fft-1.1960 -0.0410742089 +fft-1.1967 -0.0185559709 +fft-1.1974 -0.0196952075 +fft-1.1981 -0.0444280729 +fft-1.1988 -0.0663127452 +fft-1.1995 -0.0620216057 +fft-1.2002 -0.0373598039 +fft-1.2009 -0.0207890105 +fft-1.2016 -0.0316793621 +fft-1.2023 -0.0587020069 +fft-1.2030 -0.0724646822 +fft-1.2037 -0.058295887 +fft-1.2044 -0.0326079167 +fft-1.2051 -0.0245903879 +fft-1.2058 -0.0436500534 +fft-1.2065 -0.0689180121 +fft-1.2072 -0.0725267306 +fft-1.2079 -0.0506934896 +fft-1.2086 -0.0279397666 +fft-1.2093 -0.0297389161 +fft-1.2100 -0.0541026741 +fft-1.2107 -0.0737989545 +fft-1.2114 -0.0667269528 +fft-1.2121 -0.0405693986 +fft-1.2128 -0.0242230091 +fft-1.2135 -0.0355669856 +fft-1.2142 -0.0615210012 +fft-1.2149 -0.0726355538 +fft-1.2156 -0.0559409559 +fft-1.2163 -0.0294154231 +fft-1.2170 -0.021932127 +fft-1.2177 -0.0410539731 +fft-1.2184 -0.0645990595 +fft-1.2191 -0.0653840154 +fft-1.2198 -0.0415461138 +fft-1.2205 -0.0186223369 +fft-1.2212 -0.0210663565 +fft-1.2219 -0.0449740998 +fft-1.2226 -0.0624396764 +fft-1.2233 -0.052684214 +fft-1.2240 -0.0252348073 +fft-1.2247 -0.00929945707 +fft-1.2254 -0.0211899038 +fft-1.2261 -0.0461288318 +fft-1.2268 -0.0547353849 +fft-1.2275 -0.0357990041 +fft-1.2282 -0.00878593698 +fft-1.2289 -0.00212884881 +fft-1.2296 -0.0215143673 +fft-1.2303 -0.0435424447 +fft-1.2310 -0.0418295488 +fft-1.2317 -0.0164402332 +fft-1.2324 0.00618267059 +fft-1.2331 0.0027104672 +fft-1.2338 -0.0210526045 +fft-1.2345 -0.0366466083 +fft-1.2352 -0.0247029606 +fft-1.2359 0.0034485599 +fft-1.2366 0.0184146985 +fft-1.2373 0.00552191213 +fft-1.2380 -0.0188190658 +fft-1.2387 -0.0254205223 +fft-1.2394 -0.00487741549 +fft-1.2401 0.0219392367 +fft-1.2408 0.0271596909 +fft-1.2415 0.00699907355 +fft-1.2422 -0.0140237873 +fft-1.2429 -0.0104376497 +fft-1.2436 0.0157673433 +fft-1.2443 0.037356589 +fft-1.2450 0.0322264284 +fft-1.2457 0.00805671606 +fft-1.2464 -0.00625803694 +fft-1.2471 0.00715852901 +fft-1.2478 0.035222847 +fft-1.2485 0.0484824888 +fft-1.2492 0.0339656249 +fft-1.2499 0.00964761712 +fft-1.2506 0.00439820066 +fft-1.2513 0.0257779751 +fft-1.2520 0.051601924 +fft-1.2527 0.0546834543 +fft-1.2534 0.0331565961 +fft-1.2541 0.0125550348 +fft-1.2548 0.0173299611 +fft-1.2555 0.043573726 +fft-1.2562 0.0633774027 +fft-1.2569 0.055958882 +fft-1.2576 0.0308420062 +fft-1.2583 0.017231565 +fft-1.2590 0.0314364135 +fft-1.2597 0.0586762391 +fft-1.2604 0.0695669428 +fft-1.2611 0.0528942905 +fft-1.2618 0.0281218775 +fft-1.2625 0.0236796942 +fft-1.2632 0.0452511199 +fft-1.2639 0.0694329441 +fft-1.2646 0.0698392391 +fft-1.2653 0.0465312488 +fft-1.2660 0.0259496719 +fft-1.2667 0.0314202011 +fft-1.2674 0.0571359806 +fft-1.2681 0.0746337399 +fft-1.2688 0.0645423979 +fft-1.2695 0.0381894186 +fft-1.2702 0.0249654017 +fft-1.2709 0.0395425893 +fft-1.2716 0.0655070245 +fft-1.2723 0.0736693442 +fft-1.2730 0.0546224825 +fft-1.2737 0.029235227 +fft-1.2744 0.0253748484 +fft-1.2751 0.0468248948 +fft-1.2758 0.0690647066 +fft-1.2765 0.0666213334 +fft-1.2772 0.0414840616 +fft-1.2779 0.0208859425 +fft-1.2786 0.0269288961 +fft-1.2793 0.0519315377 +fft-1.2800 0.066998601 +fft-1.2807 0.0542525016 +fft-1.2814 0.0267760139 +fft-1.2821 0.0140206814 +fft-1.2828 0.028957855 +fft-1.2835 0.0536115691 +fft-1.2842 0.0591115616 +fft-1.2849 0.0378972404 +fft-1.2856 0.012153212 +fft-1.2863 0.00906590745 +fft-1.2870 0.030501483 +fft-1.2877 0.050926052 +fft-1.2884 0.0458890833 +fft-1.2891 0.019298343 +fft-1.2898 -0.000936804339 +fft-1.2905 0.00596657209 +fft-1.2912 0.0304851905 +fft-1.2919 0.043414861 +fft-1.2926 0.0284479037 +fft-1.2933 0.000365721062 +fft-1.2940 -0.011446557 +fft-1.2947 0.00422623986 +fft-1.2954 0.0279217847 +fft-1.2961 0.0312119015 +fft-1.2968 0.00841449108 +fft-1.2975 -0.0170656051 +fft-1.2982 -0.0188401919 +fft-1.2989 0.00303074252 +fft-1.2996 0.0221092794 +fft-1.3003 0.0150711415 +fft-1.3010 -0.0122745428 +fft-1.3017 -0.0314628147 +fft-1.3024 -0.0231200159 +fft-1.3031 0.00142858736 +fft-1.3038 0.0127944089 +fft-1.3045 -0.00369148143 +fft-1.3052 -0.0316133946 +fft-1.3059 -0.041778747 +fft-1.3066 -0.024778001 +fft-1.3073 -0.00147706456 +fft-1.3080 0.000259112567 +fft-1.3087 -0.023349423 +fft-1.3094 -0.0477788635 +fft-1.3101 -0.0475537293 +fft-1.3108 -0.0246601701 +fft-1.3115 -0.00632815063 +fft-1.3122 -0.014656473 +fft-1.3129 -0.0419608019 +fft-1.3136 -0.0593432523 +fft-1.3143 -0.0489230454 +fft-1.3150 -0.0237799305 +fft-1.3157 -0.0133623481 +fft-1.3164 -0.0306383818 +fft-1.3171 -0.0576286986 +fft-1.3178 -0.0654599443 +fft-1.3185 -0.0465683751 +fft-1.3192 -0.0231353976 +fft-1.3199 -0.0223444626 +fft-1.3206 -0.0460584015 +fft-1.3213 -0.0687402934 +fft-1.3220 -0.0659369826 +fft-1.3227 -0.0415531695 +fft-1.3234 -0.0234951414 +fft-1.3241 -0.0325427018 +fft-1.3248 -0.0591699332 +fft-1.3255 -0.0741697922 +fft-1.3262 -0.0612316951 +fft-1.3269 -0.0351342782 +fft-1.3276 -0.0252602752 +fft-1.3283 -0.0428220592 +fft-1.3290 -0.0683548376 +fft-1.3297 -0.0734279975 +fft-1.3304 -0.0523569472 +fft-1.3311 -0.0285440646 +fft-1.3318 -0.028375335 +fft-1.3325 -0.0517889224 +fft-1.3332 -0.0723445565 +fft-1.3339 -0.0667160824 +fft-1.3346 -0.0407103486 +fft-1.3353 -0.0227910858 +fft-1.3360 -0.0323299989 +fft-1.3367 -0.058000423 +fft-1.3374 -0.0704121292 +fft-1.3381 -0.0548949577 +fft-1.3388 -0.02786313 +fft-1.3395 -0.0185079016 +fft-1.3402 -0.0362380929 +fft-1.3409 -0.0601866394 +fft-1.3416 -0.0624877475 +fft-1.3423 -0.0393603966 +fft-1.3430 -0.0153276268 +fft-1.3437 -0.0158646312 +fft-1.3444 -0.0389849283 +fft-1.3451 -0.0574579127 +fft-1.3458 -0.0491846129 +fft-1.3465 -0.0218491573 +fft-1.3472 -0.00435021147 +fft-1.3479 -0.0145684574 +fft-1.3486 -0.039424561 +fft-1.3493 -0.049470447 +fft-1.3500 -0.0317385793 +fft-1.3507 -0.00420851447 +fft-1.3514 0.00424539857 +fft-1.3521 -0.0139412144 +fft-1.3528 -0.0365879238 +fft-1.3535 -0.0365124196 +fft-1.3542 -0.0118529769 +fft-1.3549 0.0118522616 +fft-1.3556 0.0101485634 +fft-1.3563 -0.0130607951 +fft-1.3570 -0.0298710968 +fft-1.3577 -0.0195042081 +fft-1.3584 0.00851202384 +fft-1.3591 0.0249687899 +fft-1.3598 0.0135536334 +fft-1.3605 -0.0109567633 +fft-1.3612 -0.0191818438 +fft-1.3619 8.87326896e-05 +fft-1.3626 0.0273876451 +fft-1.3633 0.0342817977 +fft-1.3640 0.0150843672 +fft-1.3647 -0.00680474099 +fft-1.3654 -0.00500211678 +fft-1.3661 0.0204277076 +fft-1.3668 0.0430417508 +fft-1.3675 0.0395111516 +fft-1.3682 0.0156403035 +fft-1.3689 -0.000110363588 +fft-1.3696 0.0116279703 +fft-1.3703 0.0395255983 +fft-1.3710 0.0541893095 +fft-1.3717 0.0409456901 +fft-1.3724 0.0162062254 +fft-1.3731 0.00915919989 +fft-1.3738 0.0292103402 +fft-1.3745 0.0554895401 +fft-1.3752 0.0601274967 +fft-1.3759 0.0393401757 +fft-1.3766 0.0176474657 +fft-1.3773 0.0205213316 +fft-1.3780 0.0459722541 +fft-1.3787 0.0667667463 +fft-1.3794 0.0608025081 +fft-1.3801 0.035760656 +fft-1.3808 0.0205365214 +fft-1.3815 0.0330080092 +fft-1.3822 0.06009271 +fft-1.3829 0.0723396465 +fft-1.3836 0.0567780845 +fft-1.3843 0.0313847214 +fft-1.3850 0.0250309445 +fft-1.3857 0.0452786088 +fft-1.3864 0.069944337 +fft-1.3871 0.0718432516 +fft-1.3878 0.0491107851 +fft-1.3885 0.0272824634 +fft-1.3892 0.0308105294 +fft-1.3899 0.0557892881 +fft-1.3906 0.0743115321 +fft-1.3913 0.0655970275 +fft-1.3920 0.0391711369 +fft-1.3927 0.024240667 +fft-1.3934 0.0371158645 +fft-1.3941 0.0630182028 +fft-1.3948 0.0725654289 +fft-1.3955 0.0545454323 +fft-1.3962 0.0284236763 +fft-1.3969 0.0226315502 +fft-1.3976 0.0428544208 +fft-1.3983 0.065690957 +fft-1.3990 0.0647567958 +fft-1.3997 0.0401155613 +fft-1.4004 0.018209016 +fft-1.4011 0.0223649554 +fft-1.4018 0.0467784777 +fft-1.4025 0.0629881471 +fft-1.4032 0.0516244099 +fft-1.4039 0.0240162648 +fft-1.4046 0.00955678709 +fft-1.4053 0.0229188707 +fft-1.4060 0.0476908907 +fft-1.4067 0.0546848252 +fft-1.4074 0.0344949514 +fft-1.4081 0.00799161196 +fft-1.4088 0.00304426439 +fft-1.4095 0.0234374199 +fft0.0 0.00457259035 +fft0.7 0.00823089667 +fft0.14 0.011878198 +fft0.21 0.0155092934 +fft0.28 0.0191196911 +fft0.35 0.0227042008 +fft0.42 0.0262584798 +fft0.49 0.0297772456 +fft0.56 0.0332557447 +fft0.63 0.0366894752 +fft0.70 0.0400740169 +fft0.77 0.0434045978 +fft0.84 0.0466769822 +fft0.91 0.0498866364 +fft0.98 0.0530289598 +fft0.105 0.056099426 +fft0.112 0.0590943135 +fft0.119 0.0620103367 +fft0.126 0.0648431629 +fft0.133 0.067588754 +fft0.140 0.0702437013 +fft0.147 0.07280422 +fft0.154 0.0752667785 +fft0.161 0.07762824 +fft0.168 0.079885602 +fft0.175 0.0820358396 +fft0.182 0.0840763003 +fft0.189 0.0860032663 +fft0.196 0.0878147036 +fft0.203 0.0895082057 +fft0.210 0.0910812914 +fft0.217 0.0925324336 +fft0.224 0.093859151 +fft0.231 0.0950598419 +fft0.238 0.0961330682 +fft0.245 0.0970772207 +fft0.252 0.0978908315 +fft0.259 0.0985726118 +fft0.266 0.0991218314 +fft0.273 0.0995377526 +fft0.280 0.0998201817 +fft0.287 0.0999688506 +fft0.294 0.0999833122 +fft0.301 0.0998632535 +fft0.308 0.0996090323 +fft0.315 0.0992209911 +fft0.322 0.0986994207 +fft0.329 0.0980448499 +fft0.336 0.0972579271 +fft0.343 0.096339561 +fft0.350 0.0952913463 +fft0.357 0.0941151381 +fft0.364 0.0928125307 +fft0.371 0.091384694 +fft0.378 0.0898332968 +fft0.385 0.0881610215 +fft0.392 0.0863705501 +fft0.399 0.0844639316 +fft0.406 0.0824430436 +fft0.413 0.0803111494 +fft0.420 0.0780712292 +fft0.427 0.075726606 +fft0.434 0.0732799098 +fft0.441 0.0707352906 +fft0.448 0.0680954158 +fft0.455 0.0653640628 +fft0.462 0.0625445396 +fft0.469 0.0596407503 +fft0.476 0.0566568598 +fft0.483 0.0535968989 +fft0.490 0.0504650399 +fft0.497 0.047265362 +fft0.504 0.0440025516 +fft0.511 0.0406806394 +fft0.518 0.0373039804 +fft0.525 0.0338772535 +fft0.532 0.0304044001 +fft0.539 0.0268906225 +fft0.546 0.0233407393 +fft0.553 0.0197595935 +fft0.560 0.0161519572 +fft0.567 0.0125222243 +fft0.574 0.00887576304 +fft0.581 0.00521739153 +fft0.588 0.00155161379 +fft0.595 -0.00211616722 +fft0.602 -0.00578074204 +fft0.609 -0.00943751913 +fft0.616 -0.0130821196 +fft0.623 -0.016709283 +fft0.630 -0.0203140751 +fft0.637 -0.0238916688 +fft0.644 -0.0274379682 +fft0.651 -0.0309473518 +fft0.658 -0.0344157442 +fft0.665 -0.0378380902 +fft0.672 -0.0412090719 +fft0.679 -0.0445243679 +fft0.686 -0.0477798842 +fft0.693 -0.0509716794 +fft0.700 -0.0540943965 +fft0.707 -0.0571447685 +fft0.714 -0.0601187311 +fft0.721 -0.0630117804 +fft0.728 -0.0658199936 +fft0.735 -0.0685401931 +fft0.742 -0.0711685345 +fft0.749 -0.0737011805 +fft0.756 -0.0761348158 +fft0.763 -0.0784665123 +fft0.770 -0.0806935132 +fft0.777 -0.0828120261 +fft0.784 -0.0848195404 +fft0.791 -0.0867135301 +fft0.798 -0.0884909704 +fft0.805 -0.0901500508 +fft0.812 -0.0916889012 +fft0.819 -0.0931048766 +fft0.826 -0.0943958163 +fft0.833 -0.0955599844 +fft0.840 -0.0965960547 +fft0.847 -0.097502321 +fft0.854 -0.0982777849 +fft0.861 -0.0989205986 +fft0.868 -0.0994303748 +fft0.875 -0.0998067632 +fft0.882 -0.100049473 +fft0.889 -0.100157693 +fft0.896 -0.100131303 +fft0.903 -0.0999705195 +fft0.910 -0.0996759236 +fft0.917 -0.0992481038 +fft0.924 -0.0986865833 +fft0.931 -0.0979929417 +fft0.938 -0.0971671939 +fft0.945 -0.0962105095 +fft0.952 -0.0951247513 +fft0.959 -0.0939111337 +fft0.966 -0.0925715789 +fft0.973 -0.0911074504 +fft0.980 -0.0895209685 +fft0.987 -0.0878141001 +fft0.994 -0.0859894231 +fft0.1001 -0.0840493441 +fft0.1008 -0.0819957852 +fft0.1015 -0.0798317343 +fft0.1022 -0.0775601566 +fft0.1029 -0.0751844645 +fft0.1036 -0.0727075264 +fft0.1043 -0.0701327994 +fft0.1050 -0.0674636289 +fft0.1057 -0.0647037476 +fft0.1064 -0.0618566014 +fft0.1071 -0.0589266457 +fft0.1078 -0.0559182316 +fft0.1085 -0.0528346896 +fft0.1092 -0.0496799611 +fft0.1099 -0.0464585684 +fft0.1106 -0.0431746095 +fft0.1113 -0.0398329571 +fft0.1120 -0.0364379846 +fft0.1127 -0.0329938903 +fft0.1134 -0.0295058358 +fft0.1141 -0.0259776898 +fft0.1148 -0.0224148631 +fft0.1155 -0.0188221 +fft0.1162 -0.015204479 +fft0.1169 -0.0115667228 +fft0.1176 -0.00791381486 +fft0.1183 -0.00425006635 +fft0.1190 -0.00058040052 +fft0.1197 0.00309013552 +fft0.1204 0.0067564873 +fft0.1211 0.0104141319 +fft0.1218 0.0140574723 +fft0.1225 0.0176819321 +fft0.1232 0.0212823674 +fft0.1239 0.0248543974 +fft0.1246 0.0283930078 +fft0.1253 0.0318933763 +fft0.1260 0.0353508033 +fft0.1267 0.0387604274 +fft0.1274 0.0421181992 +fft0.1281 0.0454187058 +fft0.1288 0.0486577377 +fft0.1295 0.0518312417 +fft0.1302 0.0549361929 +fft0.1309 0.057966806 +fft0.1316 0.0609199703 +fft0.1323 0.0637919605 +fft0.1330 0.0665783286 +fft0.1337 0.0692740381 +fft0.1344 0.0718770847 +fft0.1351 0.0743833929 +fft0.1358 0.0767886192 +fft0.1365 0.0790902302 +fft0.1372 0.0812861025 +fft0.1379 0.0833736658 +fft0.1386 0.085350506 +fft0.1393 0.0872130767 +fft0.1400 0.0889575556 +fft0.1407 0.0905812904 +fft0.1414 0.0920827985 +fft0.1421 0.0934613124 +fft0.1428 0.0947143659 +fft0.1435 0.0958408192 +fft0.1442 0.0968385413 +fft0.1449 0.0977061167 +fft0.1456 0.098442331 +fft0.1463 0.0990464389 +fft0.1470 0.0995180979 +fft0.1477 0.0998555422 +fft0.1484 0.100059643 +fft0.1491 0.100129783 +fft0.1498 0.100065961 +fft0.1505 0.0998690203 +fft0.1512 0.0995384529 +fft0.1519 0.099074401 +fft0.1526 0.0984774753 +fft0.1533 0.0977486446 +fft0.1540 0.0968881175 +fft0.1547 0.0958971307 +fft0.1554 0.0947764516 +fft0.1561 0.0935287252 +fft0.1568 0.0921552777 +fft0.1575 0.0906576216 +fft0.1582 0.0890381187 +fft0.1589 0.0872992501 +fft0.1596 0.085442245 +fft0.1603 0.0834706351 +fft0.1610 0.0813869312 +fft0.1617 0.0791942701 +fft0.1624 0.0768959075 +fft0.1631 0.0744939595 +fft0.1638 0.0719923899 +fft0.1645 0.0693941265 +fft0.1652 0.0667034611 +fft0.1659 0.0639235601 +fft0.1666 0.061058715 +fft0.1673 0.0581119955 +fft0.1680 0.055087395 +fft0.1687 0.0519890226 +fft0.1694 0.0488204956 +fft0.1701 0.0455863737 +fft0.1708 0.0422914326 +fft0.1715 0.0389393717 +fft0.1722 0.0355341919 +fft0.1729 0.0320810117 +fft0.1736 0.0285859536 +fft0.1743 0.0250529945 +fft0.1750 0.0214867219 +fft0.1757 0.0178924557 +fft0.1764 0.0142738791 +fft0.1771 0.0106361918 +fft0.1778 0.00698383944 +fft0.1785 0.00332162692 +fft0.1792 -0.000344903528 +fft0.1799 -0.00401122356 +fft0.1806 -0.00767367799 +fft0.1813 -0.0113269845 +fft0.1820 -0.0149643673 +fft0.1827 -0.0185810216 +fft0.1834 -0.0221720375 +fft0.1841 -0.0257328916 +fft0.1848 -0.0292588007 +fft0.1855 -0.0327447094 +fft0.1862 -0.0361871049 +fft0.1869 -0.0395807214 +fft0.1876 -0.0429208875 +fft0.1883 -0.0462042391 +fft0.1890 -0.0494255163 +fft0.1897 -0.0525806658 +fft0.1904 -0.0556659438 +fft0.1911 -0.0586767904 +fft0.1918 -0.0616093911 +fft0.1925 -0.0644582883 +fft0.1932 -0.0672200844 +fft0.1939 -0.0698915571 +fft0.1946 -0.0724686012 +fft0.1953 -0.0749477521 +fft0.1960 -0.0773260221 +fft0.1967 -0.0795999393 +fft0.1974 -0.0817667842 +fft0.1981 -0.0838233456 +fft0.1988 -0.0857672021 +fft0.1995 -0.0875962228 +fft0.2002 -0.0893076807 +fft0.2009 -0.0908993483 +fft0.2016 -0.0923693031 +fft0.2023 -0.093715027 +fft0.2030 -0.0949343368 +fft0.2037 -0.096026741 +fft0.2044 -0.0969901606 +fft0.2051 -0.0978234038 +fft0.2058 -0.0985248834 +fft0.2065 -0.0990936086 +fft0.2072 -0.0995291173 +fft0.2079 -0.0998308435 +fft0.2086 -0.0999986976 +fft0.2093 -0.10003221 +fft0.2100 -0.099931322 +fft0.2107 -0.0996962935 +fft0.2114 -0.0993272886 +fft0.2121 -0.0988250375 +fft0.2128 -0.09818995 +fft0.2135 -0.0974228531 +fft0.2142 -0.0965256691 +fft0.2149 -0.0954998285 +fft0.2156 -0.0943453386 +fft0.2163 -0.0930635929 +fft0.2170 -0.0916565433 +fft0.2177 -0.0901257172 +fft0.2184 -0.0884729698 +fft0.2191 -0.0867006779 +fft0.2198 -0.0848116577 +fft0.2205 -0.0828083083 +fft0.2212 -0.0806932151 +fft0.2219 -0.0784696266 +fft0.2226 -0.0761403963 +fft0.2233 -0.073708728 +fft0.2240 -0.0711781606 +fft0.2247 -0.0685519576 +fft0.2254 -0.0658336505 +fft0.2261 -0.0630265325 +fft0.2268 -0.0601350404 +fft0.2275 -0.0571633354 +fft0.2282 -0.0541145205 +fft0.2289 -0.0509927422 +fft0.2296 -0.0478024334 +fft0.2303 -0.0445480794 +fft0.2310 -0.0412337482 +fft0.2317 -0.0378641114 +fft0.2324 -0.0344436429 +fft0.2331 -0.030976776 +fft0.2338 -0.0274678804 +fft0.2345 -0.0239226762 +fft0.2352 -0.0203461815 +fft0.2359 -0.0167428851 +fft0.2366 -0.0131168496 +fft0.2373 -0.00947277248 +fft0.2380 -0.00581570389 +fft0.2387 -0.00215058238 +fft0.2394 0.00151755987 +fft0.2401 0.00518358918 +fft0.2408 0.00884259213 +fft0.2415 0.0124895116 +fft0.2422 0.0161190424 +fft0.2429 0.0197264571 +fft0.2436 0.0233079027 +fft0.2443 0.0268586464 +fft0.2450 0.0303731579 +fft0.2457 0.0338463746 +fft0.2464 0.0372743756 +fft0.2471 0.0406522602 +fft0.2478 0.0439755395 +fft0.2485 0.0472397059 +fft0.2492 0.0504405722 +fft0.2499 0.0535739101 +fft0.2506 0.0566346608 +fft0.2513 0.0596196763 +fft0.2520 0.0625246167 +fft0.2527 0.0653456599 +fft0.2534 0.068078883 +fft0.2541 0.0707201436 +fft0.2548 0.073267065 +fft0.2555 0.0757158473 +fft0.2562 0.0780631229 +fft0.2569 0.080305621 +fft0.2576 0.0824402794 +fft0.2583 0.0844639167 +fft0.2590 0.0863744244 +fft0.2597 0.0881690532 +fft0.2604 0.0898457542 +fft0.2611 0.0914015099 +fft0.2618 0.0928340629 +fft0.2625 0.0941421688 +fft0.2632 0.0953237116 +fft0.2639 0.0963769108 +fft0.2646 0.0973010361 +fft0.2653 0.0980942324 +fft0.2660 0.0987565145 +fft0.2667 0.0992862657 +fft0.2674 0.0996827334 +fft0.2681 0.0999450684 +fft0.2688 0.100073211 +fft0.2695 0.100066938 +fft0.2702 0.0999250337 +fft0.2709 0.099649474 +fft0.2716 0.0992390439 +fft0.2723 0.0986953899 +fft0.2730 0.098019436 +fft0.2737 0.0972119123 +fft0.2744 0.0962727368 +fft0.2751 0.0952042714 +fft0.2758 0.094008401 +fft0.2765 0.092686221 +fft0.2772 0.0912398696 +fft0.2779 0.0896710381 +fft0.2786 0.0879818872 +fft0.2793 0.0861742124 +fft0.2800 0.0842505097 +fft0.2807 0.0822133422 +fft0.2814 0.0800655112 +fft0.2821 0.0778097063 +fft0.2828 0.0754493475 +fft0.2835 0.0729874894 +fft0.2842 0.0704279244 +fft0.2849 0.0677739233 +fft0.2856 0.0650288761 +fft0.2863 0.062196441 +fft0.2870 0.0592807382 +fft0.2877 0.0562854744 +fft0.2884 0.0532143563 +fft0.2891 0.0500716306 +fft0.2898 0.0468613692 +fft0.2905 0.0435884148 +fft0.2912 0.0402570106 +fft0.2919 0.0368715376 +fft0.2926 0.0334365442 +fft0.2933 0.0299569294 +fft0.2940 0.0264368113 +fft0.2947 0.0228813291 +fft0.2954 0.0192949977 +fft0.2961 0.0156826805 +fft0.2968 0.0120490221 +fft0.2975 0.00839926302 +fft0.2982 0.00473860418 +fft0.2989 0.00107136089 +fft0.2996 -0.00259705959 +fft0.3003 -0.00626205839 +fft0.3010 -0.00991843548 +fft0.3017 -0.0135618811 +fft0.3024 -0.0171872135 +fft0.3031 -0.0207898337 +fft0.3038 -0.0243644603 +fft0.3045 -0.0279065315 +fft0.3052 -0.0314113088 +fft0.3059 -0.0348739661 +fft0.3066 -0.0382904559 +fft0.3073 -0.041655872 +fft0.3080 -0.0449654311 +fft0.3087 -0.0482143238 +fft0.3094 -0.0513980426 +fft0.3101 -0.0545128472 +fft0.3108 -0.0575545058 +fft0.3115 -0.0605184473 +fft0.3122 -0.0634005293 +fft0.3129 -0.0661968514 +fft0.3136 -0.0689045191 +fft0.3143 -0.0715196654 +fft0.3150 -0.0740391314 +fft0.3157 -0.0764594451 +fft0.3164 -0.0787772834 +fft0.3171 -0.0809890628 +fft0.3178 -0.0830923989 +fft0.3185 -0.0850842744 +fft0.3192 -0.0869618505 +fft0.3199 -0.0887227654 +fft0.3206 -0.0903643966 +fft0.3213 -0.0918844193 +fft0.3220 -0.0932811871 +fft0.3227 -0.0945528969 +fft0.3234 -0.0956975743 +fft0.3241 -0.0967137516 +fft0.3248 -0.0976004004 +fft0.3255 -0.0983560383 +fft0.3262 -0.0989795402 +fft0.3269 -0.0994701162 +fft0.3276 -0.099826999 +fft0.3283 -0.100049801 +fft0.3290 -0.10013824 +fft0.3297 -0.100092374 +fft0.3304 -0.0999118164 +fft0.3311 -0.0995969102 +fft0.3318 -0.0991483852 +fft0.3325 -0.0985669419 +fft0.3332 -0.0978532061 +fft0.3339 -0.0970079601 +fft0.3346 -0.0960320607 +fft0.3353 -0.0949271172 +fft0.3360 -0.0936945155 +fft0.3367 -0.0923360437 +fft0.3374 -0.0908536911 +fft0.3381 -0.0892496258 +fft0.3388 -0.0875255838 +fft0.3395 -0.085683763 +fft0.3402 -0.083726719 +fft0.3409 -0.0816571638 +fft0.3416 -0.0794780925 +fft0.3423 -0.0771921352 +fft0.3430 -0.0748023465 +fft0.3437 -0.0723120049 +fft0.3444 -0.0697246194 +fft0.3451 -0.0670434535 +fft0.3458 -0.0642722249 +fft0.3465 -0.0614144653 +fft0.3472 -0.0584744327 +fft0.3479 -0.0554560125 +fft0.3486 -0.0523631573 +fft0.3493 -0.0492002405 +fft0.3500 -0.0459714532 +fft0.3507 -0.042680867 +fft0.3514 -0.039332822 +fft0.3521 -0.0359317474 +fft0.3528 -0.0324825272 +fft0.3535 -0.0289896764 +fft0.3542 -0.0254579429 +fft0.3549 -0.0218921434 +fft0.3556 -0.0182970334 +fft0.3563 -0.0146774519 +fft0.3570 -0.0110384785 +fft0.3577 -0.00738463365 +fft0.3584 -0.00372100435 +fft0.3591 -5.25310679e-05 +fft0.3598 0.00361584919 +fft0.3605 0.00727957347 +fft0.3612 0.0109335892 +fft0.3619 0.0145732537 +fft0.3626 0.0181932915 +fft0.3633 0.0217886921 +fft0.3640 0.0253548361 +fft0.3647 0.0288868342 +fft0.3654 0.0323802456 +fft0.3661 0.0358304605 +fft0.3668 0.0392326415 +fft0.3675 0.0425822809 +fft0.3682 0.0458752029 +fft0.3689 0.0491066873 +fft0.3696 0.0522721149 +fft0.3703 0.0553671904 +fft0.3710 0.0583879836 +fft0.3717 0.0613301545 +fft0.3724 0.0641899407 +fft0.3731 0.0669636801 +fft0.3738 0.0696476176 +fft0.3745 0.072238408 +fft0.3752 0.0747320876 +fft0.3759 0.0771252811 +fft0.3766 0.0794147328 +fft0.3773 0.0815972462 +fft0.3780 0.0836701915 +fft0.3787 0.0856310204 +fft0.3794 0.0874769241 +fft0.3801 0.0892053545 +fft0.3808 0.0908141062 +fft0.3815 0.0923013687 +fft0.3822 0.0936649591 +fft0.3829 0.094903335 +fft0.3836 0.0960143209 +fft0.3843 0.0969963819 +fft0.3850 0.0978479683 +fft0.3857 0.0985683054 +fft0.3864 0.0991562903 +fft0.3871 0.099611409 +fft0.3878 0.099932678 +fft0.3885 0.100119844 +fft0.3892 0.100172542 +fft0.3899 0.100090817 +fft0.3906 0.0998748019 +fft0.3913 0.0995249748 +fft0.3920 0.0990413278 +fft0.3927 0.0984246433 +fft0.3934 0.0976756737 +fft0.3941 0.0967952609 +fft0.3948 0.0957850218 +fft0.3955 0.094646126 +fft0.3962 0.0933800489 +fft0.3969 0.0919882804 +fft0.3976 0.0904728025 +fft0.3983 0.0888355896 +fft0.3990 0.0870791003 +fft0.3997 0.0852060318 +fft0.4004 0.0832187012 +fft0.4011 0.0811196566 +fft0.4018 0.0789120644 +fft0.4025 0.0765986145 +fft0.4032 0.0741825253 +fft0.4039 0.0716665164 +fft0.4046 0.0690542534 +fft0.4053 0.066349037 +fft0.4060 0.0635545105 +fft0.4067 0.0606747866 +fft0.4074 0.0577135161 +fft0.4081 0.0546746515 +fft0.4088 0.0515624918 +fft0.4095 0.0483813547 +fft1.0 0.0290423241 +fft1.7 -0.0236568153 +fft1.14 -0.0499625243 +fft1.21 -0.0205322746 +fft1.28 0.0318072326 +fft1.35 0.048675824 +fft1.42 0.0112583349 +fft1.49 -0.0387083553 +fft1.56 -0.0454897247 +fft1.63 -0.00152107084 +fft1.70 0.044154644 +fft1.77 0.0405902788 +fft1.84 -0.00823775679 +fft1.91 -0.0478649549 +fft1.98 -0.0340895467 +fft1.105 0.0177237969 +fft1.112 0.0497820005 +fft1.119 0.0263273064 +fft1.126 -0.0264775865 +fft1.133 -0.0497322045 +fft1.140 -0.0174971521 +fft1.147 0.0342725962 +fft1.154 0.0478325374 +fft1.161 0.00805839896 +fft1.168 -0.0406842306 +fft1.175 -0.0440260097 +fft1.182 0.00176129059 +fft1.189 0.0456060804 +fft1.196 0.0386036374 +fft1.203 -0.0114347842 +fft1.210 -0.0486945771 +fft1.217 -0.0316146426 +fft1.224 0.0207542591 +fft1.231 0.0499993637 +fft1.238 0.0235007256 +fft1.245 -0.0291837938 +fft1.252 -0.0492879525 +fft1.259 -0.0143865235 +fft1.266 0.0365912616 +fft1.273 0.0467841215 +fft1.280 0.00482316967 +fft1.287 -0.0424868315 +fft1.294 -0.0423748754 +fft1.301 0.00503464555 +fft1.308 0.0468604155 +fft1.315 0.0364494883 +fft1.322 -0.0145852072 +fft1.329 -0.049317982 +fft1.336 -0.0290066358 +fft1.343 0.0236935206 +fft1.350 0.0500000529 +fft1.357 0.0205706339 +fft1.364 -0.0317681096 +fft1.371 -0.0486358106 +fft1.378 -0.0112174479 +fft1.385 0.0387501121 +fft1.392 0.0455323532 +fft1.399 0.00156438712 +fft1.406 -0.0441106036 +fft1.413 -0.0405455567 +fft1.420 0.00828321837 +fft1.427 0.0479110517 +fft1.434 0.0341364257 +fft1.441 -0.0176759493 +fft1.448 -0.0497332662 +fft1.455 -0.0262779277 +fft1.462 0.0265274886 +fft1.469 0.0497825295 +fft1.476 0.0175478738 +fft1.483 -0.0342213996 +fft1.490 -0.0477808528 +fft1.497 -0.00800621137 +fft1.504 0.0407368988 +fft1.511 0.0440791808 +fft1.518 -0.00170757691 +fft1.525 -0.0455517992 +fft1.532 -0.0385486893 +fft1.539 0.0114902714 +fft1.546 0.0487503372 +fft1.553 0.0316707678 +fft1.560 -0.0206976607 +fft1.567 -0.049942188 +fft1.574 -0.0234429371 +fft1.581 0.0292420778 +fft1.588 0.049346704 +fft1.595 0.0144455805 +fft1.602 -0.0365318768 +fft1.609 -0.0467244238 +fft1.616 -0.00476318318 +fft1.623 0.0425471924 +fft1.630 0.0424355268 +fft1.637 -0.00497369654 +fft1.644 -0.0467994064 +fft1.651 -0.0363884643 +fft1.658 0.0146462703 +fft1.665 0.049379237 +fft1.672 0.0290681254 +fft1.679 -0.023631908 +fft1.686 -0.049938418 +fft1.693 -0.0205088668 +fft1.700 0.0318300165 +fft1.707 0.048698023 +fft1.714 0.0112799825 +fft1.721 -0.0386873931 +fft1.728 -0.0454695262 +fft1.735 -0.00150166836 +fft1.742 0.0441732779 +fft1.749 0.040608108 +fft1.756 -0.00822071638 +fft1.763 -0.0478487052 +fft1.770 -0.0340741165 +fft1.777 0.0177382808 +fft1.784 0.0497956313 +fft1.791 0.0263402537 +fft1.798 -0.0264652465 +fft1.805 -0.049720522 +fft1.812 -0.0174861327 +fft1.819 0.0342828892 +fft1.826 0.0478421003 +fft1.833 0.0080671683 +fft1.840 -0.0406763218 +fft1.847 -0.0440190211 +fft1.854 0.0017672606 +fft1.861 0.0456110314 +fft1.868 0.0386074781 +fft1.875 -0.0114319064 +fft1.882 -0.0486925766 +fft1.889 -0.0316135213 +fft1.896 0.0207544807 +fft1.903 0.0499987081 +fft1.910 0.0234991964 +fft1.917 -0.029186096 +fft1.924 -0.0492910743 +fft1.931 -0.0143904835 +fft1.938 0.0365864299 +fft1.945 0.0467784069 +fft1.952 0.00481656101 +fft1.959 -0.0424944833 +fft1.966 -0.0423834696 +fft1.973 0.00502525503 +fft1.980 0.0468503721 +fft1.987 0.0364388153 +fft1.994 -0.0145964874 +fft1.1001 -0.0493298955 +fft1.1008 -0.0290192831 +fft1.1015 0.0236801095 +fft1.1022 0.049985949 +fft1.1029 0.0205557384 +fft1.1036 -0.0317839049 +fft1.1043 -0.0486525819 +fft1.1050 -0.0112351328 +fft1.1057 0.0387315378 +fft1.1064 0.0455128103 +fft1.1071 0.00154405634 +fft1.1078 -0.044131726 +fft1.1085 -0.0405675024 +fft1.1092 0.00826041028 +fft1.1099 0.0478874929 +fft1.1106 0.0341120213 +fft1.1113 -0.0177012365 +fft1.1120 -0.0497593209 +fft1.1127 -0.0263046436 +fft1.1134 0.0265001319 +fft1.1141 0.0497546867 +fft1.1148 0.0175195355 +fft1.1155 -0.0342503898 +fft1.1162 -0.0478104427 +fft1.1169 -0.00803639367 +fft1.1176 0.040706072 +fft1.1183 0.044047717 +fft1.1190 -0.00173965644 +fft1.1197 -0.0455845855 +fft1.1204 -0.0385821797 +fft1.1211 0.0114561822 +fft1.1218 0.0487159528 +fft1.1225 0.0316359811 +fft1.1232 -0.0207329914 +fft1.1239 -0.0499781445 +fft1.1246 -0.0234795064 +fft1.1253 0.029204959 +fft1.1260 0.0493089929 +fft1.1267 0.0144073954 +fft1.1274 -0.0365705863 +fft1.1281 -0.0467637368 +fft1.1288 -0.00480308617 +fft1.1295 0.0425068289 +fft1.1302 0.0423948579 +fft1.1309 -0.00501470361 +fft1.1316 -0.0468406305 +fft1.1323 -0.0364298373 +fft1.1330 0.0146048004 +fft1.1337 0.0493376032 +fft1.1344 0.0290264506 +fft1.1351 -0.0236735791 +fft1.1358 -0.0499801226 +fft1.1365 -0.0205507353 +fft1.1372 0.0317880064 +fft1.1379 0.048655767 +fft1.1386 0.0112374593 +fft1.1393 -0.03873007 +fft1.1400 -0.0455123074 +fft1.1407 -0.00154452457 +fft1.1414 0.0441303067 +fft1.1421 0.0405651331 +fft1.1428 -0.00826364197 +fft1.1435 -0.0478916019 +fft1.1442 -0.0341170356 +fft1.1449 0.0176953077 +fft1.1456 0.0497525781 +fft1.1463 0.0262970813 +fft1.1470 -0.0265085995 +fft1.1477 -0.0497640036 +fft1.1484 -0.0175297558 +fft1.1491 0.0342391282 +fft1.1498 0.0477983057 +fft1.1505 0.00802335795 +fft1.1512 -0.0407201238 +fft1.1519 -0.0440628491 +fft1.1526 0.00172338949 +fft1.1533 0.0455670953 +fft1.1540 0.0385636315 +fft1.1547 -0.0114756599 +fft1.1554 -0.0487362482 +fft1.1561 -0.031657178 +fft1.1568 0.0207108241 +fft1.1575 0.0499550402 +fft1.1582 0.0234554969 +fft1.1589 -0.0292299408 +fft1.1596 -0.0493350178 +fft1.1603 -0.0144344596 +fft1.1610 0.0365424789 +fft1.1617 0.0467345081 +fft1.1624 0.00477275951 +fft1.1631 -0.0425381325 +fft1.1638 -0.0424269699 +fft1.1645 0.00498184469 +fft1.1652 0.0468070507 +fft1.1659 0.036395561 +fft1.1666 -0.0146397287 +fft1.1673 -0.0493731759 +fft1.1680 -0.0290625151 +fft1.1687 0.0236370061 +fft1.1694 0.0499430075 +fft1.1701 0.0205130484 +fft1.1708 -0.0318262167 +fft1.1715 -0.0486945398 +fft1.1722 -0.0112768309 +fft1.1729 0.0386901349 +fft1.1736 0.0454717427 +fft1.1743 0.00150343229 +fft1.1750 -0.0441717952 +fft1.1757 -0.0406069495 +fft1.1764 0.00822156109 +fft1.1771 0.0478491634 +fft1.1778 0.0340742357 +fft1.1785 -0.0177385304 +fft1.1792 -0.0497960262 +fft1.1799 -0.0263406672 +fft1.1806 0.0264648478 +fft1.1813 0.0497200601 +fft1.1820 0.0174856596 +fft1.1827 -0.0342833214 +fft1.1834 -0.047842484 +fft1.1841 -0.00806757994 +fft1.1848 0.0406757519 +fft1.1855 0.044018209 +fft1.1862 -0.00176820136 +fft1.1869 -0.0456122123 +fft1.1876 -0.0386090316 +fft1.1883 0.0114299972 +fft1.1890 0.048690334 +fft1.1897 0.0316110738 +fft1.1904 -0.0207571462 +fft1.1911 -0.0500015207 +fft1.1918 -0.0235022362 +fft1.1925 0.029182801 +fft1.1932 0.0492874049 +fft1.1939 0.0143863428 +fft1.1946 -0.036591012 +fft1.1953 -0.0467835777 +fft1.1960 -0.00482239481 +fft1.1967 0.0424879976 +fft1.1974 0.0423763692 +fft1.1981 -0.00503279781 +fft1.1988 -0.0468582809 +fft1.1995 -0.0364469849 +fft1.2002 0.0145880692 +fft1.2009 0.0493213274 +fft1.2016 0.0290105827 +fft1.2023 -0.0236889832 +fft1.2030 -0.0499950312 +fft1.2037 -0.0205650348 +fft1.2044 0.0317743272 +fft1.2051 0.0486426279 +fft1.2058 0.0112247756 +fft1.2065 -0.0387424156 +fft1.2072 -0.0455243401 +fft1.2079 -0.00155613222 +fft1.2086 0.0441191643 +fft1.2093 0.0405543782 +fft1.2100 -0.00827402715 +fft1.2107 -0.0479016155 +fft1.2114 -0.0341266096 +fft1.2121 0.0176862404 +fft1.2128 0.0497439317 +fft1.2135 0.0262888838 +fft1.2142 -0.0265163332 +fft1.2149 -0.0497712828 +fft1.2156 -0.017536575 +fft1.2163 0.0342327468 +fft1.2170 0.0477922894 +fft1.2177 0.00801777467 +fft1.2184 -0.0407251492 +fft1.2191 -0.0440673456 +fft1.2198 0.00171943172 +fft1.2205 0.0455636345 +fft1.2212 0.0385605022 +fft1.2219 -0.0114785749 +fft1.2226 -0.0487389565 +fft1.2233 -0.0316597 +fft1.2240 0.0207085479 +fft1.2247 0.0499530435 +fft1.2254 0.0234538428 +fft1.2261 -0.0292311292 +fft1.2268 -0.0493357256 +fft1.2275 -0.014434671 +fft1.2282 0.0365426466 +fft1.2289 0.0467350446 +fft1.2296 0.00477369921 +fft1.2303 -0.0425368138 +fft1.2310 -0.0424253494 +fft1.2317 0.0049836454 +fft1.2324 0.0468089841 +fft1.2331 0.0363977104 +fft1.2338 -0.0146373278 +fft1.2345 -0.0493705384 +fft1.2352 -0.0290597398 +fft1.2359 0.0236400049 +fft1.2366 0.0499462485 +fft1.2373 0.0205165967 +fft1.2380 -0.0318224281 +fft1.2387 -0.0486904606 +fft1.2394 -0.0112723904 +fft1.2401 0.0386948846 +fft1.2408 0.0454767905 +fft1.2415 0.00150863582 +fft1.2422 -0.0441666171 +fft1.2429 -0.0406017564 +fft1.2436 0.00822678488 +fft1.2443 0.0478545316 +fft1.2450 0.034079697 +fft1.2457 -0.0177329425 +fft1.2464 -0.0497904494 +fft1.2471 -0.0263352022 +fft1.2478 0.0264701564 +fft1.2485 0.0497252718 +fft1.2492 0.0174906813 +fft1.2499 -0.0342786759 +fft1.2506 -0.0478382595 +fft1.2513 -0.0080637252 +fft1.2520 0.0406792276 +fft1.2527 0.0440212525 +fft1.2534 -0.00176569179 +fft1.2541 -0.045610074 +fft1.2548 -0.0386071429 +fft1.2555 0.0114316037 +fft1.2562 0.0486916825 +fft1.2569 0.0316121429 +fft1.2576 -0.0207562689 +fft1.2583 -0.0500007868 +fft1.2590 -0.0235015936 +fft1.2597 0.0291834269 +fft1.2604 0.0492881276 +fft1.2611 0.0143870683 +fft1.2618 -0.036590308 +fft1.2625 -0.0467827804 +fft1.2632 -0.0048214742 +fft1.2639 0.0424889773 +fft1.2646 0.0423774421 +fft1.2653 -0.00503173331 +fft1.2660 -0.0468571708 +fft1.2667 -0.0364458673 +fft1.2674 0.0145892277 +fft1.2681 0.0493224077 +fft1.2688 0.0290115774 +fft1.2695 -0.0236880984 +fft1.2702 -0.0499942303 +fft1.2709 -0.0205642954 +fft1.2716 0.0317750052 +fft1.2723 0.0486432947 +fft1.2730 0.011225529 +fft1.2737 -0.0387414582 +fft1.2744 -0.04552304 +fft1.2751 -0.00155447854 +fft1.2758 0.0441210195 +fft1.2765 0.0405564457 +fft1.2772 -0.00827174447 +fft1.2779 -0.0478991531 +fft1.2786 -0.034124095 +fft1.2793 0.017688863 +fft1.2800 0.0497466847 +fft1.2807 0.0262916628 +fft1.2814 -0.0265134834 +fft1.2821 -0.0497683436 +fft1.2828 -0.0175336376 +fft1.2835 0.0342356488 +fft1.2842 0.0477951989 +fft1.2849 0.0080205556 +fft1.2856 -0.0407224521 +fft1.2863 -0.0440646261 +fft1.2870 0.00172222848 +fft1.2877 0.0455666296 +fft1.2884 0.0385638103 +fft1.2891 -0.0114749447 +fft1.2898 -0.0487349778 +fft1.2905 -0.0316552706 +fft1.2912 0.0207133703 +fft1.2919 0.0499581844 +fft1.2926 0.0234592613 +fft1.2933 -0.0292254873 +fft1.2940 -0.0493299253 +fft1.2947 -0.0144288493 +fft1.2954 0.0365485698 +fft1.2961 0.0467411242 +fft1.2968 0.00477996003 +fft1.2975 -0.0425304733 +fft1.2982 -0.0424189866 +fft1.2989 0.00499012414 +fft1.2996 0.0468156189 +fft1.3003 0.0364043415 +fft1.3010 -0.0146306492 +fft1.3017 -0.049363751 +fft1.3024 -0.0290528182 +fft1.3031 0.0236470085 +fft1.3038 0.0499532782 +fft1.3045 0.0205235686 +fft1.3052 -0.0318154767 +fft1.3059 -0.0486835279 +fft1.3066 -0.011265547 +fft1.3073 0.0387017429 +fft1.3080 0.0454836562 +fft1.3087 0.00151547755 +fft1.3094 -0.0441596843 +fft1.3101 -0.0405946113 +fft1.3108 0.00823416561 +fft1.3115 0.047862146 +fft1.3122 0.0340875834 +fft1.3129 -0.0177247543 +fft1.3136 -0.0497819856 +fft1.3143 -0.0263264272 +fft1.3150 0.0264792703 +fft1.3157 0.0497347489 +fft1.3164 0.0175005198 +fft1.3171 -0.0342683382 +fft1.3178 -0.0478274859 +fft1.3185 -0.00805247296 +fft1.3192 0.0406910554 +fft1.3199 0.0440338403 +fft1.3206 -0.00175240671 +fft1.3213 -0.04559616 +fft1.3220 -0.0385927707 +fft1.3227 0.0114465598 +fft1.3234 0.0487072915 +fft1.3241 0.0316283479 +fft1.3248 -0.0207394678 +fft1.3255 -0.0499835424 +fft1.3262 -0.0234838501 +fft1.3269 0.0292015616 +fft1.3276 0.0493064485 +fft1.3283 0.0144056799 +fft1.3290 -0.0365714319 +fft1.3297 -0.0467636175 +fft1.3304 -0.00480207801 +fft1.3311 0.042508781 +fft1.3318 0.0423977152 +fft1.3325 -0.00501090381 +fft1.3332 -0.0468359068 +fft1.3339 -0.0364242047 +fft1.3346 0.0146113662 +fft1.3353 0.0493449457 +fft1.3360 0.0290345177 +fft1.3367 -0.0236648023 +fft1.3374 -0.049970571 +fft1.3381 -0.0205402914 +fft1.3388 0.0317993239 +fft1.3395 0.0486679599 +fft1.3402 0.0112505304 +fft1.3409 -0.0387161151 +fft1.3416 -0.0454974025 +fft1.3423 -0.00152865541 +fft1.3430 0.0441470928 +fft1.3437 0.0405827425 +fft1.3444 -0.0082452381 +fft1.3451 -0.047872372 +fft1.3458 -0.034097001 +fft1.3465 0.0177161507 +fft1.3472 0.0497740097 +fft1.3479 0.0263190977 +fft1.3486 -0.0264859647 +fft1.3493 -0.0497406535 +fft1.3500 -0.0175057072 +fft1.3507 0.0342638381 +fft1.3514 0.0478236191 +fft1.3521 0.00804931857 +fft1.3528 -0.0406933241 +fft1.3535 -0.0440351665 +fft1.3542 0.00175198982 +fft1.3549 0.0455966666 +fft1.3556 0.0385941602 +fft1.3563 -0.0114441384 +fft1.3570 -0.0487037152 +fft1.3577 -0.0316237845 +fft1.3584 0.020745052 +fft1.3591 0.0499901101 +fft1.3598 0.023491418 +fft1.3605 -0.0291930996 +fft1.3612 -0.0492972769 +fft1.3619 -0.0143957883 +fft1.3626 0.0365819968 +fft1.3633 0.0467749052 +fft1.3640 0.00481389882 +fft1.3647 -0.0424963161 +fft1.3654 -0.0423844792 +fft1.3661 0.00502495468 +fft1.3668 0.0468508638 +fft1.3675 0.036440026 +fft1.3682 -0.0145945968 +fft1.3689 -0.0493274145 +fft1.3696 -0.0290161744 +fft1.3703 0.0236840043 +fft1.3710 0.0499906316 +fft1.3717 0.0205612276 +fft1.3724 -0.0317774899 +fft1.3731 -0.0486452803 +fft1.3738 -0.0112269362 +fft1.3745 0.0387406684 +fft1.3752 0.0455229096 +fft1.3759 0.00155507331 +fft1.3766 -0.0441198014 +fft1.3773 -0.0405545831 +fft1.3780 0.00827431493 +fft1.3787 0.0479024686 +fft1.3794 0.0341280922 +fft1.3801 -0.0176840406 +fft1.3808 -0.0497410633 +fft1.3815 -0.0262853522 +fft1.3822 0.026520459 +fft1.3829 0.0497759618 +fft1.3836 0.0175418463 +fft1.3843 -0.0342269428 +fft1.3850 -0.0477860793 +fft1.3857 -0.00801108964 +fft1.3864 0.0407323763 +fft1.3871 0.0440751016 +fft1.3878 -0.001711105 +fft1.3885 -0.0455549173 +fft1.3892 -0.0385514833 +fft1.3899 0.0114877578 +fft1.3906 0.048748266 +fft1.3913 0.0316690877 +fft1.3920 -0.0206990503 +fft1.3927 -0.0499433093 +fft1.3934 -0.0234439466 +fft1.3941 0.0292411391 +fft1.3948 0.0493458398 +fft1.3955 0.0144447414 +fft1.3962 -0.0365326963 +fft1.3969 -0.04672518 +fft1.3976 -0.00476395851 +fft1.3983 0.0425463207 +fft1.3990 0.0424344912 +fft1.3997 -0.00497490633 +fft1.4004 -0.0468006693 +fft1.4011 -0.0363897458 +fft1.4018 0.0146448901 +fft1.4025 0.0493776724 +fft1.4032 0.0290662926 +fft1.4039 -0.0236339886 +fft1.4046 -0.0499406792 +fft1.4053 -0.0205112956 +fft1.4060 0.031827271 +fft1.4067 0.0486948602 +fft1.4074 0.0112763839 +fft1.4081 -0.0386914276 +fft1.4088 -0.045473963 +fft1.4095 -0.0015065131 +sessionPeakDBC 115.249191 +noiseDose 0.0103443721 diff --git a/Tests/golden/stereo_noise_sine.txt b/Tests/golden/stereo_noise_sine.txt new file mode 100644 index 0000000..f04b1dd --- /dev/null +++ b/Tests/golden/stereo_noise_sine.txt @@ -0,0 +1,2404 @@ +# SPLMeter processor golden output: stereo_noise_sine +blk9.peakSPL -999 +blk9.peakDBA -999 +blk9.peakDBC -999 +blk9.rmsSPL -999 +blk9.rmsDBA -999 +blk9.rmsDBC -999 +blk9.rough 0 +blk9.sharp 0.471134841 +blk9.fluct 0 +blk9.impuls 8.7295084 +blk9.tonal 86.8748932 +blk19.peakSPL 114.90358 +blk19.peakDBA 109.188797 +blk19.peakDBC 129.411621 +blk19.rmsSPL 106.61776 +blk19.rmsDBA 96.7662048 +blk19.rmsDBC 119.418449 +blk19.rough 36.4937668 +blk19.sharp 0.481066048 +blk19.fluct 0 +blk19.impuls 7.16735697 +blk19.tonal 86.1179733 +blk29.peakSPL 114.944565 +blk29.peakDBA 110.017288 +blk29.peakDBC 129.411621 +blk29.rmsSPL 108.050674 +blk29.rmsDBA 98.2826691 +blk29.rmsDBC 120.671295 +blk29.rough 36.4937668 +blk29.sharp 0.454411477 +blk29.fluct 0 +blk29.impuls 6.36072588 +blk29.tonal 87.0726776 +blk39.peakSPL 114.946648 +blk39.peakDBA 110.017288 +blk39.peakDBC 129.411621 +blk39.rmsSPL 108.43071 +blk39.rmsDBA 98.6243439 +blk39.rmsDBC 121.215256 +blk39.rough 29.4642258 +blk39.sharp 0.50306797 +blk39.fluct 0 +blk39.impuls 6.40454578 +blk39.tonal 87.5435028 +blk49.peakSPL 114.946648 +blk49.peakDBA 110.017288 +blk49.peakDBC 129.436722 +blk49.rmsSPL 108.573601 +blk49.rmsDBA 98.8154068 +blk49.rmsDBC 121.339386 +blk49.rough 29.4642258 +blk49.sharp 0.470661223 +blk49.fluct 0 +blk49.impuls 6.16747999 +blk49.tonal 87.0306244 +blk59.peakSPL 114.946648 +blk59.peakDBA 110.017288 +blk59.peakDBC 129.436722 +blk59.rmsSPL 108.573601 +blk59.rmsDBA 98.8154068 +blk59.rmsDBC 121.339386 +blk59.rough 29.6881905 +blk59.sharp 0.488539487 +blk59.fluct 0 +blk59.impuls 6.16725588 +blk59.tonal 86.7322311 +blk69.peakSPL 114.946648 +blk69.peakDBA 110.017288 +blk69.peakDBC 129.436722 +blk69.rmsSPL 108.567619 +blk69.rmsDBA 98.8185272 +blk69.rmsDBC 121.45121 +blk69.rough 29.6881905 +blk69.sharp 0.506225169 +blk69.fluct 0 +blk69.impuls 6.14814186 +blk69.tonal 86.101944 +blk79.peakSPL 114.95787 +blk79.peakDBA 110.017288 +blk79.peakDBC 129.436722 +blk79.rmsSPL 108.559029 +blk79.rmsDBA 98.9058685 +blk79.rmsDBC 121.416519 +blk79.rough 29.2133274 +blk79.sharp 0.479425877 +blk79.fluct 0 +blk79.impuls 6.02842093 +blk79.tonal 85.7148743 +blk89.peakSPL 114.95787 +blk89.peakDBA 110.017288 +blk89.peakDBC 129.452438 +blk89.rmsSPL 108.611351 +blk89.rmsDBA 98.997467 +blk89.rmsDBC 121.407249 +blk89.rough 29.2133274 +blk89.sharp 0.45835039 +blk89.fluct 0 +blk89.impuls 6.03537941 +blk89.tonal 86.9182053 +blk99.peakSPL 114.95787 +blk99.peakDBA 110.017288 +blk99.peakDBC 129.452438 +blk99.rmsSPL 108.64164 +blk99.rmsDBA 98.7362137 +blk99.rmsDBC 121.466072 +blk99.rough 29.2372189 +blk99.sharp 0.465541333 +blk99.fluct 41.4514427 +blk99.impuls 6.14996767 +blk99.tonal 87.5372925 +blk109.peakSPL 114.95787 +blk109.peakDBA 110.017288 +blk109.peakDBC 129.452438 +blk109.rmsSPL 108.64164 +blk109.rmsDBA 98.7362137 +blk109.rmsDBC 121.466072 +blk109.rough 29.2372189 +blk109.sharp 0.4539482 +blk109.fluct 41.4514427 +blk109.impuls 6.1488986 +blk109.tonal 87.4220581 +blk119.peakSPL 114.95787 +blk119.peakDBA 110.017288 +blk119.peakDBC 129.452438 +blk119.rmsSPL 108.620071 +blk119.rmsDBA 98.8203964 +blk119.rmsDBC 121.432785 +blk119.rough 29.3317776 +blk119.sharp 0.478028566 +blk119.fluct 41.4514427 +blk119.impuls 6.21996593 +blk119.tonal 86.8447723 +blk129.peakSPL 114.95787 +blk129.peakDBA 110.017288 +blk129.peakDBC 129.452438 +blk129.rmsSPL 108.603188 +blk129.rmsDBA 98.8016739 +blk129.rmsDBC 121.491913 +blk129.rough 29.3317776 +blk129.sharp 0.457200766 +blk129.fluct 41.4514427 +blk129.impuls 6.09000349 +blk129.tonal 87.8997269 +blk139.peakSPL 114.95787 +blk139.peakDBA 110.017288 +blk139.peakDBC 129.452438 +blk139.rmsSPL 108.639069 +blk139.rmsDBA 98.7912216 +blk139.rmsDBC 121.499451 +blk139.rough 29.6577148 +blk139.sharp 0.45620963 +blk139.fluct 41.4514427 +blk139.impuls 6.13968277 +blk139.tonal 85.5113449 +blk149.peakSPL 114.95787 +blk149.peakDBA 110.017288 +blk149.peakDBC 129.530411 +blk149.rmsSPL 108.617973 +blk149.rmsDBA 98.9568787 +blk149.rmsDBC 121.408356 +blk149.rough 29.6577148 +blk149.sharp 0.481784374 +blk149.fluct 41.4514427 +blk149.impuls 6.1702733 +blk149.tonal 86.4821548 +blk159.peakSPL 114.95787 +blk159.peakDBA 110.017288 +blk159.peakDBC 129.530411 +blk159.rmsSPL 108.617973 +blk159.rmsDBA 98.9568787 +blk159.rmsDBC 121.408356 +blk159.rough 29.2375507 +blk159.sharp 0.488854975 +blk159.fluct 41.4514427 +blk159.impuls 6.20772648 +blk159.tonal 86.8673172 +blk169.peakSPL 114.95787 +blk169.peakDBA 110.017288 +blk169.peakDBC 129.530411 +blk169.rmsSPL 108.598869 +blk169.rmsDBA 98.9197693 +blk169.rmsDBC 121.442535 +blk169.rough 29.2375507 +blk169.sharp 0.497224003 +blk169.fluct 41.4514427 +blk169.impuls 6.04478741 +blk169.tonal 86.6081696 +blk179.peakSPL 114.95787 +blk179.peakDBA 110.017288 +blk179.peakDBC 129.530411 +blk179.rmsSPL 108.608299 +blk179.rmsDBA 98.8440857 +blk179.rmsDBC 121.426125 +blk179.rough 29.681715 +blk179.sharp 0.487709552 +blk179.fluct 41.4514427 +blk179.impuls 6.24782133 +blk179.tonal 85.9414291 +blk189.peakSPL 114.95787 +blk189.peakDBA 110.017288 +blk189.peakDBC 129.530411 +blk189.rmsSPL 108.584 +blk189.rmsDBA 98.9552078 +blk189.rmsDBC 121.324356 +blk189.rough 29.681715 +blk189.sharp 0.477400333 +blk189.fluct 41.4514427 +blk189.impuls 5.90386963 +blk189.tonal 86.2420197 +blk199.peakSPL 114.95787 +blk199.peakDBA 110.017288 +blk199.peakDBC 129.530411 +blk199.rmsSPL 108.580132 +blk199.rmsDBA 98.8741608 +blk199.rmsDBC 121.419952 +blk199.rough 29.0921917 +blk199.sharp 0.466611654 +blk199.fluct 4.14615059 +blk199.impuls 6.0539279 +blk199.tonal 86.9117661 +blk209.peakSPL 114.95787 +blk209.peakDBA 110.017288 +blk209.peakDBC 129.530411 +blk209.rmsSPL 108.580132 +blk209.rmsDBA 98.8741608 +blk209.rmsDBC 121.419952 +blk209.rough 29.0921917 +blk209.sharp 0.456246763 +blk209.fluct 4.14615059 +blk209.impuls 6.12209368 +blk209.tonal 86.7535629 +blk219.peakSPL 114.95787 +blk219.peakDBA 110.017288 +blk219.peakDBC 129.566071 +blk219.rmsSPL 108.59053 +blk219.rmsDBA 98.859993 +blk219.rmsDBC 121.37822 +blk219.rough 29.0013924 +blk219.sharp 0.466301113 +blk219.fluct 4.14615059 +blk219.impuls 6.2372365 +blk219.tonal 86.4673309 +blk229.peakSPL 114.95787 +blk229.peakDBA 108.530205 +blk229.peakDBC 129.566071 +blk229.rmsSPL 108.639664 +blk229.rmsDBA 98.8484116 +blk229.rmsDBC 121.441238 +blk229.rough 29.0013924 +blk229.sharp 0.461490989 +blk229.fluct 4.14615059 +blk229.impuls 6.09802723 +blk229.tonal 85.578598 +blk239.peakSPL 114.95787 +blk239.peakDBA 109.180527 +blk239.peakDBC 129.566071 +blk239.rmsSPL 108.674286 +blk239.rmsDBA 98.8357391 +blk239.rmsDBC 121.391075 +blk239.rough 30.3978462 +blk239.sharp 0.459780425 +blk239.fluct 4.14615059 +blk239.impuls 6.1558156 +blk239.tonal 87.9194031 +blk249.peakSPL 114.95787 +blk249.peakDBA 109.180527 +blk249.peakDBC 129.566071 +blk249.rmsSPL 108.659927 +blk249.rmsDBA 98.7817841 +blk249.rmsDBC 121.444809 +blk249.rough 30.3978462 +blk249.sharp 0.498025119 +blk249.fluct 4.14615059 +blk249.impuls 6.09160089 +blk249.tonal 88.1547699 +blk259.peakSPL 114.95787 +blk259.peakDBA 109.180527 +blk259.peakDBC 129.566071 +blk259.rmsSPL 108.659927 +blk259.rmsDBA 98.7817841 +blk259.rmsDBC 121.444809 +blk259.rough 29.7774639 +blk259.sharp 0.473533303 +blk259.fluct 4.14615059 +blk259.impuls 6.08498907 +blk259.tonal 86.0085602 +blk269.peakSPL 114.95787 +blk269.peakDBA 109.180527 +blk269.peakDBC 129.566071 +blk269.rmsSPL 108.617241 +blk269.rmsDBA 98.7796631 +blk269.rmsDBC 121.407562 +blk269.rough 29.7774639 +blk269.sharp 0.500337541 +blk269.fluct 4.14615059 +blk269.impuls 6.00569725 +blk269.tonal 86.2401047 +blk279.peakSPL 114.645981 +blk279.peakDBA 109.180527 +blk279.peakDBC 129.566071 +blk279.rmsSPL 108.587334 +blk279.rmsDBA 98.8180389 +blk279.rmsDBC 121.445801 +blk279.rough 29.0957508 +blk279.sharp 0.468885452 +blk279.fluct 4.14615059 +blk279.impuls 6.2680192 +blk279.tonal 86.714653 +blk289.peakSPL 114.956627 +blk289.peakDBA 109.180527 +blk289.peakDBC 129.566071 +blk289.rmsSPL 108.679817 +blk289.rmsDBA 98.8470688 +blk289.rmsDBC 121.533371 +blk289.rough 29.0957508 +blk289.sharp 0.438731849 +blk289.fluct 4.14615059 +blk289.impuls 6.06774187 +blk289.tonal 86.5802536 +blk299.peakSPL 114.956627 +blk299.peakDBA 109.601822 +blk299.peakDBC 129.566071 +blk299.rmsSPL 108.677185 +blk299.rmsDBA 98.6931381 +blk299.rmsDBC 121.509018 +blk299.rough 30.056057 +blk299.sharp 0.461650014 +blk299.fluct 3.94871402 +blk299.impuls 6.13778019 +blk299.tonal 88.526329 +log.count 24 +log0.peakSPL 114.90358 +log0.peakDBA 109.188797 +log0.peakDBC 129.411621 +log0.rmsSPL 106.61776 +log0.rmsDBA 96.7662048 +log0.rmsDBC 119.418449 +log0.rough 0 +log0.fluct 0 +log0.sharp 0.449832529 +log0.sone 51.1485176 +log0.impuls 8.11741638 +log0.tonal 87.5592728 +log0.annoy 51.1485176 +log1.peakSPL 114.944565 +log1.peakDBA 110.017288 +log1.peakDBC 129.411621 +log1.rmsSPL 108.050674 +log1.rmsDBA 98.2826691 +log1.rmsDBC 120.671295 +log1.rough 36.4937668 +log1.fluct 0 +log1.sharp 0.434300303 +log1.sone 56.8176422 +log1.impuls 6.48478031 +log1.tonal 87.0714264 +log1.annoy 91.3650818 +log2.peakSPL 114.946648 +log2.peakDBA 110.017288 +log2.peakDBC 129.411621 +log2.rmsSPL 108.43071 +log2.rmsDBA 98.6243439 +log2.rmsDBC 121.215256 +log2.rough 36.4937668 +log2.fluct 0 +log2.sharp 0.472841352 +log2.sone 58.1793137 +log2.impuls 6.3636322 +log2.tonal 87.3328094 +log2.annoy 93.8914185 +log3.peakSPL 114.946648 +log3.peakDBA 110.017288 +log3.peakDBC 129.436722 +log3.rmsSPL 108.573601 +log3.rmsDBA 98.8154068 +log3.rmsDBC 121.339386 +log3.rough 29.4642258 +log3.fluct 0 +log3.sharp 0.470661223 +log3.sone 58.9549408 +log3.impuls 6.16747999 +log3.tonal 87.0306244 +log3.annoy 91.644249 +log4.peakSPL 114.946648 +log4.peakDBA 110.017288 +log4.peakDBC 129.436722 +log4.rmsSPL 108.567619 +log4.rmsDBA 98.8185272 +log4.rmsDBC 121.45121 +log4.rough 29.6881905 +log4.fluct 0 +log4.sharp 0.483780861 +log4.sone 58.9676857 +log4.impuls 6.20923662 +log4.tonal 87.3999863 +log4.annoy 91.7909317 +log5.peakSPL 114.95787 +log5.peakDBA 110.017288 +log5.peakDBC 129.436722 +log5.rmsSPL 108.559029 +log5.rmsDBA 98.9058685 +log5.rmsDBC 121.416519 +log5.rough 29.6881905 +log5.fluct 0 +log5.sharp 0.478416562 +log5.sone 59.3257637 +log5.impuls 6.23643589 +log5.tonal 86.0181046 +log5.annoy 92.4283981 +log6.peakSPL 114.95787 +log6.peakDBA 110.017288 +log6.peakDBC 129.452438 +log6.rmsSPL 108.611351 +log6.rmsDBA 98.997467 +log6.rmsDBC 121.407249 +log6.rough 29.2133274 +log6.fluct 0 +log6.sharp 0.474253178 +log6.sone 59.7036362 +log6.impuls 6.10101461 +log6.tonal 87.0930176 +log6.annoy 92.8336487 +log7.peakSPL 114.95787 +log7.peakDBA 110.017288 +log7.peakDBC 129.452438 +log7.rmsSPL 108.64164 +log7.rmsDBA 98.7362137 +log7.rmsDBC 121.466072 +log7.rough 29.2372189 +log7.fluct 41.4514427 +log7.sharp 0.465541333 +log7.sone 58.632206 +log7.impuls 6.14996767 +log7.tonal 87.5372925 +log7.annoy 104.412689 +log8.peakSPL 114.95787 +log8.peakDBA 110.017288 +log8.peakDBC 129.452438 +log8.rmsSPL 108.620071 +log8.rmsDBA 98.8203964 +log8.rmsDBC 121.432785 +log8.rough 29.2372189 +log8.fluct 41.4514427 +log8.sharp 0.465572864 +log8.sone 58.9753227 +log8.impuls 6.02196836 +log8.tonal 86.9421616 +log8.annoy 105.131302 +log9.peakSPL 114.95787 +log9.peakDBA 110.017288 +log9.peakDBC 129.452438 +log9.rmsSPL 108.603188 +log9.rmsDBA 98.8016739 +log9.rmsDBC 121.491913 +log9.rough 29.3317776 +log9.fluct 41.4514427 +log9.sharp 0.462105542 +log9.sone 58.8988457 +log9.impuls 6.1388526 +log9.tonal 87.3490295 +log9.annoy 105.023605 +log10.peakSPL 114.95787 +log10.peakDBA 110.017288 +log10.peakDBC 129.452438 +log10.rmsSPL 108.639069 +log10.rmsDBA 98.7912216 +log10.rmsDBC 121.499451 +log10.rough 29.3317776 +log10.fluct 41.4514427 +log10.sharp 0.45645234 +log10.sone 58.8561897 +log10.impuls 6.13020086 +log10.tonal 86.8820953 +log10.annoy 104.934189 +log11.peakSPL 114.95787 +log11.peakDBA 110.017288 +log11.peakDBC 129.530411 +log11.rmsSPL 108.617973 +log11.rmsDBA 98.9568787 +log11.rmsDBC 121.408356 +log11.rough 29.6577148 +log11.fluct 41.4514427 +log11.sharp 0.481784374 +log11.sone 59.5359039 +log11.impuls 6.1702733 +log11.tonal 86.4821548 +log11.annoy 106.543831 +log12.peakSPL 114.95787 +log12.peakDBA 110.017288 +log12.peakDBC 129.530411 +log12.rmsSPL 108.598869 +log12.rmsDBA 98.9197693 +log12.rmsDBC 121.442535 +log12.rough 29.2375507 +log12.fluct 41.4514427 +log12.sharp 0.470932662 +log12.sone 59.3829498 +log12.impuls 6.23692226 +log12.tonal 86.248024 +log12.annoy 105.986366 +log13.peakSPL 114.95787 +log13.peakDBA 110.017288 +log13.peakDBC 129.530411 +log13.rmsSPL 108.608299 +log13.rmsDBA 98.8440857 +log13.rmsDBC 121.426125 +log13.rough 29.2375507 +log13.fluct 41.4514427 +log13.sharp 0.491797626 +log13.sone 59.0722427 +log13.impuls 6.07740021 +log13.tonal 86.6867523 +log13.annoy 105.334641 +log14.peakSPL 114.95787 +log14.peakDBA 110.017288 +log14.peakDBC 129.530411 +log14.rmsSPL 108.584 +log14.rmsDBA 98.9552078 +log14.rmsDBC 121.324356 +log14.rough 29.681715 +log14.fluct 41.4514427 +log14.sharp 0.458711773 +log14.sone 59.5289955 +log14.impuls 6.04541349 +log14.tonal 87.8821793 +log14.annoy 106.542732 +log15.peakSPL 114.95787 +log15.peakDBA 110.017288 +log15.peakDBC 129.530411 +log15.rmsSPL 108.580132 +log15.rmsDBA 98.8741608 +log15.rmsDBC 121.419952 +log15.rough 29.0921917 +log15.fluct 4.14615059 +log15.sharp 0.466611654 +log15.sone 59.1955109 +log15.impuls 6.0539279 +log15.tonal 86.9117661 +log15.annoy 96.1799393 +log16.peakSPL 114.95787 +log16.peakDBA 110.017288 +log16.peakDBC 129.566071 +log16.rmsSPL 108.59053 +log16.rmsDBA 98.859993 +log16.rmsDBC 121.37822 +log16.rough 29.0921917 +log16.fluct 4.14615059 +log16.sharp 0.493921429 +log16.sone 59.137413 +log16.impuls 6.03507853 +log16.tonal 86.3088531 +log16.annoy 96.0710373 +log17.peakSPL 114.95787 +log17.peakDBA 108.530205 +log17.peakDBC 129.566071 +log17.rmsSPL 108.639664 +log17.rmsDBA 98.8484116 +log17.rmsDBC 121.441238 +log17.rough 29.0013924 +log17.fluct 4.14615059 +log17.sharp 0.452371508 +log17.sone 59.0899544 +log17.impuls 6.19772768 +log17.tonal 86.2170486 +log17.annoy 95.9311981 +log18.peakSPL 114.95787 +log18.peakDBA 109.180527 +log18.peakDBC 129.566071 +log18.rmsSPL 108.674286 +log18.rmsDBA 98.8357391 +log18.rmsDBC 121.391075 +log18.rough 29.0013924 +log18.fluct 4.14615059 +log18.sharp 0.446822256 +log18.sone 59.0380859 +log18.impuls 5.88603497 +log18.tonal 87.9419022 +log18.annoy 95.8340607 +log19.peakSPL 114.95787 +log19.peakDBA 109.180527 +log19.peakDBC 129.566071 +log19.rmsSPL 108.659927 +log19.rmsDBA 98.7817841 +log19.rmsDBC 121.444809 +log19.rough 30.3978462 +log19.fluct 4.14615059 +log19.sharp 0.498025119 +log19.sone 58.8177071 +log19.impuls 6.09160089 +log19.tonal 88.1547699 +log19.annoy 96.1906509 +log20.peakSPL 114.95787 +log20.peakDBA 109.180527 +log20.peakDBC 129.566071 +log20.rmsSPL 108.617241 +log20.rmsDBA 98.7796631 +log20.rmsDBC 121.407562 +log20.rough 29.7774639 +log20.fluct 4.14615059 +log20.sharp 0.474523425 +log20.sone 58.8090553 +log20.impuls 6.13253403 +log20.tonal 86.3918457 +log20.annoy 95.8349152 +log21.peakSPL 114.645981 +log21.peakDBA 109.180527 +log21.peakDBC 129.566071 +log21.rmsSPL 108.587334 +log21.rmsDBA 98.8180389 +log21.rmsDBC 121.445801 +log21.rough 29.7774639 +log21.fluct 4.14615059 +log21.sharp 0.490894407 +log21.sone 58.9656944 +log21.impuls 6.06431961 +log21.tonal 87.2223358 +log21.annoy 96.1296921 +log22.peakSPL 114.956627 +log22.peakDBA 109.180527 +log22.peakDBC 129.566071 +log22.rmsSPL 108.679817 +log22.rmsDBA 98.8470688 +log22.rmsDBC 121.533371 +log22.rough 29.0957508 +log22.fluct 4.14615059 +log22.sharp 0.468240559 +log22.sone 59.084465 +log22.impuls 6.12142611 +log22.tonal 87.6665497 +log22.annoy 95.973793 +log23.peakSPL 114.956627 +log23.peakDBA 109.601822 +log23.peakDBC 129.566071 +log23.rmsSPL 108.677185 +log23.rmsDBA 98.6931381 +log23.rmsDBC 121.509018 +log23.rough 30.056057 +log23.fluct 3.94871402 +log23.sharp 0.461650014 +log23.sone 58.4573975 +log23.impuls 6.13778019 +log23.tonal 88.526329 +log23.annoy 95.2230148 +fft-1.0 -0.0158829521 +fft-1.7 0.0780702829 +fft-1.14 0.0667285994 +fft-1.21 -0.0180286989 +fft-1.28 0.0260885935 +fft-1.35 -0.00837889127 +fft-1.42 -0.095144555 +fft-1.49 0.00730448216 +fft-1.56 -0.0206788555 +fft-1.63 -0.089493759 +fft-1.70 -0.128133088 +fft-1.77 -0.0384122878 +fft-1.84 -0.204024151 +fft-1.91 -0.0869448334 +fft-1.98 -0.0553171337 +fft-1.105 -0.107673116 +fft-1.112 -0.240549982 +fft-1.119 -0.0647598431 +fft-1.126 -0.155524746 +fft-1.133 -0.225460246 +fft-1.140 -0.116575412 +fft-1.147 -0.0771098286 +fft-1.154 -0.104294047 +fft-1.161 -0.135669127 +fft-1.168 -0.0930470228 +fft-1.175 -0.116067037 +fft-1.182 -0.0366146266 +fft-1.189 -0.0554241575 +fft-1.196 -0.041482307 +fft-1.203 -0.0619672872 +fft-1.210 -0.0894545689 +fft-1.217 0.0238237828 +fft-1.224 -0.0432310849 +fft-1.231 0.0303487033 +fft-1.238 0.0194840617 +fft-1.245 0.0722266063 +fft-1.252 -0.0947191268 +fft-1.259 6.09671697e-05 +fft-1.266 -0.055774197 +fft-1.273 0.0526983514 +fft-1.280 -0.00910367072 +fft-1.287 0.0543598309 +fft-1.294 0.134324849 +fft-1.301 -0.0102143362 +fft-1.308 0.121093363 +fft-1.315 0.141454965 +fft-1.322 0.170974433 +fft-1.329 0.205749184 +fft-1.336 0.0933292806 +fft-1.343 0.100351468 +fft-1.350 0.233766764 +fft-1.357 0.243648022 +fft-1.364 0.141026005 +fft-1.371 0.179126322 +fft-1.378 0.0940326676 +fft-1.385 0.201631427 +fft-1.392 0.174722314 +fft-1.399 0.100900069 +fft-1.406 0.0499528795 +fft-1.413 0.189754009 +fft-1.420 0.170602351 +fft-1.427 0.206219614 +fft-1.434 0.107819267 +fft-1.441 0.16734229 +fft-1.448 0.0889050364 +fft-1.455 0.141162992 +fft-1.462 0.142627954 +fft-1.469 -0.0312365592 +fft-1.476 0.0651663914 +fft-1.483 0.0777728558 +fft-1.490 0.000209401362 +fft-1.497 -0.0600777119 +fft-1.504 -0.0258792639 +fft-1.511 -0.0977428406 +fft-1.518 0.0174283981 +fft-1.525 -0.143495873 +fft-1.532 -0.0885477141 +fft-1.539 -0.0469171926 +fft-1.546 0.0032447651 +fft-1.553 -0.0713383108 +fft-1.560 -0.11163497 +fft-1.567 -0.0245544091 +fft-1.574 -0.219530314 +fft-1.581 -0.075368166 +fft-1.588 -0.138354599 +fft-1.595 -0.242203265 +fft-1.602 -0.0875815153 +fft-1.609 -0.128614128 +fft-1.616 -0.0684881955 +fft-1.623 -0.106284708 +fft-1.630 -0.0907052159 +fft-1.637 -0.0881415233 +fft-1.644 -0.213607788 +fft-1.651 -0.0647653341 +fft-1.658 -0.201740026 +fft-1.665 -0.0418731794 +fft-1.672 -0.161351547 +fft-1.679 -0.180523545 +fft-1.686 -0.17804879 +fft-1.693 -0.124590382 +fft-1.700 -0.0257892422 +fft-1.707 0.0404070355 +fft-1.714 -0.0981973484 +fft-1.721 -0.00849332102 +fft-1.728 -0.0896569714 +fft-1.735 -0.0670946017 +fft-1.742 0.0330750346 +fft-1.749 -0.0250723045 +fft-1.756 0.0437561423 +fft-1.763 0.0720864981 +fft-1.770 0.0317510329 +fft-1.777 0.144777387 +fft-1.784 0.172905505 +fft-1.791 0.0631114691 +fft-1.798 0.0667819008 +fft-1.805 0.0610763021 +fft-1.812 0.148604333 +fft-1.819 0.0897529125 +fft-1.826 0.147491008 +fft-1.833 0.0539645255 +fft-1.840 0.180894747 +fft-1.847 0.165225297 +fft-1.854 0.203694955 +fft-1.861 0.150783837 +fft-1.868 0.134095207 +fft-1.875 0.0935101509 +fft-1.882 0.112183049 +fft-1.889 0.0960666686 +fft-1.896 0.175656796 +fft-1.903 0.0639740601 +fft-1.910 0.180282086 +fft-1.917 0.107009172 +fft-1.924 0.176024944 +fft-1.931 0.154560983 +fft-1.938 -0.0269338042 +fft-1.945 0.0779244453 +fft-1.952 0.00927825272 +fft-1.959 0.0644382089 +fft-1.966 -0.0754338875 +fft-1.973 -0.00500170793 +fft-1.980 -0.0276292767 +fft-1.987 -0.0789846927 +fft-1.994 -0.112182975 +fft-1.1001 -0.121425241 +fft-1.1008 -0.0309222136 +fft-1.1015 -0.103259109 +fft-1.1022 -0.093040064 +fft-1.1029 -0.135133088 +fft-1.1036 -0.0459756665 +fft-1.1043 -0.172933564 +fft-1.1050 -0.0917160213 +fft-1.1057 -0.0565885156 +fft-1.1064 -0.131879434 +fft-1.1071 -0.103681669 +fft-1.1078 -0.198730752 +fft-1.1085 -0.0884957016 +fft-1.1092 -0.246681541 +fft-1.1099 -0.136497661 +fft-1.1106 -0.157468125 +fft-1.1113 -0.128433794 +fft-1.1120 -0.217618078 +fft-1.1127 -0.119603522 +fft-1.1134 -0.108070478 +fft-1.1141 -0.210500568 +fft-1.1148 -0.0576798134 +fft-1.1155 -0.16493465 +fft-1.1162 -0.181252018 +fft-1.1169 0.00108571351 +fft-1.1176 -0.00508654118 +fft-1.1183 0.0316334665 +fft-1.1190 -0.129724935 +fft-1.1197 0.00860554725 +fft-1.1204 -0.013215364 +fft-1.1211 0.0849281326 +fft-1.1218 0.0414874591 +fft-1.1225 -0.0519137457 +fft-1.1232 0.0722266659 +fft-1.1239 0.101183362 +fft-1.1246 0.0939155817 +fft-1.1253 0.115117699 +fft-1.1260 0.0791211277 +fft-1.1267 0.0573427938 +fft-1.1274 0.0189381093 +fft-1.1281 0.0288073421 +fft-1.1288 0.0322607309 +fft-1.1295 0.121677443 +fft-1.1302 0.106668234 +fft-1.1309 0.181496248 +fft-1.1316 0.125121713 +fft-1.1323 0.184591562 +fft-1.1330 0.0930809081 +fft-1.1337 0.241115436 +fft-1.1344 0.163215816 +fft-1.1351 0.169346869 +fft-1.1358 0.0868031383 +fft-1.1365 0.204131842 +fft-1.1372 0.105351001 +fft-1.1379 0.0346561223 +fft-1.1386 0.155424058 +fft-1.1393 0.0790904015 +fft-1.1400 0.0469520427 +fft-1.1407 0.0602767318 +fft-1.1414 0.0626781061 +fft-1.1421 0.134326562 +fft-1.1428 0.113953575 +fft-1.1435 0.0433517732 +fft-1.1442 0.0803045705 +fft-1.1449 0.0599837415 +fft-1.1456 0.0662487969 +fft-1.1463 -0.0729559958 +fft-1.1470 -0.0564052425 +fft-1.1477 -0.0597727895 +fft-1.1484 -0.0116828866 +fft-1.1491 -0.00362618268 +fft-1.1498 -0.134454846 +fft-1.1505 -0.0706869811 +fft-1.1512 -0.00911989063 +fft-1.1519 -0.0465863198 +fft-1.1526 -0.184533536 +fft-1.1533 -0.224759817 +fft-1.1540 -0.0388069153 +fft-1.1547 -0.0608058795 +fft-1.1554 -0.229252547 +fft-1.1561 -0.148510113 +fft-1.1568 -0.0737407729 +fft-1.1575 -0.181690574 +fft-1.1582 -0.126825213 +fft-1.1589 -0.160537347 +fft-1.1596 -0.199848965 +fft-1.1603 -0.236948848 +fft-1.1610 -0.0904787332 +fft-1.1617 -0.049572885 +fft-1.1624 -0.14420487 +fft-1.1631 -0.143520311 +fft-1.1638 -0.194698066 +fft-1.1645 -0.0688234493 +fft-1.1652 -0.0955797732 +fft-1.1659 -0.0872213021 +fft-1.1666 -0.0682447553 +fft-1.1673 -0.143056452 +fft-1.1680 0.0125618745 +fft-1.1687 -0.0347553343 +fft-1.1694 0.00652472721 +fft-1.1701 -0.0788004771 +fft-1.1708 0.0519270189 +fft-1.1715 0.00196932256 +fft-1.1722 -0.0162619017 +fft-1.1729 0.0711358637 +fft-1.1736 0.0963946283 +fft-1.1743 0.126498491 +fft-1.1750 0.061027009 +fft-1.1757 0.140359282 +fft-1.1764 0.195317224 +fft-1.1771 0.109307528 +fft-1.1778 0.155016005 +fft-1.1785 0.0481143892 +fft-1.1792 0.224210799 +fft-1.1799 0.194842339 +fft-1.1806 0.169264123 +fft-1.1813 0.109158225 +fft-1.1820 0.220145211 +fft-1.1827 0.119350195 +fft-1.1834 0.122635446 +fft-1.1841 0.0987639204 +fft-1.1848 0.195352361 +fft-1.1855 0.0629041418 +fft-1.1862 0.120788112 +fft-1.1869 0.0720666647 +fft-1.1876 0.0906556323 +fft-1.1883 0.0579736419 +fft-1.1890 -0.0140582547 +fft-1.1897 0.142797738 +fft-1.1904 -0.031236209 +fft-1.1911 0.0790307596 +fft-1.1918 0.0299161188 +fft-1.1925 0.0309318304 +fft-1.1932 0.0249862652 +fft-1.1939 0.0033636475 +fft-1.1946 -0.0043473905 +fft-1.1953 -0.0956376493 +fft-1.1960 -0.123850055 +fft-1.1967 -0.065309763 +fft-1.1974 0.0104879066 +fft-1.1981 -0.0909937546 +fft-1.1988 5.24371862e-05 +fft-1.1995 -0.0785991549 +fft-1.2002 -0.11001125 +fft-1.2009 -0.133225247 +fft-1.2016 -0.18166706 +fft-1.2023 -0.0649654269 +fft-1.2030 -0.161606535 +fft-1.2037 -0.0715249255 +fft-1.2044 -0.161578342 +fft-1.2051 -0.136755273 +fft-1.2058 -0.248149008 +fft-1.2065 -0.152774543 +fft-1.2072 -0.0548799485 +fft-1.2079 -0.0477844998 +fft-1.2086 -0.106806338 +fft-1.2093 -0.0437233821 +fft-1.2100 -0.0347053111 +fft-1.2107 -0.0554128028 +fft-1.2114 -0.0591660589 +fft-1.2121 -0.198774621 +fft-1.2128 -0.0547951683 +fft-1.2135 -0.155517161 +fft-1.2142 -0.0584289692 +fft-1.2149 -0.129238576 +fft-1.2156 -0.034982577 +fft-1.2163 0.0642253086 +fft-1.2170 -0.0584378392 +fft-1.2177 0.093875207 +fft-1.2184 0.0885702595 +fft-1.2191 -0.0434353054 +fft-1.2198 -0.0308187306 +fft-1.2205 -0.00649077445 +fft-1.2212 0.0253302865 +fft-1.2219 0.0259433724 +fft-1.2226 0.0961291194 +fft-1.2233 0.0688901246 +fft-1.2240 0.0261903927 +fft-1.2247 0.184999675 +fft-1.2254 0.165627822 +fft-1.2261 0.0805380121 +fft-1.2268 0.082193248 +fft-1.2275 0.183976978 +fft-1.2282 0.176292568 +fft-1.2289 0.15771687 +fft-1.2296 0.151798233 +fft-1.2303 0.215153277 +fft-1.2310 0.190376237 +fft-1.2317 0.0816582516 +fft-1.2324 0.0897033811 +fft-1.2331 0.11273253 +fft-1.2338 0.214026883 +fft-1.2345 0.0925817043 +fft-1.2352 0.0519892313 +fft-1.2359 0.12728253 +fft-1.2366 -0.00334832072 +fft-1.2373 -0.00497946143 +fft-1.2380 0.0433313325 +fft-1.2387 0.095922716 +fft-1.2394 -0.0313903466 +fft-1.2401 0.0889081806 +fft-1.2408 -0.0631262287 +fft-1.2415 -0.0348340012 +fft-1.2422 0.0425443277 +fft-1.2429 -0.0782434344 +fft-1.2436 -0.0546598397 +fft-1.2443 0.00349721313 +fft-1.2450 -0.130272061 +fft-1.2457 -0.130387753 +fft-1.2464 -0.100324124 +fft-1.2471 -0.0205647051 +fft-1.2478 -0.199935392 +fft-1.2485 -0.072769627 +fft-1.2492 -0.132387578 +fft-1.2499 -0.147321865 +fft-1.2506 -0.18225956 +fft-1.2513 -0.217705518 +fft-1.2520 -0.0588958114 +fft-1.2527 -0.0748337209 +fft-1.2534 -0.188622549 +fft-1.2541 -0.179254577 +fft-1.2548 -0.221700042 +fft-1.2555 -0.206693292 +fft-1.2562 -0.241357028 +fft-1.2569 -0.144865319 +fft-1.2576 -0.107463554 +fft-1.2583 -0.198100939 +fft-1.2590 -0.126447082 +fft-1.2597 -0.014945887 +fft-1.2604 0.0030285567 +fft-1.2611 -0.113454938 +fft-1.2618 -0.0655959919 +fft-1.2625 -0.0861989707 +fft-1.2632 -0.0953569636 +fft-1.2639 -0.0983119085 +fft-1.2646 -0.0153087433 +fft-1.2653 0.070593819 +fft-1.2660 0.032179296 +fft-1.2667 0.0603257529 +fft-1.2674 0.0171830654 +fft-1.2681 0.102921896 +fft-1.2688 -0.0138772205 +fft-1.2695 0.171010628 +fft-1.2702 0.145328954 +fft-1.2709 0.148131892 +fft-1.2716 0.093201831 +fft-1.2723 0.214659572 +fft-1.2730 0.109809801 +fft-1.2737 0.18806693 +fft-1.2744 0.158189654 +fft-1.2751 0.218459517 +fft-1.2758 0.221550182 +fft-1.2765 0.13144432 +fft-1.2772 0.0740090311 +fft-1.2779 0.242490888 +fft-1.2786 0.0983814299 +fft-1.2793 0.0948337913 +fft-1.2800 0.117543846 +fft-1.2807 0.200098842 +fft-1.2814 0.177612647 +fft-1.2821 0.148499444 +fft-1.2828 0.0589974746 +fft-1.2835 0.0461259894 +fft-1.2842 0.0152608156 +fft-1.2849 0.0636007562 +fft-1.2856 0.117799819 +fft-1.2863 0.0997153521 +fft-1.2870 0.0577828549 +fft-1.2877 0.0133527797 +fft-1.2884 0.066574432 +fft-1.2891 -0.0653800443 +fft-1.2898 0.0167092308 +fft-1.2905 0.0527125672 +fft-1.2912 -0.00268910453 +fft-1.2919 -0.111991405 +fft-1.2926 -0.0981388241 +fft-1.2933 -0.12125662 +fft-1.2940 -0.113979906 +fft-1.2947 -0.129451945 +fft-1.2954 -0.187553436 +fft-1.2961 -0.0265546218 +fft-1.2968 -0.132768765 +fft-1.2975 -0.042527236 +fft-1.2982 -0.199727386 +fft-1.2989 -0.201999649 +fft-1.2996 -0.170187905 +fft-1.3003 -0.141983718 +fft-1.3010 -0.237553671 +fft-1.3017 -0.186551377 +fft-1.3024 -0.173934281 +fft-1.3031 -0.0910483301 +fft-1.3038 -0.0558350757 +fft-1.3045 -0.0991350561 +fft-1.3052 -0.160545975 +fft-1.3059 -0.207638234 +fft-1.3066 -0.0306103602 +fft-1.3073 -0.0959135145 +fft-1.3080 -0.0149223581 +fft-1.3087 -0.0903026909 +fft-1.3094 -0.13397041 +fft-1.3101 -0.0651024356 +fft-1.3108 -0.0878230929 +fft-1.3115 -0.125689805 +fft-1.3122 -0.086180076 +fft-1.3129 -0.0497699678 +fft-1.3136 -0.085363321 +fft-1.3143 0.0641088709 +fft-1.3150 0.0360990241 +fft-1.3157 0.10700316 +fft-1.3164 0.104495943 +fft-1.3171 0.0634783283 +fft-1.3178 0.0766909048 +fft-1.3185 0.026095368 +fft-1.3192 0.0133472607 +fft-1.3199 0.078080833 +fft-1.3206 0.0310771838 +fft-1.3213 0.224363804 +fft-1.3220 0.0776329935 +fft-1.3227 0.207391366 +fft-1.3234 0.0911203921 +fft-1.3241 0.138400435 +fft-1.3248 0.246192098 +fft-1.3255 0.150379837 +fft-1.3262 0.233451635 +fft-1.3269 0.142404079 +fft-1.3276 0.152371526 +fft-1.3283 0.0445393547 +fft-1.3290 0.205500066 +fft-1.3297 0.0725039393 +fft-1.3304 0.042684868 +fft-1.3311 0.0857823566 +fft-1.3318 0.0880951956 +fft-1.3325 0.151404873 +fft-1.3332 0.035788063 +fft-1.3339 0.0670766234 +fft-1.3346 0.0625854135 +fft-1.3353 0.0670514405 +fft-1.3360 0.0694660768 +fft-1.3367 -0.0692134053 +fft-1.3374 -0.0122294519 +fft-1.3381 -0.0266218148 +fft-1.3388 -0.0263091568 +fft-1.3395 -0.0995893329 +fft-1.3402 -0.0999317393 +fft-1.3409 -0.0914374664 +fft-1.3416 -0.160563618 +fft-1.3423 -0.173130453 +fft-1.3430 -0.066447407 +fft-1.3437 -0.167408943 +fft-1.3444 -0.0405538008 +fft-1.3451 -0.0587962493 +fft-1.3458 -0.200880647 +fft-1.3465 -0.190077752 +fft-1.3472 -0.222774506 +fft-1.3479 -0.110715844 +fft-1.3486 -0.0915426686 +fft-1.3493 -0.166166574 +fft-1.3500 -0.11498832 +fft-1.3507 -0.076090239 +fft-1.3514 -0.117602624 +fft-1.3521 -0.0926389992 +fft-1.3528 -0.147281721 +fft-1.3535 -0.0799522251 +fft-1.3542 -0.112113133 +fft-1.3549 -0.0687397867 +fft-1.3556 -0.110201567 +fft-1.3563 -0.0900371447 +fft-1.3570 -0.0764644369 +fft-1.3577 0.00906153023 +fft-1.3584 -0.0470950268 +fft-1.3591 -0.0981882215 +fft-1.3598 0.0550512522 +fft-1.3605 -0.0140545722 +fft-1.3612 -0.0338791311 +fft-1.3619 0.0242812373 +fft-1.3626 0.0118255736 +fft-1.3633 -0.0664548278 +fft-1.3640 -0.0322379544 +fft-1.3647 0.0413916074 +fft-1.3654 -0.0109060034 +fft-1.3661 0.127909824 +fft-1.3668 0.0890055522 +fft-1.3675 0.070873335 +fft-1.3682 0.132902488 +fft-1.3689 0.137840092 +fft-1.3696 0.19050315 +fft-1.3703 0.209150016 +fft-1.3710 0.187019512 +fft-1.3717 0.063320078 +fft-1.3724 0.0703140572 +fft-1.3731 0.105760455 +fft-1.3738 0.15718919 +fft-1.3745 0.0519220978 +fft-1.3752 0.236644343 +fft-1.3759 0.187651396 +fft-1.3766 0.217586398 +fft-1.3773 0.040232636 +fft-1.3780 0.193998024 +fft-1.3787 0.16902791 +fft-1.3794 0.202403948 +fft-1.3801 0.0677631497 +fft-1.3808 0.177167296 +fft-1.3815 0.0913839787 +fft-1.3822 0.0389001295 +fft-1.3829 0.0461561829 +fft-1.3836 -0.0546431206 +fft-1.3843 -0.0714846328 +fft-1.3850 0.0290566087 +fft-1.3857 0.0852526948 +fft-1.3864 0.04261709 +fft-1.3871 0.0423420742 +fft-1.3878 -0.0225511659 +fft-1.3885 0.043319229 +fft-1.3892 -0.0820989758 +fft-1.3899 -0.149970472 +fft-1.3906 -0.0525946654 +fft-1.3913 -0.126108274 +fft-1.3920 -0.0289080292 +fft-1.3927 -0.169445187 +fft-1.3934 -0.125106722 +fft-1.3941 -0.192845777 +fft-1.3948 -0.113882206 +fft-1.3955 -0.170084208 +fft-1.3962 -0.153253525 +fft-1.3969 -0.170215189 +fft-1.3976 -0.140017629 +fft-1.3983 -0.0717497393 +fft-1.3990 -0.067677699 +fft-1.3997 -0.0895824879 +fft-1.4004 -0.22103183 +fft-1.4011 -0.0666614994 +fft-1.4018 -0.104255855 +fft-1.4025 -0.148775816 +fft-1.4032 -0.0242840052 +fft-1.4039 -0.0376178995 +fft-1.4046 -0.0883415863 +fft-1.4053 -0.101129323 +fft-1.4060 -0.0942468867 +fft-1.4067 -0.00442690402 +fft-1.4074 0.0274095759 +fft-1.4081 0.00509757549 +fft-1.4088 -0.0485860482 +fft-1.4095 0.0912772566 +fft0.0 -0.094139412 +fft0.7 0.120879345 +fft0.14 0.125604108 +fft0.21 -0.0164364576 +fft0.28 0.0991075262 +fft0.35 0.0570882075 +fft0.42 -0.0901470557 +fft0.49 0.140206888 +fft0.56 0.108642295 +fft0.63 -0.00584396115 +fft0.70 -0.0614317656 +fft0.77 0.138066009 +fft0.84 -0.17490451 +fft0.91 0.0755512044 +fft0.98 0.153010875 +fft0.105 0.0602911226 +fft0.112 -0.195783019 +fft0.119 0.163083002 +fft0.126 -0.0136160133 +fft0.133 -0.151151776 +fft0.140 0.0664380342 +fft0.147 0.142675757 +fft0.154 0.0831228718 +fft0.161 0.012740803 +fft0.168 0.0879695937 +fft0.175 0.0296147112 +fft0.182 0.174008608 +fft0.189 0.119804241 +fft0.196 0.129167423 +fft0.203 0.0678971335 +fft0.210 -0.00898726005 +fft0.217 0.194233939 +fft0.224 0.0355588198 +fft0.231 0.157129243 +fft0.238 0.109001733 +fft0.245 0.187500998 +fft0.252 -0.173737466 +fft0.259 -0.0116560105 +fft0.266 -0.150706246 +fft0.273 0.0391874798 +fft0.280 -0.110912442 +fft0.287 -0.00970349368 +fft0.294 0.125502065 +fft0.301 -0.18709974 +fft0.308 0.0533905998 +fft0.315 0.0735727772 +fft0.322 0.113827087 +fft0.329 0.166505888 +fft0.336 -0.0731490478 +fft0.343 -0.0717400312 +fft0.350 0.184741065 +fft0.357 0.196526766 +fft0.364 -0.014254475 +fft0.371 0.0588949695 +fft0.378 -0.111831859 +fft0.385 0.105342321 +fft0.392 0.0560003519 +fft0.399 -0.084705852 +fft0.406 -0.177258104 +fft0.413 0.114011742 +fft0.420 0.0896035433 +fft0.427 0.176844165 +fft0.434 -0.00197377219 +fft0.441 0.13688083 +fft0.448 0.0014744997 +fft0.455 0.128938064 +fft0.462 0.156102568 +fft0.469 -0.166308239 +fft0.476 0.052687075 +fft0.483 0.104740858 +fft0.490 -0.0231189262 +fft0.497 -0.116228543 +fft0.504 -0.0203999877 +fft0.511 -0.136958584 +fft0.518 0.120061398 +fft0.525 -0.175824523 +fft0.532 -0.0408982746 +fft0.539 0.0662499666 +fft0.546 0.189117953 +fft0.553 0.0609636083 +fft0.560 -0.000326490408 +fft0.567 0.191267326 +fft0.574 -0.183268592 +fft0.581 0.118325494 +fft0.588 0.00336492062 +fft0.595 -0.195669964 +fft0.602 0.119813442 +fft0.609 0.0415132307 +fft0.616 0.163023621 +fft0.623 0.0861720815 +fft0.630 0.113566041 +fft0.637 0.112453535 +fft0.644 -0.147141472 +fft0.651 0.139531165 +fft0.658 -0.147688016 +fft0.665 0.156629786 +fft0.672 -0.0997596383 +fft0.679 -0.157406881 +fft0.686 -0.173469141 +fft0.693 -0.0890964195 +fft0.700 0.0846186653 +fft0.707 0.191981301 +fft0.714 -0.111190096 +fft0.721 0.0415404551 +fft0.728 -0.147955403 +fft0.735 -0.13026233 +fft0.742 0.0426123403 +fft0.749 -0.100949459 +fft0.756 0.00986657199 +fft0.763 0.0403378718 +fft0.770 -0.0656512603 +fft0.777 0.136166841 +fft0.784 0.169475421 +fft0.791 -0.0715808198 +fft0.798 -0.0840485096 +fft0.805 -0.113442473 +fft0.812 0.0456075184 +fft0.819 -0.0859904662 +fft0.826 0.0178181659 +fft0.833 -0.178576946 +fft0.840 0.0683452114 +fft0.847 0.0325300694 +fft0.854 0.107492708 +fft0.861 0.00220999727 +fft0.868 -0.0281160716 +fft0.875 -0.10374897 +fft0.882 -0.0584263466 +fft0.889 -0.080309622 +fft0.896 0.0915059596 +fft0.903 -0.117044345 +fft0.910 0.1324424 +fft0.917 0.00468120584 +fft0.924 0.163253784 +fft0.931 0.142450884 +fft0.938 -0.197015241 +fft0.945 0.0374257341 +fft0.952 -0.0741485953 +fft0.959 0.0626671836 +fft0.966 -0.190025628 +fft0.973 -0.0217813607 +fft0.980 -0.0395577662 +fft0.987 -0.114921607 +fft0.994 -0.15433234 +fft0.1001 -0.146418646 +fft0.1008 0.0601765625 +fft0.1015 -0.0599318407 +fft0.1022 -0.0161582474 +fft0.1029 -0.0784344599 +fft0.1036 0.120180704 +fft0.1043 -0.115214579 +fft0.1050 0.0638058186 +fft0.1057 0.148571759 +fft0.1064 0.0103047853 +fft0.1071 0.0767157078 +fft0.1078 -0.105750524 +fft0.1085 0.119904019 +fft0.1092 -0.193774208 +fft0.1099 0.0267734062 +fft0.1106 -0.0175027978 +fft0.1113 0.035735108 +fft0.1120 -0.149919227 +fft0.1127 0.0364303105 +fft0.1134 0.0475041866 +fft0.1141 -0.171560273 +fft0.1148 0.117784165 +fft0.1155 -0.114978723 +fft0.1162 -0.167669624 +fft0.1169 0.175314978 +fft0.1176 0.139826924 +fft0.1183 0.188864857 +fft0.1190 -0.159307823 +fft0.1197 0.0910570845 +fft0.1204 0.0204996113 +fft0.1211 0.189477205 +fft0.1218 0.0751218349 +fft0.1225 -0.139088705 +fft0.1232 0.0820798203 +fft0.1239 0.113404252 +fft0.1246 0.0730261356 +fft0.1253 0.0905510411 +fft0.1260 -0.00514945993 +fft0.1267 -0.0710425898 +fft0.1274 -0.168630153 +fft0.1281 -0.167937264 +fft0.1288 -0.17818363 +fft0.1295 -0.0144670373 +fft0.1302 -0.0574391149 +fft0.1309 0.0815351009 +fft0.1316 -0.0395343304 +fft0.1323 0.0735163242 +fft0.1330 -0.112913363 +fft0.1337 0.182256579 +fft0.1344 0.0280750748 +fft0.1351 0.0444581509 +fft0.1358 -0.114039637 +fft0.1365 0.12962082 +fft0.1372 -0.0565999411 +fft0.1379 -0.184406102 +fft0.1386 0.0728421211 +fft0.1393 -0.0621159561 +fft0.1400 -0.10683509 +fft0.1407 -0.0589439161 +fft0.1414 -0.0313933603 +fft0.1421 0.135966524 +fft0.1428 0.120396756 +fft0.1435 0.00527141104 +fft0.1442 0.105938487 +fft0.1449 0.092516996 +fft0.1456 0.132497594 +fft0.1463 -0.118461512 +fft0.1470 -0.0581398271 +fft0.1477 -0.0381134413 +fft0.1484 0.0841446146 +fft0.1491 0.125434235 +fft0.1498 -0.112160109 +fft0.1505 0.0381234176 +fft0.1512 0.182499394 +fft0.1519 0.127124116 +fft0.1526 -0.131061062 +fft0.1533 -0.195801288 +fft0.1540 0.189688116 +fft0.1547 0.157031104 +fft0.1554 -0.170859173 +fft0.1561 -0.00278464565 +fft0.1568 0.150875017 +fft0.1575 -0.0634068474 +fft0.1582 0.0454247482 +fft0.1589 -0.0254078861 +fft0.1596 -0.109920181 +fft0.1603 -0.192440301 +fft0.1610 0.08981812 +fft0.1617 0.158676147 +fft0.1624 -0.0457046516 +fft0.1631 -0.0614886656 +fft0.1638 -0.182889745 +fft0.1645 0.0480812788 +fft0.1652 -0.027767837 +fft0.1659 -0.0347582586 +fft0.1666 -0.0216844808 +fft0.1673 -0.197150424 +fft0.1680 0.0874972567 +fft0.1687 -0.034249451 +fft0.1694 0.0209025387 +fft0.1701 -0.177221894 +fft0.1708 0.0569236986 +fft0.1715 -0.0699073449 +fft0.1722 -0.132665858 +fft0.1729 0.0166738033 +fft0.1736 0.0427892469 +fft0.1743 0.0798534378 +fft0.1750 -0.0727803931 +fft0.1757 0.0658279881 +fft0.1764 0.157490656 +fft0.1771 -0.0308258291 +fft0.1778 0.046386864 +fft0.1785 -0.17940858 +fft0.1792 0.163104638 +fft0.1799 0.0970819965 +fft0.1806 0.04109478 +fft0.1813 -0.0814522654 +fft0.1820 0.140701562 +fft0.1827 -0.058195021 +fft0.1834 -0.0464400761 +fft0.1841 -0.0865512043 +fft0.1848 0.116641067 +fft0.1855 -0.135940507 +fft0.1862 -0.00566163054 +fft0.1869 -0.086519219 +fft0.1876 -0.0308207758 +fft0.1883 -0.0758844241 +fft0.1890 -0.198038384 +fft0.1897 0.139009118 +fft0.1904 -0.184493408 +fft0.1911 0.0616296791 +fft0.1918 -0.0102013713 +fft0.1925 0.0188158751 +fft0.1932 0.0342717431 +fft0.1939 0.0185052399 +fft0.1946 0.0304630753 +fft0.1953 -0.125066072 +fft0.1960 -0.154995009 +fft0.1967 -0.012196362 +fft0.1974 0.164123446 +fft0.1981 -0.0153164389 +fft0.1988 0.188900992 +fft0.1995 0.0521388315 +fft0.2002 0.00809929427 +fft0.2009 -0.0214580186 +fft0.2016 -0.103526488 +fft0.2023 0.142512113 +fft0.2030 -0.0404206179 +fft0.2037 0.147719428 +fft0.2044 -0.0268501993 +fft0.2051 0.0258471258 +fft0.2058 -0.196400806 +fft0.2065 -0.00762854842 +fft0.2072 0.183684379 +fft0.2079 0.190936998 +fft0.2086 0.0635511875 +fft0.2093 0.17804952 +fft0.2100 0.182190537 +fft0.2107 0.124769472 +fft0.2114 0.0992801934 +fft0.2121 -0.199745491 +fft0.2128 0.0667452365 +fft0.2135 -0.157646403 +fft0.2142 0.0122953895 +fft0.2149 -0.154642031 +fft0.2156 0.00768055907 +fft0.2163 0.179255471 +fft0.2170 -0.0933379531 +fft0.2177 0.183823541 +fft0.2184 0.145781979 +fft0.2191 -0.145397708 +fft0.2198 -0.146842062 +fft0.2205 -0.124148779 +fft0.2212 -0.0855365768 +fft0.2219 -0.108197607 +fft0.2226 0.00962982234 +fft0.2233 -0.0658599734 +fft0.2240 -0.17056267 +fft0.2247 0.129623204 +fft0.2254 0.0754635856 +fft0.2261 -0.107985809 +fft0.2268 -0.115687624 +fft0.2275 0.0792173892 +fft0.2282 0.0576086529 +fft0.2289 0.0166922566 +fft0.2296 0.00359644904 +fft0.2303 0.131565049 +fft0.2310 0.0857759938 +fft0.2317 -0.125420079 +fft0.2324 -0.100667357 +fft0.2331 -0.0435967818 +fft0.2338 0.172261715 +fft0.2345 -0.0552127361 +fft0.2352 -0.118964992 +fft0.2359 0.0509248488 +fft0.2366 -0.189325064 +fft0.2373 -0.170043275 +fft0.2380 -0.0495344885 +fft0.2387 0.0806782022 +fft0.2394 -0.147985294 +fft0.2401 0.119289257 +fft0.2408 -0.157610998 +fft0.2415 -0.0735948831 +fft0.2422 0.108626388 +fft0.2429 -0.105682015 +fft0.2436 -0.0316739678 +fft0.2443 0.110829547 +fft0.2450 -0.131390795 +fft0.2457 -0.10738758 +fft0.2464 -0.024312675 +fft0.2471 0.15667434 +fft0.2478 -0.182258472 +fft0.2485 0.0900558233 +fft0.2492 -0.0131740095 +fft0.2499 -0.029147435 +fft0.2506 -0.0873552561 +fft0.2513 -0.148905039 +fft0.2520 0.175652653 +fft0.2527 0.148253083 +fft0.2534 -0.077347897 +fft0.2541 -0.0591514818 +fft0.2548 -0.147093609 +fft0.2555 -0.122617297 +fft0.2562 -0.199921593 +fft0.2569 -0.0172876716 +fft0.2576 0.0448805094 +fft0.2583 -0.151209414 +fft0.2590 -0.0247723814 +fft0.2597 0.179445371 +fft0.2604 0.194853231 +fft0.2611 -0.0602388158 +fft0.2618 0.0119556431 +fft0.2625 -0.0539747849 +fft0.2632 -0.0980088264 +fft0.2639 -0.13041459 +fft0.2646 0.00854036864 +fft0.2653 0.15296559 +fft0.2660 0.048657801 +fft0.2667 0.0776037201 +fft0.2674 -0.035667479 +fft0.2681 0.109411955 +fft0.2688 -0.149775431 +fft0.2695 0.195434883 +fft0.2702 0.120736025 +fft0.2709 0.104432084 +fft0.2716 -0.0257283803 +fft0.2723 0.198666602 +fft0.2730 -0.0276182536 +fft0.2737 0.114385083 +fft0.2744 0.0423156507 +fft0.2751 0.152840003 +fft0.2758 0.15138939 +fft0.2765 -0.0340067744 +fft0.2772 -0.151570797 +fft0.2779 0.185213074 +fft0.2786 -0.100670598 +fft0.2793 -0.102935113 +fft0.2800 -0.0502292514 +fft0.2807 0.124560311 +fft0.2814 0.0915801525 +fft0.2821 0.0475579984 +fft0.2828 -0.115148842 +fft0.2835 -0.122638606 +fft0.2842 -0.16431278 +fft0.2849 -0.0459420346 +fft0.2856 0.0855996385 +fft0.2863 0.0738327727 +fft0.2870 0.0154236555 +fft0.2877 -0.0471404307 +fft0.2884 0.0862185284 +fft0.2891 -0.150381029 +fft0.2898 0.041271545 +fft0.2905 0.140686348 +fft0.2912 0.0569952987 +fft0.2919 -0.135020345 +fft0.2926 -0.0814726278 +fft0.2933 -0.102828883 +fft0.2940 -0.0645681024 +fft0.2947 -0.073175706 +fft0.2954 -0.168600485 +fft0.2961 0.172442704 +fft0.2968 -0.0228324421 +fft0.2975 0.172767445 +fft0.2982 -0.128679171 +fft0.2989 -0.122541897 +fft0.2996 -0.0505980514 +fft0.3003 0.0116993664 +fft0.3010 -0.176032156 +fft0.3017 -0.0731284544 +fft0.3024 -0.0495119952 +fft0.3031 0.11213892 +fft0.3038 0.175975755 +fft0.3045 0.0803727433 +fft0.3052 -0.0537899993 +fft0.3059 -0.161558136 +fft0.3066 0.176785275 +fft0.3073 0.0284697302 +fft0.3080 0.170894459 +fft0.3087 -0.00110800273 +fft0.3094 -0.111191228 +fft0.3101 0.00248172297 +fft0.3108 -0.0681357905 +fft0.3115 -0.169947475 +fft0.3122 -0.11768949 +fft0.3129 -0.0720894486 +fft0.3136 -0.170726642 +fft0.3143 0.100767255 +fft0.3150 0.0175273903 +fft0.3157 0.132574186 +fft0.3164 0.10148149 +fft0.3171 -0.00572994957 +fft0.3178 -0.00336776976 +fft0.3185 -0.12730664 +fft0.3192 -0.174044654 +fft0.3199 -0.064135097 +fft0.3206 -0.175851628 +fft0.3213 0.195009276 +fft0.3220 -0.112035967 +fft0.3227 0.13613987 +fft0.3234 -0.105405115 +fft0.3241 -0.0174347293 +fft0.3248 0.194027647 +fft0.3255 0.000785374665 +fft0.3262 0.167828068 +fft0.3269 -0.0108586429 +fft0.3276 0.0149652958 +fft0.3283 -0.192378685 +fft0.3290 0.140224561 +fft0.3297 -0.112814032 +fft0.3304 -0.157335356 +fft0.3311 -0.0539872311 +fft0.3318 -0.030315984 +fft0.3325 0.117081575 +fft0.3332 -0.0918155834 +fft0.3339 -0.00553110847 +fft0.3346 0.0103657963 +fft0.3353 0.0451404117 +fft0.3360 0.0765586421 +fft0.3367 -0.173688024 +fft0.3374 -0.0323119871 +fft0.3381 -0.0336226933 +fft0.3388 -0.00568797579 +fft0.3395 -0.125332683 +fft0.3402 -0.0997214243 +fft0.3409 -0.0572770126 +fft0.3416 -0.171127245 +fft0.3423 -0.173117369 +fft0.3430 0.0619395971 +fft0.3437 -0.119927309 +fft0.3444 0.15203619 +fft0.3451 0.13184838 +fft0.3458 -0.138116166 +fft0.3465 -0.10451813 +fft0.3472 -0.160232052 +fft0.3479 0.0711710006 +fft0.3486 0.114348128 +fft0.3493 -0.0325644389 +fft0.3500 0.0696122199 +fft0.3507 0.144714937 +fft0.3514 0.0565057285 +fft0.3521 0.0988010392 +fft0.3528 -0.0204998013 +fft0.3535 0.101844333 +fft0.3542 0.0230115894 +fft0.3549 0.0931729823 +fft0.3556 -0.00827109814 +fft0.3563 0.0117574213 +fft0.3570 0.0169929992 +fft0.3577 0.164709434 +fft0.3584 0.0278309342 +fft0.3591 -0.0999446064 +fft0.3598 0.180136114 +fft0.3605 0.0149386404 +fft0.3612 -0.0520574711 +fft0.3619 0.0367845297 +fft0.3626 -0.015506709 +fft0.3633 -0.199118882 +fft0.3640 -0.15718101 +fft0.3647 -0.0356399417 +fft0.3654 -0.164959639 +fft0.3661 0.0891485736 +fft0.3668 -0.01078502 +fft0.3675 -0.0675904751 +fft0.3682 0.0376832001 +fft0.3689 0.030687714 +fft0.3696 0.121198677 +fft0.3703 0.145857051 +fft0.3710 0.0912465826 +fft0.3717 -0.164129123 +fft0.3724 -0.155678377 +fft0.3731 -0.0878367648 +fft0.3738 0.0144811869 +fft0.3745 -0.194076329 +fft0.3752 0.179844409 +fft0.3759 0.0887968093 +fft0.3766 0.158008918 +fft0.3773 -0.185031012 +fft0.3780 0.136394888 +fft0.3787 0.102460742 +fft0.3794 0.187195584 +fft0.3801 -0.0622774474 +fft0.3808 0.177999005 +fft0.3815 0.0293800365 +fft0.3822 -0.0513530634 +fft0.3829 -0.0115227578 +fft0.3836 -0.186931953 +fft0.3843 -0.193774119 +fft0.3850 0.0345754884 +fft0.3857 0.174432263 +fft0.3864 0.11659272 +fft0.3871 0.143211246 +fft0.3878 0.0401022695 +fft0.3885 0.197805688 +fft0.3892 -0.0280007962 +fft0.3899 -0.139856577 +fft0.3906 0.0774390921 +fft0.3913 -0.0485763215 +fft0.3920 0.165127397 +fft0.3927 -0.0985142365 +fft0.3934 0.00557861337 +fft0.3941 -0.11662972 +fft0.3948 0.0523097031 +fft0.3955 -0.0514318235 +fft0.3962 -0.0115305902 +fft0.3969 -0.0416888967 +fft0.3976 0.0199647434 +fft0.3983 0.155242011 +fft0.3990 0.159621075 +fft0.3997 0.109571598 +fft0.4004 -0.16198954 +fft0.4011 0.135738835 +fft0.4018 0.0472803377 +fft0.4025 -0.0571754947 +fft0.4032 0.174375445 +fft0.4039 0.128404424 +fft0.4046 0.00594525365 +fft0.4053 -0.0421742909 +fft0.4060 -0.0522966273 +fft0.4067 0.102313422 +fft0.4074 0.140023753 +fft0.4081 0.0687222481 +fft0.4088 -0.0658135563 +fft0.4095 0.186481386 +fft1.0 0.0623735078 +fft1.7 0.0352612175 +fft1.14 0.00785308424 +fft1.21 -0.0196209382 +fft1.28 -0.0469303392 +fft1.35 -0.07384599 +fft1.42 -0.100142054 +fft1.49 -0.125597924 +fft1.56 -0.150000006 +fft1.63 -0.173143551 +fft1.70 -0.194834411 +fft1.77 -0.214890584 +fft1.84 -0.233143792 +fft1.91 -0.249440879 +fft1.98 -0.263645142 +fft1.105 -0.275637358 +fft1.112 -0.285316944 +fft1.119 -0.292602688 +fft1.126 -0.297433466 +fft1.133 -0.299768716 +fft1.140 -0.299588859 +fft1.147 -0.296895415 +fft1.154 -0.291710973 +fft1.161 -0.284079045 +fft1.168 -0.274063647 +fft1.175 -0.261748791 +fft1.182 -0.247237861 +fft1.189 -0.230652556 +fft1.196 -0.212132037 +fft1.203 -0.191831708 +fft1.210 -0.169921875 +fft1.217 -0.146586373 +fft1.224 -0.12202099 +fft1.231 -0.0964318365 +fft1.238 -0.0700336099 +fft1.245 -0.0430477858 +fft1.252 -0.0157007873 +fft1.259 0.0117779449 +fft1.266 0.0391578563 +fft1.273 0.0662092268 +fft1.280 0.0927051008 +fft1.287 0.118423156 +fft1.294 0.143147632 +fft1.301 0.166671067 +fft1.308 0.188796118 +fft1.315 0.209337145 +fft1.322 0.228121787 +fft1.329 0.244992465 +fft1.336 0.259807616 +fft1.343 0.272442967 +fft1.350 0.282792449 +fft1.357 0.290769279 +fft1.364 0.296306491 +fft1.371 0.299357682 +fft1.378 0.299897194 +fft1.385 0.297920525 +fft1.392 0.293444276 +fft1.399 0.286505997 +fft1.406 0.277163863 +fft1.413 0.265496284 +fft1.420 0.25160116 +fft1.427 0.235595077 +fft1.434 0.217612311 +fft1.441 0.197803751 +fft1.448 0.176335573 +fft1.455 0.153387919 +fft1.462 0.129153326 +fft1.469 0.103835121 +fft1.476 0.0776457116 +fft1.483 0.0508048497 +fft1.490 0.0235377289 +fft1.497 -0.0039268788 +fft1.504 -0.0313585401 +fft1.511 -0.0585270971 +fft1.518 -0.0852046013 +fft1.525 -0.11116723 +fft1.532 -0.13619715 +fft1.539 -0.160084352 +fft1.546 -0.182628423 +fft1.553 -0.203640223 +fft1.560 -0.222943455 +fft1.567 -0.240376145 +fft1.574 -0.255792052 +fft1.581 -0.269061834 +fft1.588 -0.28007412 +fft1.595 -0.288736582 +fft1.602 -0.294976473 +fft1.609 -0.29874149 +fft1.616 -0.300000012 +fft1.623 -0.29874149 +fft1.630 -0.294976473 +fft1.637 -0.288736582 +fft1.644 -0.28007412 +fft1.651 -0.269061834 +fft1.658 -0.255792052 +fft1.665 -0.240376145 +fft1.672 -0.222943455 +fft1.679 -0.203640223 +fft1.686 -0.182628423 +fft1.693 -0.160084352 +fft1.700 -0.13619715 +fft1.707 -0.11116723 +fft1.714 -0.0852046013 +fft1.721 -0.0585270971 +fft1.728 -0.0313585401 +fft1.735 -0.0039268788 +fft1.742 0.0235377289 +fft1.749 0.0508048497 +fft1.756 0.0776457116 +fft1.763 0.103835121 +fft1.770 0.129153326 +fft1.777 0.153387919 +fft1.784 0.176335573 +fft1.791 0.197803751 +fft1.798 0.217612311 +fft1.805 0.235595077 +fft1.812 0.25160116 +fft1.819 0.265496284 +fft1.826 0.277163863 +fft1.833 0.286505997 +fft1.840 0.293444276 +fft1.847 0.297920525 +fft1.854 0.299897194 +fft1.861 0.299357682 +fft1.868 0.296306491 +fft1.875 0.290769279 +fft1.882 0.282792449 +fft1.889 0.272442967 +fft1.896 0.259807616 +fft1.903 0.244992465 +fft1.910 0.228121787 +fft1.917 0.209337145 +fft1.924 0.188796118 +fft1.931 0.166671067 +fft1.938 0.143147632 +fft1.945 0.118423156 +fft1.952 0.0927051008 +fft1.959 0.0662092268 +fft1.966 0.0391578563 +fft1.973 0.0117779449 +fft1.980 -0.0157007873 +fft1.987 -0.0430477858 +fft1.994 -0.0700336099 +fft1.1001 -0.0964318365 +fft1.1008 -0.12202099 +fft1.1015 -0.146586373 +fft1.1022 -0.169921875 +fft1.1029 -0.191831708 +fft1.1036 -0.212132037 +fft1.1043 -0.230652556 +fft1.1050 -0.247237861 +fft1.1057 -0.261748791 +fft1.1064 -0.274063647 +fft1.1071 -0.284079045 +fft1.1078 -0.291710973 +fft1.1085 -0.296895415 +fft1.1092 -0.299588859 +fft1.1099 -0.299768716 +fft1.1106 -0.297433466 +fft1.1113 -0.292602688 +fft1.1120 -0.285316944 +fft1.1127 -0.275637358 +fft1.1134 -0.263645142 +fft1.1141 -0.249440879 +fft1.1148 -0.233143792 +fft1.1155 -0.214890584 +fft1.1162 -0.194834411 +fft1.1169 -0.173143551 +fft1.1176 -0.150000006 +fft1.1183 -0.125597924 +fft1.1190 -0.100142054 +fft1.1197 -0.07384599 +fft1.1204 -0.0469303392 +fft1.1211 -0.0196209382 +fft1.1218 0.00785308424 +fft1.1225 0.0352612175 +fft1.1232 0.0623735078 +fft1.1239 0.088962473 +fft1.1246 0.114805028 +fft1.1253 0.139684349 +fft1.1260 0.163391709 +fft1.1267 0.185728177 +fft1.1274 0.206506371 +fft1.1281 0.225551948 +fft1.1288 0.242705092 +fft1.1295 0.257821918 +fft1.1302 0.270775586 +fft1.1309 0.281457394 +fft1.1316 0.289777756 +fft1.1323 0.295666814 +fft1.1330 0.299075186 +fft1.1337 0.299974293 +fft1.1344 0.298356563 +fft1.1351 0.294235587 +fft1.1358 0.287645906 +fft1.1365 0.278642863 +fft1.1372 0.267301947 +fft1.1379 0.253718346 +fft1.1386 0.238005996 +fft1.1393 0.220296755 +fft1.1400 0.200739175 +fft1.1407 0.179497376 +fft1.1414 0.156749576 +fft1.1421 0.1326866 +fft1.1428 0.107510388 +fft1.1435 0.0814321339 +fft1.1442 0.054670658 +fft1.1449 0.0274504852 +fft1.1456 -3.91118954e-14 +fft1.1463 -0.0274504852 +fft1.1470 -0.054670658 +fft1.1477 -0.0814321339 +fft1.1484 -0.107510388 +fft1.1491 -0.1326866 +fft1.1498 -0.156749576 +fft1.1505 -0.179497376 +fft1.1512 -0.200739175 +fft1.1519 -0.220296755 +fft1.1526 -0.238005996 +fft1.1533 -0.253718346 +fft1.1540 -0.267301947 +fft1.1547 -0.278642863 +fft1.1554 -0.287645906 +fft1.1561 -0.294235587 +fft1.1568 -0.298356563 +fft1.1575 -0.299974293 +fft1.1582 -0.299075186 +fft1.1589 -0.295666814 +fft1.1596 -0.289777756 +fft1.1603 -0.281457394 +fft1.1610 -0.270775586 +fft1.1617 -0.257821918 +fft1.1624 -0.242705092 +fft1.1631 -0.225551948 +fft1.1638 -0.206506371 +fft1.1645 -0.185728177 +fft1.1652 -0.163391709 +fft1.1659 -0.139684349 +fft1.1666 -0.114805028 +fft1.1673 -0.088962473 +fft1.1680 -0.0623735078 +fft1.1687 -0.0352612175 +fft1.1694 -0.00785308424 +fft1.1701 0.0196209382 +fft1.1708 0.0469303392 +fft1.1715 0.07384599 +fft1.1722 0.100142054 +fft1.1729 0.125597924 +fft1.1736 0.150000006 +fft1.1743 0.173143551 +fft1.1750 0.194834411 +fft1.1757 0.214890584 +fft1.1764 0.233143792 +fft1.1771 0.249440879 +fft1.1778 0.263645142 +fft1.1785 0.275637358 +fft1.1792 0.285316944 +fft1.1799 0.292602688 +fft1.1806 0.297433466 +fft1.1813 0.299768716 +fft1.1820 0.299588859 +fft1.1827 0.296895415 +fft1.1834 0.291710973 +fft1.1841 0.284079045 +fft1.1848 0.274063647 +fft1.1855 0.261748791 +fft1.1862 0.247237861 +fft1.1869 0.230652556 +fft1.1876 0.212132037 +fft1.1883 0.191831708 +fft1.1890 0.169921875 +fft1.1897 0.146586373 +fft1.1904 0.12202099 +fft1.1911 0.0964318365 +fft1.1918 0.0700336099 +fft1.1925 0.0430477858 +fft1.1932 0.0157007873 +fft1.1939 -0.0117779449 +fft1.1946 -0.0391578563 +fft1.1953 -0.0662092268 +fft1.1960 -0.0927051008 +fft1.1967 -0.118423156 +fft1.1974 -0.143147632 +fft1.1981 -0.166671067 +fft1.1988 -0.188796118 +fft1.1995 -0.209337145 +fft1.2002 -0.228121787 +fft1.2009 -0.244992465 +fft1.2016 -0.259807616 +fft1.2023 -0.272442967 +fft1.2030 -0.282792449 +fft1.2037 -0.290769279 +fft1.2044 -0.296306491 +fft1.2051 -0.299357682 +fft1.2058 -0.299897194 +fft1.2065 -0.297920525 +fft1.2072 -0.293444276 +fft1.2079 -0.286505997 +fft1.2086 -0.277163863 +fft1.2093 -0.265496284 +fft1.2100 -0.25160116 +fft1.2107 -0.235595077 +fft1.2114 -0.217612311 +fft1.2121 -0.197803751 +fft1.2128 -0.176335573 +fft1.2135 -0.153387919 +fft1.2142 -0.129153326 +fft1.2149 -0.103835121 +fft1.2156 -0.0776457116 +fft1.2163 -0.0508048497 +fft1.2170 -0.0235377289 +fft1.2177 0.0039268788 +fft1.2184 0.0313585401 +fft1.2191 0.0585270971 +fft1.2198 0.0852046013 +fft1.2205 0.11116723 +fft1.2212 0.13619715 +fft1.2219 0.160084352 +fft1.2226 0.182628423 +fft1.2233 0.203640223 +fft1.2240 0.222943455 +fft1.2247 0.240376145 +fft1.2254 0.255792052 +fft1.2261 0.269061834 +fft1.2268 0.28007412 +fft1.2275 0.288736582 +fft1.2282 0.294976473 +fft1.2289 0.29874149 +fft1.2296 0.300000012 +fft1.2303 0.29874149 +fft1.2310 0.294976473 +fft1.2317 0.288736582 +fft1.2324 0.28007412 +fft1.2331 0.269061834 +fft1.2338 0.255792052 +fft1.2345 0.240376145 +fft1.2352 0.222943455 +fft1.2359 0.203640223 +fft1.2366 0.182628423 +fft1.2373 0.160084352 +fft1.2380 0.13619715 +fft1.2387 0.11116723 +fft1.2394 0.0852046013 +fft1.2401 0.0585270971 +fft1.2408 0.0313585401 +fft1.2415 0.0039268788 +fft1.2422 -0.0235377289 +fft1.2429 -0.0508048497 +fft1.2436 -0.0776457116 +fft1.2443 -0.103835121 +fft1.2450 -0.129153326 +fft1.2457 -0.153387919 +fft1.2464 -0.176335573 +fft1.2471 -0.197803751 +fft1.2478 -0.217612311 +fft1.2485 -0.235595077 +fft1.2492 -0.25160116 +fft1.2499 -0.265496284 +fft1.2506 -0.277163863 +fft1.2513 -0.286505997 +fft1.2520 -0.293444276 +fft1.2527 -0.297920525 +fft1.2534 -0.299897194 +fft1.2541 -0.299357682 +fft1.2548 -0.296306491 +fft1.2555 -0.290769279 +fft1.2562 -0.282792449 +fft1.2569 -0.272442967 +fft1.2576 -0.259807616 +fft1.2583 -0.244992465 +fft1.2590 -0.228121787 +fft1.2597 -0.209337145 +fft1.2604 -0.188796118 +fft1.2611 -0.166671067 +fft1.2618 -0.143147632 +fft1.2625 -0.118423156 +fft1.2632 -0.0927051008 +fft1.2639 -0.0662092268 +fft1.2646 -0.0391578563 +fft1.2653 -0.0117779449 +fft1.2660 0.0157007873 +fft1.2667 0.0430477858 +fft1.2674 0.0700336099 +fft1.2681 0.0964318365 +fft1.2688 0.12202099 +fft1.2695 0.146586373 +fft1.2702 0.169921875 +fft1.2709 0.191831708 +fft1.2716 0.212132037 +fft1.2723 0.230652556 +fft1.2730 0.247237861 +fft1.2737 0.261748791 +fft1.2744 0.274063647 +fft1.2751 0.284079045 +fft1.2758 0.291710973 +fft1.2765 0.296895415 +fft1.2772 0.299588859 +fft1.2779 0.299768716 +fft1.2786 0.297433466 +fft1.2793 0.292602688 +fft1.2800 0.285316944 +fft1.2807 0.275637358 +fft1.2814 0.263645142 +fft1.2821 0.249440879 +fft1.2828 0.233143792 +fft1.2835 0.214890584 +fft1.2842 0.194834411 +fft1.2849 0.173143551 +fft1.2856 0.150000006 +fft1.2863 0.125597924 +fft1.2870 0.100142054 +fft1.2877 0.07384599 +fft1.2884 0.0469303392 +fft1.2891 0.0196209382 +fft1.2898 -0.00785308424 +fft1.2905 -0.0352612175 +fft1.2912 -0.0623735078 +fft1.2919 -0.088962473 +fft1.2926 -0.114805028 +fft1.2933 -0.139684349 +fft1.2940 -0.163391709 +fft1.2947 -0.185728177 +fft1.2954 -0.206506371 +fft1.2961 -0.225551948 +fft1.2968 -0.242705092 +fft1.2975 -0.257821918 +fft1.2982 -0.270775586 +fft1.2989 -0.281457394 +fft1.2996 -0.289777756 +fft1.3003 -0.295666814 +fft1.3010 -0.299075186 +fft1.3017 -0.299974293 +fft1.3024 -0.298356563 +fft1.3031 -0.294235587 +fft1.3038 -0.287645906 +fft1.3045 -0.278642863 +fft1.3052 -0.267301947 +fft1.3059 -0.253718346 +fft1.3066 -0.238005996 +fft1.3073 -0.220296755 +fft1.3080 -0.200739175 +fft1.3087 -0.179497376 +fft1.3094 -0.156749576 +fft1.3101 -0.1326866 +fft1.3108 -0.107510388 +fft1.3115 -0.0814321339 +fft1.3122 -0.054670658 +fft1.3129 -0.0274504852 +fft1.3136 5.05786751e-14 +fft1.3143 0.0274504852 +fft1.3150 0.054670658 +fft1.3157 0.0814321339 +fft1.3164 0.107510388 +fft1.3171 0.1326866 +fft1.3178 0.156749576 +fft1.3185 0.179497376 +fft1.3192 0.200739175 +fft1.3199 0.220296755 +fft1.3206 0.238005996 +fft1.3213 0.253718346 +fft1.3220 0.267301947 +fft1.3227 0.278642863 +fft1.3234 0.287645906 +fft1.3241 0.294235587 +fft1.3248 0.298356563 +fft1.3255 0.299974293 +fft1.3262 0.299075186 +fft1.3269 0.295666814 +fft1.3276 0.289777756 +fft1.3283 0.281457394 +fft1.3290 0.270775586 +fft1.3297 0.257821918 +fft1.3304 0.242705092 +fft1.3311 0.225551948 +fft1.3318 0.206506371 +fft1.3325 0.185728177 +fft1.3332 0.163391709 +fft1.3339 0.139684349 +fft1.3346 0.114805028 +fft1.3353 0.088962473 +fft1.3360 0.0623735078 +fft1.3367 0.0352612175 +fft1.3374 0.00785308424 +fft1.3381 -0.0196209382 +fft1.3388 -0.0469303392 +fft1.3395 -0.07384599 +fft1.3402 -0.100142054 +fft1.3409 -0.125597924 +fft1.3416 -0.150000006 +fft1.3423 -0.173143551 +fft1.3430 -0.194834411 +fft1.3437 -0.214890584 +fft1.3444 -0.233143792 +fft1.3451 -0.249440879 +fft1.3458 -0.263645142 +fft1.3465 -0.275637358 +fft1.3472 -0.285316944 +fft1.3479 -0.292602688 +fft1.3486 -0.297433466 +fft1.3493 -0.299768716 +fft1.3500 -0.299588859 +fft1.3507 -0.296895415 +fft1.3514 -0.291710973 +fft1.3521 -0.284079045 +fft1.3528 -0.274063647 +fft1.3535 -0.261748791 +fft1.3542 -0.247237861 +fft1.3549 -0.230652556 +fft1.3556 -0.212132037 +fft1.3563 -0.191831708 +fft1.3570 -0.169921875 +fft1.3577 -0.146586373 +fft1.3584 -0.12202099 +fft1.3591 -0.0964318365 +fft1.3598 -0.0700336099 +fft1.3605 -0.0430477858 +fft1.3612 -0.0157007873 +fft1.3619 0.0117779449 +fft1.3626 0.0391578563 +fft1.3633 0.0662092268 +fft1.3640 0.0927051008 +fft1.3647 0.118423156 +fft1.3654 0.143147632 +fft1.3661 0.166671067 +fft1.3668 0.188796118 +fft1.3675 0.209337145 +fft1.3682 0.228121787 +fft1.3689 0.244992465 +fft1.3696 0.259807616 +fft1.3703 0.272442967 +fft1.3710 0.282792449 +fft1.3717 0.290769279 +fft1.3724 0.296306491 +fft1.3731 0.299357682 +fft1.3738 0.299897194 +fft1.3745 0.297920525 +fft1.3752 0.293444276 +fft1.3759 0.286505997 +fft1.3766 0.277163863 +fft1.3773 0.265496284 +fft1.3780 0.25160116 +fft1.3787 0.235595077 +fft1.3794 0.217612311 +fft1.3801 0.197803751 +fft1.3808 0.176335573 +fft1.3815 0.153387919 +fft1.3822 0.129153326 +fft1.3829 0.103835121 +fft1.3836 0.0776457116 +fft1.3843 0.0508048497 +fft1.3850 0.0235377289 +fft1.3857 -0.0039268788 +fft1.3864 -0.0313585401 +fft1.3871 -0.0585270971 +fft1.3878 -0.0852046013 +fft1.3885 -0.11116723 +fft1.3892 -0.13619715 +fft1.3899 -0.160084352 +fft1.3906 -0.182628423 +fft1.3913 -0.203640223 +fft1.3920 -0.222943455 +fft1.3927 -0.240376145 +fft1.3934 -0.255792052 +fft1.3941 -0.269061834 +fft1.3948 -0.28007412 +fft1.3955 -0.288736582 +fft1.3962 -0.294976473 +fft1.3969 -0.29874149 +fft1.3976 -0.300000012 +fft1.3983 -0.29874149 +fft1.3990 -0.294976473 +fft1.3997 -0.288736582 +fft1.4004 -0.28007412 +fft1.4011 -0.269061834 +fft1.4018 -0.255792052 +fft1.4025 -0.240376145 +fft1.4032 -0.222943455 +fft1.4039 -0.203640223 +fft1.4046 -0.182628423 +fft1.4053 -0.160084352 +fft1.4060 -0.13619715 +fft1.4067 -0.11116723 +fft1.4074 -0.0852046013 +fft1.4081 -0.0585270971 +fft1.4088 -0.0313585401 +fft1.4095 -0.0039268788 +sessionPeakDBC 129.566071 +noiseDose 0.249300823 diff --git a/Tests/golden/stereo_slow_muted.txt b/Tests/golden/stereo_slow_muted.txt new file mode 100644 index 0000000..5e156e0 --- /dev/null +++ b/Tests/golden/stereo_slow_muted.txt @@ -0,0 +1,2404 @@ +# SPLMeter processor golden output: stereo_slow_muted +blk9.peakSPL -999 +blk9.peakDBA -999 +blk9.peakDBC -999 +blk9.rmsSPL -999 +blk9.rmsDBA -999 +blk9.rmsDBC -999 +blk9.rough 0 +blk9.sharp 4.84619665 +blk9.fluct 0 +blk9.impuls 7.298388 +blk9.tonal 41.8490715 +blk19.peakSPL 89.9965744 +blk19.peakDBA 91.5471802 +blk19.peakDBC 112.399101 +blk19.rmsSPL 75.9405975 +blk19.rmsDBA 72.3005371 +blk19.rmsDBC 95.1374435 +blk19.rough 19.9007053 +blk19.sharp 4.70854759 +blk19.fluct 0 +blk19.impuls 5.63573551 +blk19.tonal 41.5918007 +blk29.peakSPL 89.9997406 +blk29.peakDBA 92.8444901 +blk29.peakDBC 112.399101 +blk29.rmsSPL 78.6692123 +blk29.rmsDBA 75.1555405 +blk29.rmsDBC 97.8064575 +blk29.rough 19.9007053 +blk29.sharp 4.88073874 +blk29.fluct 0 +blk29.impuls 5.20026302 +blk29.tonal 43.6259079 +blk39.peakSPL 89.9998093 +blk39.peakDBA 92.8444901 +blk39.peakDBC 112.399101 +blk39.rmsSPL 80.1789398 +blk39.rmsDBA 76.6207886 +blk39.rmsDBC 99.3495941 +blk39.rough 7.8035183 +blk39.sharp 5.041821 +blk39.fluct 0 +blk39.impuls 4.88817024 +blk39.tonal 52.8391533 +blk49.peakSPL 89.9998093 +blk49.peakDBA 92.8444901 +blk49.peakDBC 112.399101 +blk49.rmsSPL 81.1759644 +blk49.rmsDBA 77.6392365 +blk49.rmsDBC 100.348335 +blk49.rough 7.8035183 +blk49.sharp 4.87248659 +blk49.fluct 0 +blk49.impuls 4.69859886 +blk49.tonal 48.8503036 +blk59.peakSPL 89.9998093 +blk59.peakDBA 92.8444901 +blk59.peakDBC 112.399101 +blk59.rmsSPL 81.1759644 +blk59.rmsDBA 77.6392365 +blk59.rmsDBC 100.348335 +blk59.rough 7.8584342 +blk59.sharp 4.89420223 +blk59.fluct 0 +blk59.impuls 4.60280895 +blk59.tonal 45.4330177 +blk69.peakSPL 89.9998093 +blk69.peakDBA 92.8444901 +blk69.peakDBC 112.399101 +blk69.rmsSPL 81.9103775 +blk69.rmsDBA 78.3491058 +blk69.rmsDBC 101.099777 +blk69.rough 7.8584342 +blk69.sharp 4.77989674 +blk69.fluct 0 +blk69.impuls 4.71666193 +blk69.tonal 45.8508949 +blk79.peakSPL 89.9998093 +blk79.peakDBA 92.8444901 +blk79.peakDBC 112.399101 +blk79.rmsSPL 82.4624557 +blk79.rmsDBA 78.9199829 +blk79.rmsDBC 101.644981 +blk79.rough 8.34216309 +blk79.sharp 4.79082441 +blk79.fluct 0 +blk79.impuls 4.68017006 +blk79.tonal 40.3776665 +blk89.peakSPL 89.9998093 +blk89.peakDBA 92.8444901 +blk89.peakDBC 112.434143 +blk89.rmsSPL 82.9003448 +blk89.rmsDBA 79.3912125 +blk89.rmsDBC 102.067207 +blk89.rough 8.34216309 +blk89.sharp 4.70023537 +blk89.fluct 0 +blk89.impuls 4.70117235 +blk89.tonal 37.5516586 +blk99.peakSPL 89.9998093 +blk99.peakDBA 92.8444901 +blk99.peakDBC 112.440407 +blk99.rmsSPL 83.2435913 +blk99.rmsDBA 79.6891479 +blk99.rmsDBC 102.42923 +blk99.rough 7.41312981 +blk99.sharp 4.90628433 +blk99.fluct 41.2203979 +blk99.impuls 4.67919064 +blk99.tonal 43.5258713 +blk109.peakSPL 89.9998093 +blk109.peakDBA 92.8444901 +blk109.peakDBC 112.440407 +blk109.rmsSPL 83.2435913 +blk109.rmsDBA 79.6891479 +blk109.rmsDBC 102.42923 +blk109.rough 7.41312981 +blk109.sharp 4.69507694 +blk109.fluct 41.2203979 +blk109.impuls 4.72546673 +blk109.tonal 39.2796593 +blk119.peakSPL 89.9998093 +blk119.peakDBA 92.8444901 +blk119.peakDBC 112.440407 +blk119.rmsSPL 83.5324936 +blk119.rmsDBA 79.9764328 +blk119.rmsDBC 102.717461 +blk119.rough 7.26287746 +blk119.sharp 4.7941041 +blk119.fluct 41.2203979 +blk119.impuls 4.68362904 +blk119.tonal 45.957859 +blk129.peakSPL 89.9998093 +blk129.peakDBA 92.8444901 +blk129.peakDBC 112.440407 +blk129.rmsSPL 83.7749634 +blk129.rmsDBA 80.2004242 +blk129.rmsDBC 102.973907 +blk129.rough 7.26287746 +blk129.sharp 5.02797127 +blk129.fluct 41.2203979 +blk129.impuls 4.71192741 +blk129.tonal 47.3060455 +blk139.peakSPL 89.9998093 +blk139.peakDBA 92.8444901 +blk139.peakDBC 112.440407 +blk139.rmsSPL 83.9719849 +blk139.rmsDBA 80.387085 +blk139.rmsDBC 103.182404 +blk139.rough 7.61625624 +blk139.sharp 4.55839205 +blk139.fluct 41.2203979 +blk139.impuls 4.68304205 +blk139.tonal 41.447506 +blk149.peakSPL 89.9998093 +blk149.peakDBA 92.8444901 +blk149.peakDBC 112.478104 +blk149.rmsSPL 84.1417542 +blk149.rmsDBA 80.5870056 +blk149.rmsDBC 103.337425 +blk149.rough 7.61625624 +blk149.sharp 4.75879383 +blk149.fluct 41.2203979 +blk149.impuls 4.72507238 +blk149.tonal 45.419117 +blk159.peakSPL 89.9998093 +blk159.peakDBA 92.8444901 +blk159.peakDBC 112.478104 +blk159.rmsSPL 84.1417542 +blk159.rmsDBA 80.5870056 +blk159.rmsDBC 103.337425 +blk159.rough 7.76799393 +blk159.sharp 4.90701532 +blk159.fluct 41.2203979 +blk159.impuls 4.63024139 +blk159.tonal 48.8098907 +blk169.peakSPL 89.9998093 +blk169.peakDBA 92.8444901 +blk169.peakDBC 112.478104 +blk169.rmsSPL 84.2887955 +blk169.rmsDBA 80.7350769 +blk169.rmsDBC 103.483376 +blk169.rough 7.76799393 +blk169.sharp 4.80407 +blk169.fluct 41.2203979 +blk169.impuls 4.69787884 +blk169.tonal 37.7168274 +blk179.peakSPL 89.9998093 +blk179.peakDBA 92.8444901 +blk179.peakDBC 112.478104 +blk179.rmsSPL 84.4117432 +blk179.rmsDBA 80.8442307 +blk179.rmsDBC 103.605721 +blk179.rough 8.58148384 +blk179.sharp 4.72725391 +blk179.fluct 41.2203979 +blk179.impuls 4.65592432 +blk179.tonal 38.5457916 +blk189.peakSPL 89.9998093 +blk189.peakDBA 92.8444901 +blk189.peakDBC 112.478104 +blk189.rmsSPL 84.5146027 +blk189.rmsDBA 80.9771652 +blk189.rmsDBC 103.690468 +blk189.rough 8.58148384 +blk189.sharp 4.68895483 +blk189.fluct 41.2203979 +blk189.impuls 4.68490124 +blk189.tonal 43.3801155 +blk199.peakSPL 89.9998093 +blk199.peakDBA 92.8444901 +blk199.peakDBC 112.478104 +blk199.rmsSPL 84.6086426 +blk199.rmsDBA 81.0619659 +blk199.rmsDBC 103.791298 +blk199.rough 7.94964457 +blk199.sharp 4.8512187 +blk199.fluct 2.6803925 +blk199.impuls 4.70837021 +blk199.tonal 42.7671814 +blk209.peakSPL 89.9998093 +blk209.peakDBA 92.8444901 +blk209.peakDBC 112.478104 +blk209.rmsSPL 84.6086426 +blk209.rmsDBA 81.0619659 +blk209.rmsDBC 103.791298 +blk209.rough 7.94964457 +blk209.sharp 4.82969713 +blk209.fluct 2.6803925 +blk209.impuls 4.77536249 +blk209.tonal 40.2345581 +blk219.peakSPL 89.9998093 +blk219.peakDBA 92.8444901 +blk219.peakDBC 112.572418 +blk219.rmsSPL 84.6800232 +blk219.rmsDBA 81.134819 +blk219.rmsDBC 103.859192 +blk219.rough 7.93313885 +blk219.sharp 4.83749247 +blk219.fluct 2.6803925 +blk219.impuls 4.72972107 +blk219.tonal 45.1319351 +blk229.peakSPL 89.9998093 +blk229.peakDBA 90.5596085 +blk229.peakDBC 112.572418 +blk229.rmsSPL 84.7472382 +blk229.rmsDBA 81.1915512 +blk229.rmsDBC 103.938934 +blk229.rough 7.93313885 +blk229.sharp 4.63586569 +blk229.fluct 2.6803925 +blk229.impuls 4.64415598 +blk229.tonal 41.2752953 +blk239.peakSPL 89.9998016 +blk239.peakDBA 92.9141846 +blk239.peakDBC 112.572418 +blk239.rmsSPL 84.8018341 +blk239.rmsDBA 81.2460938 +blk239.rmsDBC 103.993706 +blk239.rough 8.07287502 +blk239.sharp 4.94269991 +blk239.fluct 2.6803925 +blk239.impuls 4.76838493 +blk239.tonal 49.1388931 +blk249.peakSPL 89.9998016 +blk249.peakDBA 92.9141846 +blk249.peakDBC 112.572418 +blk249.rmsSPL 84.8522644 +blk249.rmsDBA 81.2849197 +blk249.rmsDBC 104.050056 +blk249.rough 8.07287502 +blk249.sharp 5.17650986 +blk249.fluct 2.6803925 +blk249.impuls 4.63527727 +blk249.tonal 50.8172798 +blk259.peakSPL 89.9998016 +blk259.peakDBA 92.9141846 +blk259.peakDBC 112.572418 +blk259.rmsSPL 84.8522644 +blk259.rmsDBA 81.2849197 +blk259.rmsDBC 104.050056 +blk259.rough 7.37114859 +blk259.sharp 4.78528881 +blk259.fluct 2.6803925 +blk259.impuls 4.70672655 +blk259.tonal 39.7274399 +blk269.peakSPL 89.9998016 +blk269.peakDBA 92.9141846 +blk269.peakDBC 112.572418 +blk269.rmsSPL 84.8911667 +blk269.rmsDBA 81.3194122 +blk269.rmsDBC 104.090103 +blk269.rough 7.37114859 +blk269.sharp 4.92950916 +blk269.fluct 2.6803925 +blk269.impuls 4.6959939 +blk269.tonal 48.5387115 +blk279.peakSPL 89.999939 +blk279.peakDBA 92.9141846 +blk279.peakDBC 112.572418 +blk279.rmsSPL 84.9337387 +blk279.rmsDBA 81.364418 +blk279.rmsDBC 104.132446 +blk279.rough 7.62520552 +blk279.sharp 4.78946972 +blk279.fluct 2.6803925 +blk279.impuls 4.66306496 +blk279.tonal 43.6092453 +blk289.peakSPL 89.999939 +blk289.peakDBA 92.9141846 +blk289.peakDBC 112.572418 +blk289.rmsSPL 84.9816055 +blk289.rmsDBA 81.4005585 +blk289.rmsDBC 104.188919 +blk289.rough 7.62520552 +blk289.sharp 4.60955524 +blk289.fluct 2.6803925 +blk289.impuls 4.6882782 +blk289.tonal 37.5822487 +blk299.peakSPL 89.999939 +blk299.peakDBA 92.9141846 +blk299.peakDBC 112.572418 +blk299.rmsSPL 85.0037842 +blk299.rmsDBA 81.4030304 +blk299.rmsDBC 104.223045 +blk299.rough 8.16316795 +blk299.sharp 5.06028938 +blk299.fluct 2.01876569 +blk299.impuls 4.70986938 +blk299.tonal 51.4226341 +log.count 24 +log0.peakSPL 89.9965744 +log0.peakDBA 91.5471802 +log0.peakDBC 112.399101 +log0.rmsSPL 75.9405975 +log0.rmsDBA 72.3005371 +log0.rmsDBC 95.1374435 +log0.rough 0 +log0.fluct 0 +log0.sharp 4.80740738 +log0.sone 9.38302898 +log0.impuls 6.74638033 +log0.tonal 41.5431252 +log0.annoy 12.8548536 +log1.peakSPL 89.9997406 +log1.peakDBA 92.8444901 +log1.peakDBC 112.399101 +log1.rmsSPL 78.6692123 +log1.rmsDBA 75.1555405 +log1.rmsDBC 97.8064575 +log1.rough 19.9007053 +log1.fluct 0 +log1.sharp 4.6578207 +log1.sone 11.4363432 +log1.impuls 5.39838123 +log1.tonal 39.2025032 +log1.annoy 16.6311741 +log2.peakSPL 89.9998093 +log2.peakDBA 92.8444901 +log2.peakDBC 112.399101 +log2.rmsSPL 80.1789398 +log2.rmsDBA 76.6207886 +log2.rmsDBC 99.3495941 +log2.rough 19.9007053 +log2.fluct 0 +log2.sharp 4.95709705 +log2.sone 12.6588888 +log2.impuls 4.91601276 +log2.tonal 43.4781151 +log2.annoy 19.1297016 +log3.peakSPL 89.9998093 +log3.peakDBA 92.8444901 +log3.peakDBC 112.399101 +log3.rmsSPL 81.1759644 +log3.rmsDBA 77.6392365 +log3.rmsDBC 100.348335 +log3.rough 7.8035183 +log3.fluct 0 +log3.sharp 4.87248659 +log3.sone 13.5848207 +log3.impuls 4.69859886 +log3.tonal 48.8503036 +log3.annoy 20.0620613 +log4.peakSPL 89.9998093 +log4.peakDBA 92.8444901 +log4.peakDBC 112.399101 +log4.rmsSPL 81.9103775 +log4.rmsDBA 78.3491058 +log4.rmsDBC 101.099777 +log4.rough 7.8584342 +log4.fluct 0 +log4.sharp 4.91492367 +log4.sone 14.2699718 +log4.impuls 4.68419409 +log4.tonal 45.369175 +log4.annoy 21.3012848 +log5.peakSPL 89.9998093 +log5.peakDBA 92.8444901 +log5.peakDBC 112.399101 +log5.rmsSPL 82.4624557 +log5.rmsDBA 78.9199829 +log5.rmsDBC 101.644981 +log5.rough 7.8584342 +log5.fluct 0 +log5.sharp 4.73519945 +log5.sone 14.8459578 +log5.impuls 4.6610961 +log5.tonal 38.1295128 +log5.annoy 21.9045811 +log6.peakSPL 89.9998093 +log6.peakDBA 92.8444901 +log6.peakDBC 112.434143 +log6.rmsSPL 82.9003448 +log6.rmsDBA 79.3912125 +log6.rmsDBC 102.067207 +log6.rough 8.34216309 +log6.fluct 0 +log6.sharp 4.86769199 +log6.sone 15.3388805 +log6.impuls 4.61967993 +log6.tonal 43.113369 +log6.annoy 23.0429688 +log7.peakSPL 89.9998093 +log7.peakDBA 92.8444901 +log7.peakDBC 112.440407 +log7.rmsSPL 83.2435913 +log7.rmsDBA 79.6891479 +log7.rmsDBC 102.42923 +log7.rough 7.41312981 +log7.fluct 41.2203979 +log7.sharp 4.90628433 +log7.sone 15.6589413 +log7.impuls 4.67919064 +log7.tonal 43.5258713 +log7.annoy 24.5325584 +log8.peakSPL 89.9998093 +log8.peakDBA 92.8444901 +log8.peakDBC 112.440407 +log8.rmsSPL 83.5324936 +log8.rmsDBA 79.9764328 +log8.rmsDBC 102.717461 +log8.rough 7.41312981 +log8.fluct 41.2203979 +log8.sharp 4.76616621 +log8.sone 15.9738836 +log8.impuls 4.65805578 +log8.tonal 41.9584999 +log8.annoy 24.8061619 +log9.peakSPL 89.9998093 +log9.peakDBA 92.8444901 +log9.peakDBC 112.440407 +log9.rmsSPL 83.7749634 +log9.rmsDBA 80.2004242 +log9.rmsDBC 102.973907 +log9.rough 7.26287746 +log9.fluct 41.2203979 +log9.sharp 4.89933491 +log9.sone 16.2238293 +log9.impuls 4.70775938 +log9.tonal 43.98769 +log9.annoy 25.5160866 +log10.peakSPL 89.9998093 +log10.peakDBA 92.8444901 +log10.peakDBC 112.440407 +log10.rmsSPL 83.9719849 +log10.rmsDBA 80.387085 +log10.rmsDBC 103.182404 +log10.rough 7.26287746 +log10.fluct 41.2203979 +log10.sharp 4.80583096 +log10.sone 16.4351044 +log10.impuls 4.70854568 +log10.tonal 44.8206444 +log10.annoy 25.693161 +log11.peakSPL 89.9998093 +log11.peakDBA 92.8444901 +log11.peakDBC 112.478104 +log11.rmsSPL 84.1417542 +log11.rmsDBA 80.5870056 +log11.rmsDBC 103.337425 +log11.rough 7.61625624 +log11.fluct 41.2203979 +log11.sharp 4.75879383 +log11.sone 16.6644363 +log11.impuls 4.72507238 +log11.tonal 45.419117 +log11.annoy 26.0350037 +log12.peakSPL 89.9998093 +log12.peakDBA 92.8444901 +log12.peakDBC 112.478104 +log12.rmsSPL 84.2887955 +log12.rmsDBA 80.7350769 +log12.rmsDBC 103.483376 +log12.rough 7.76799393 +log12.fluct 41.2203979 +log12.sharp 4.6882658 +log12.sone 16.8363533 +log12.impuls 4.70509052 +log12.tonal 39.2171402 +log12.annoy 26.2015514 +log13.peakSPL 89.9998093 +log13.peakDBA 92.8444901 +log13.peakDBC 112.478104 +log13.rmsSPL 84.4117432 +log13.rmsDBA 80.8442307 +log13.rmsDBC 103.605721 +log13.rough 7.76799393 +log13.fluct 41.2203979 +log13.sharp 4.8667531 +log13.sone 16.9642181 +log13.impuls 4.6581769 +log13.tonal 39.9880028 +log13.annoy 26.8258972 +log14.peakSPL 89.9998093 +log14.peakDBA 92.8444901 +log14.peakDBC 112.478104 +log14.rmsSPL 84.5146027 +log14.rmsDBA 80.9771652 +log14.rmsDBC 103.690468 +log14.rough 8.58148384 +log14.fluct 41.2203979 +log14.sharp 4.86495161 +log14.sone 17.1212521 +log14.impuls 4.74343538 +log14.tonal 46.8078194 +log14.annoy 27.1873245 +log15.peakSPL 89.9998093 +log15.peakDBA 92.8444901 +log15.peakDBC 112.478104 +log15.rmsSPL 84.6086426 +log15.rmsDBA 81.0619659 +log15.rmsDBC 103.791298 +log15.rough 7.94964457 +log15.fluct 2.6803925 +log15.sharp 4.8512187 +log15.sone 17.222187 +log15.impuls 4.70837021 +log15.tonal 42.7671814 +log15.annoy 26.4237518 +log16.peakSPL 89.9998093 +log16.peakDBA 92.8444901 +log16.peakDBC 112.572418 +log16.rmsSPL 84.6800232 +log16.rmsDBA 81.134819 +log16.rmsDBC 103.859192 +log16.rough 7.94964457 +log16.fluct 2.6803925 +log16.sharp 4.89598799 +log16.sone 17.3093777 +log16.impuls 4.71449614 +log16.tonal 41.5998192 +log16.annoy 26.6877689 +log17.peakSPL 89.9998093 +log17.peakDBA 90.5596085 +log17.peakDBC 112.572418 +log17.rmsSPL 84.7472382 +log17.rmsDBA 81.1915512 +log17.rmsDBC 103.938934 +log17.rough 7.93313885 +log17.fluct 2.6803925 +log17.sharp 4.63923407 +log17.sone 17.3775749 +log17.impuls 4.73171759 +log17.tonal 39.4679222 +log17.annoy 26.1582966 +log18.peakSPL 89.9998016 +log18.peakDBA 92.9141846 +log18.peakDBC 112.572418 +log18.rmsSPL 84.8018341 +log18.rmsDBA 81.2460938 +log18.rmsDBC 103.993706 +log18.rough 7.93313885 +log18.fluct 2.6803925 +log18.sharp 4.8093152 +log18.sone 17.4434013 +log18.impuls 4.74472761 +log18.tonal 44.1460571 +log18.annoy 26.6996269 +log19.peakSPL 89.9998016 +log19.peakDBA 92.9141846 +log19.peakDBC 112.572418 +log19.rmsSPL 84.8522644 +log19.rmsDBA 81.2849197 +log19.rmsDBC 104.050056 +log19.rough 8.07287502 +log19.fluct 2.6803925 +log19.sharp 5.17650986 +log19.sone 17.490406 +log19.impuls 4.63527727 +log19.tonal 50.8172798 +log19.annoy 27.7347641 +log20.peakSPL 89.9998016 +log20.peakDBA 92.9141846 +log20.peakDBC 112.572418 +log20.rmsSPL 84.8911667 +log20.rmsDBA 81.3194122 +log20.rmsDBC 104.090103 +log20.rough 7.37114859 +log20.fluct 2.6803925 +log20.sharp 4.81301403 +log20.sone 17.5322742 +log20.impuls 4.77950811 +log20.tonal 45.5682449 +log20.annoy 26.8183098 +log21.peakSPL 89.999939 +log21.peakDBA 92.9141846 +log21.peakDBC 112.572418 +log21.rmsSPL 84.9337387 +log21.rmsDBA 81.364418 +log21.rmsDBC 104.132446 +log21.rough 7.37114859 +log21.fluct 2.6803925 +log21.sharp 5.00042868 +log21.sone 17.5870514 +log21.impuls 4.75850534 +log21.tonal 48.8982468 +log21.annoy 27.3985806 +log22.peakSPL 89.999939 +log22.peakDBA 92.9141846 +log22.peakDBC 112.572418 +log22.rmsSPL 84.9816055 +log22.rmsDBA 81.4005585 +log22.rmsDBC 104.188919 +log22.rough 7.62520552 +log22.fluct 2.6803925 +log22.sharp 4.94797325 +log22.sone 17.6311626 +log22.impuls 4.61040974 +log22.tonal 50.2772636 +log22.annoy 27.3590374 +log23.peakSPL 89.999939 +log23.peakDBA 92.9141846 +log23.peakDBC 112.572418 +log23.rmsSPL 85.0037842 +log23.rmsDBA 81.4030304 +log23.rmsDBC 104.223045 +log23.rough 8.16316795 +log23.fluct 2.01876569 +log23.sharp 5.06028938 +log23.sone 17.6341858 +log23.impuls 4.70986938 +log23.tonal 51.4226341 +log23.annoy 27.6654644 +fft-1.0 -0.047069706 +fft-1.7 0.0604396723 +fft-1.14 0.062802054 +fft-1.21 -0.00821822882 +fft-1.28 0.0495537631 +fft-1.35 0.0285441037 +fft-1.42 -0.0450735278 +fft-1.49 0.0701034442 +fft-1.56 0.0543211475 +fft-1.63 -0.00292198057 +fft-1.70 -0.0307158828 +fft-1.77 0.0690330043 +fft-1.84 -0.0874522552 +fft-1.91 0.0377756022 +fft-1.98 0.0765054375 +fft-1.105 0.0301455613 +fft-1.112 -0.0978915095 +fft-1.119 0.081541501 +fft-1.126 -0.00680800667 +fft-1.133 -0.0755758882 +fft-1.140 0.0332190171 +fft-1.147 0.0713378787 +fft-1.154 0.0415614359 +fft-1.161 0.00637040148 +fft-1.168 0.0439847969 +fft-1.175 0.0148073556 +fft-1.182 0.0870043039 +fft-1.189 0.0599021204 +fft-1.196 0.0645837113 +fft-1.203 0.0339485668 +fft-1.210 -0.00449363003 +fft-1.217 0.0971169695 +fft-1.224 0.0177794099 +fft-1.231 0.0785646215 +fft-1.238 0.0545008667 +fft-1.245 0.0937504992 +fft-1.252 -0.0868687332 +fft-1.259 -0.00582800526 +fft-1.266 -0.0753531232 +fft-1.273 0.0195937399 +fft-1.280 -0.0554562211 +fft-1.287 -0.00485174684 +fft-1.294 0.0627510324 +fft-1.301 -0.09354987 +fft-1.308 0.0266952999 +fft-1.315 0.0367863886 +fft-1.322 0.0569135435 +fft-1.329 0.0832529441 +fft-1.336 -0.0365745239 +fft-1.343 -0.0358700156 +fft-1.350 0.0923705325 +fft-1.357 0.0982633829 +fft-1.364 -0.00712723751 +fft-1.371 0.0294474848 +fft-1.378 -0.0559159294 +fft-1.385 0.0526711605 +fft-1.392 0.028000176 +fft-1.399 -0.042352926 +fft-1.406 -0.088629052 +fft-1.413 0.0570058711 +fft-1.420 0.0448017716 +fft-1.427 0.0884220824 +fft-1.434 -0.000986886094 +fft-1.441 0.068440415 +fft-1.448 0.000737249851 +fft-1.455 0.064469032 +fft-1.462 0.078051284 +fft-1.469 -0.0831541196 +fft-1.476 0.0263435375 +fft-1.483 0.052370429 +fft-1.490 -0.0115594631 +fft-1.497 -0.0581142716 +fft-1.504 -0.0101999938 +fft-1.511 -0.0684792921 +fft-1.518 0.0600306988 +fft-1.525 -0.0879122615 +fft-1.532 -0.0204491373 +fft-1.539 0.0331249833 +fft-1.546 0.0945589766 +fft-1.553 0.0304818042 +fft-1.560 -0.000163245204 +fft-1.567 0.0956336632 +fft-1.574 -0.0916342959 +fft-1.581 0.0591627471 +fft-1.588 0.00168246031 +fft-1.595 -0.097834982 +fft-1.602 0.0599067211 +fft-1.609 0.0207566153 +fft-1.616 0.0815118104 +fft-1.623 0.0430860408 +fft-1.630 0.0567830205 +fft-1.637 0.0562267676 +fft-1.644 -0.0735707358 +fft-1.651 0.0697655827 +fft-1.658 -0.0738440081 +fft-1.665 0.0783148929 +fft-1.672 -0.0498798192 +fft-1.679 -0.0787034407 +fft-1.686 -0.0867345706 +fft-1.693 -0.0445482098 +fft-1.700 0.0423093326 +fft-1.707 0.0959906504 +fft-1.714 -0.0555950478 +fft-1.721 0.0207702275 +fft-1.728 -0.0739777014 +fft-1.735 -0.0651311651 +fft-1.742 0.0213061702 +fft-1.749 -0.0504747294 +fft-1.756 0.00493328599 +fft-1.763 0.0201689359 +fft-1.770 -0.0328256302 +fft-1.777 0.0680834204 +fft-1.784 0.0847377107 +fft-1.791 -0.0357904099 +fft-1.798 -0.0420242548 +fft-1.805 -0.0567212366 +fft-1.812 0.0228037592 +fft-1.819 -0.0429952331 +fft-1.826 0.00890908297 +fft-1.833 -0.0892884731 +fft-1.840 0.0341726057 +fft-1.847 0.0162650347 +fft-1.854 0.0537463538 +fft-1.861 0.00110499864 +fft-1.868 -0.0140580358 +fft-1.875 -0.0518744849 +fft-1.882 -0.0292131733 +fft-1.889 -0.040154811 +fft-1.896 0.0457529798 +fft-1.903 -0.0585221723 +fft-1.910 0.0662211999 +fft-1.917 0.00234060292 +fft-1.924 0.0816268921 +fft-1.931 0.071225442 +fft-1.938 -0.0985076204 +fft-1.945 0.0187128671 +fft-1.952 -0.0370742977 +fft-1.959 0.0313335918 +fft-1.966 -0.0950128138 +fft-1.973 -0.0108906804 +fft-1.980 -0.0197788831 +fft-1.987 -0.0574608035 +fft-1.994 -0.0771661699 +fft-1.1001 -0.073209323 +fft-1.1008 0.0300882813 +fft-1.1015 -0.0299659204 +fft-1.1022 -0.00807912368 +fft-1.1029 -0.0392172299 +fft-1.1036 0.0600903518 +fft-1.1043 -0.0576072894 +fft-1.1050 0.0319029093 +fft-1.1057 0.0742858797 +fft-1.1064 0.00515239267 +fft-1.1071 0.0383578539 +fft-1.1078 -0.0528752618 +fft-1.1085 0.0599520095 +fft-1.1092 -0.0968871042 +fft-1.1099 0.0133867031 +fft-1.1106 -0.00875139888 +fft-1.1113 0.017867554 +fft-1.1120 -0.0749596134 +fft-1.1127 0.0182151552 +fft-1.1134 0.0237520933 +fft-1.1141 -0.0857801363 +fft-1.1148 0.0588920824 +fft-1.1155 -0.0574893616 +fft-1.1162 -0.083834812 +fft-1.1169 0.0876574889 +fft-1.1176 0.0699134618 +fft-1.1183 0.0944324285 +fft-1.1190 -0.0796539113 +fft-1.1197 0.0455285423 +fft-1.1204 0.0102498056 +fft-1.1211 0.0947386026 +fft-1.1218 0.0375609174 +fft-1.1225 -0.0695443526 +fft-1.1232 0.0410399102 +fft-1.1239 0.0567021258 +fft-1.1246 0.0365130678 +fft-1.1253 0.0452755205 +fft-1.1260 -0.00257472997 +fft-1.1267 -0.0355212949 +fft-1.1274 -0.0843150765 +fft-1.1281 -0.0839686319 +fft-1.1288 -0.0890918151 +fft-1.1295 -0.00723351864 +fft-1.1302 -0.0287195574 +fft-1.1309 0.0407675505 +fft-1.1316 -0.0197671652 +fft-1.1323 0.0367581621 +fft-1.1330 -0.0564566813 +fft-1.1337 0.0911282897 +fft-1.1344 0.0140375374 +fft-1.1351 0.0222290754 +fft-1.1358 -0.0570198186 +fft-1.1365 0.0648104101 +fft-1.1372 -0.0282999706 +fft-1.1379 -0.0922030509 +fft-1.1386 0.0364210606 +fft-1.1393 -0.031057978 +fft-1.1400 -0.0534175448 +fft-1.1407 -0.0294719581 +fft-1.1414 -0.0156966802 +fft-1.1421 0.0679832622 +fft-1.1428 0.0601983778 +fft-1.1435 0.00263570552 +fft-1.1442 0.0529692434 +fft-1.1449 0.046258498 +fft-1.1456 0.0662487969 +fft-1.1463 -0.059230756 +fft-1.1470 -0.0290699136 +fft-1.1477 -0.0190567207 +fft-1.1484 0.0420723073 +fft-1.1491 0.0627171174 +fft-1.1498 -0.0560800545 +fft-1.1505 0.0190617088 +fft-1.1512 0.0912496969 +fft-1.1519 0.0635620579 +fft-1.1526 -0.0655305311 +fft-1.1533 -0.0979006439 +fft-1.1540 0.0948440582 +fft-1.1547 0.078515552 +fft-1.1554 -0.0854295865 +fft-1.1561 -0.00139232283 +fft-1.1568 0.0754375085 +fft-1.1575 -0.0317034237 +fft-1.1582 0.0227123741 +fft-1.1589 -0.0127039431 +fft-1.1596 -0.0549600907 +fft-1.1603 -0.0962201506 +fft-1.1610 0.04490906 +fft-1.1617 0.0793380737 +fft-1.1624 -0.0228523258 +fft-1.1631 -0.0307443328 +fft-1.1638 -0.0914448723 +fft-1.1645 0.0240406394 +fft-1.1652 -0.0138839185 +fft-1.1659 -0.0173791293 +fft-1.1666 -0.0108422404 +fft-1.1673 -0.0985752121 +fft-1.1680 0.0437486283 +fft-1.1687 -0.0171247255 +fft-1.1694 0.0104512693 +fft-1.1701 -0.0886109471 +fft-1.1708 0.0284618493 +fft-1.1715 -0.0349536724 +fft-1.1722 -0.0663329288 +fft-1.1729 0.00833690166 +fft-1.1736 0.0213946234 +fft-1.1743 0.0399267189 +fft-1.1750 -0.0363901965 +fft-1.1757 0.032913994 +fft-1.1764 0.0787453279 +fft-1.1771 -0.0154129146 +fft-1.1778 0.023193432 +fft-1.1785 -0.08970429 +fft-1.1792 0.0815523192 +fft-1.1799 0.0485409983 +fft-1.1806 0.02054739 +fft-1.1813 -0.0407261327 +fft-1.1820 0.0703507811 +fft-1.1827 -0.0290975105 +fft-1.1834 -0.023220038 +fft-1.1841 -0.0432756022 +fft-1.1848 0.0583205335 +fft-1.1855 -0.0679702535 +fft-1.1862 -0.00283081527 +fft-1.1869 -0.0432596095 +fft-1.1876 -0.0154103879 +fft-1.1883 -0.0379422121 +fft-1.1890 -0.0990191922 +fft-1.1897 0.069504559 +fft-1.1904 -0.0922467038 +fft-1.1911 0.0308148395 +fft-1.1918 -0.00510068564 +fft-1.1925 0.00940793753 +fft-1.1932 0.0171358716 +fft-1.1939 0.00925261993 +fft-1.1946 0.0152315376 +fft-1.1953 -0.0625330359 +fft-1.1960 -0.0774975047 +fft-1.1967 -0.00609818101 +fft-1.1974 0.0820617229 +fft-1.1981 -0.00765821943 +fft-1.1988 0.0944504961 +fft-1.1995 0.0260694157 +fft-1.2002 0.00404964713 +fft-1.2009 -0.0107290093 +fft-1.2016 -0.051763244 +fft-1.2023 0.0712560564 +fft-1.2030 -0.020210309 +fft-1.2037 0.073859714 +fft-1.2044 -0.0134250997 +fft-1.2051 0.0129235629 +fft-1.2058 -0.0982004032 +fft-1.2065 -0.00381427421 +fft-1.2072 0.0918421894 +fft-1.2079 0.0954684988 +fft-1.2086 0.0317755938 +fft-1.2093 0.0890247598 +fft-1.2100 0.0910952687 +fft-1.2107 0.0623847358 +fft-1.2114 0.0496400967 +fft-1.2121 -0.0998727456 +fft-1.2128 0.0333726183 +fft-1.2135 -0.0788232014 +fft-1.2142 0.00614769477 +fft-1.2149 -0.0773210153 +fft-1.2156 0.00384027953 +fft-1.2163 0.0896277353 +fft-1.2170 -0.0466689765 +fft-1.2177 0.0919117704 +fft-1.2184 0.0728909895 +fft-1.2191 -0.0726988539 +fft-1.2198 -0.0734210312 +fft-1.2205 -0.0620743893 +fft-1.2212 -0.0427682884 +fft-1.2219 -0.0540988036 +fft-1.2226 0.00481491117 +fft-1.2233 -0.0329299867 +fft-1.2240 -0.0852813348 +fft-1.2247 0.0648116022 +fft-1.2254 0.0377317928 +fft-1.2261 -0.0539929047 +fft-1.2268 -0.0578438118 +fft-1.2275 0.0396086946 +fft-1.2282 0.0288043264 +fft-1.2289 0.00834612828 +fft-1.2296 0.00179822452 +fft-1.2303 0.0657825246 +fft-1.2310 0.0428879969 +fft-1.2317 -0.0627100393 +fft-1.2324 -0.0503336787 +fft-1.2331 -0.0217983909 +fft-1.2338 0.0861308575 +fft-1.2345 -0.0276063681 +fft-1.2352 -0.0594824962 +fft-1.2359 0.0254624244 +fft-1.2366 -0.0946625322 +fft-1.2373 -0.0850216374 +fft-1.2380 -0.0247672442 +fft-1.2387 0.0403391011 +fft-1.2394 -0.0739926472 +fft-1.2401 0.0596446283 +fft-1.2408 -0.0788054988 +fft-1.2415 -0.0367974415 +fft-1.2422 0.054313194 +fft-1.2429 -0.0528410077 +fft-1.2436 -0.0158369839 +fft-1.2443 0.0554147735 +fft-1.2450 -0.0656953976 +fft-1.2457 -0.05369379 +fft-1.2464 -0.0121563375 +fft-1.2471 0.0783371702 +fft-1.2478 -0.0911292359 +fft-1.2485 0.0450279117 +fft-1.2492 -0.00658700475 +fft-1.2499 -0.0145737175 +fft-1.2506 -0.043677628 +fft-1.2513 -0.0744525194 +fft-1.2520 0.0878263265 +fft-1.2527 0.0741265416 +fft-1.2534 -0.0386739485 +fft-1.2541 -0.0295757409 +fft-1.2548 -0.0735468045 +fft-1.2555 -0.0613086484 +fft-1.2562 -0.0999607965 +fft-1.2569 -0.00864383578 +fft-1.2576 0.0224402547 +fft-1.2583 -0.075604707 +fft-1.2590 -0.0123861907 +fft-1.2597 0.0897226855 +fft-1.2604 0.0974266157 +fft-1.2611 -0.0301194079 +fft-1.2618 0.00597782154 +fft-1.2625 -0.0269873925 +fft-1.2632 -0.0490044132 +fft-1.2639 -0.0652072951 +fft-1.2646 0.00427018432 +fft-1.2653 0.0764827952 +fft-1.2660 0.0243289005 +fft-1.2667 0.0388018601 +fft-1.2674 -0.0178337395 +fft-1.2681 0.0547059774 +fft-1.2688 -0.0748877153 +fft-1.2695 0.0977174416 +fft-1.2702 0.0603680126 +fft-1.2709 0.0522160418 +fft-1.2716 -0.0128641902 +fft-1.2723 0.0993333012 +fft-1.2730 -0.0138091268 +fft-1.2737 0.0571925417 +fft-1.2744 0.0211578254 +fft-1.2751 0.0764200017 +fft-1.2758 0.0756946951 +fft-1.2765 -0.0170033872 +fft-1.2772 -0.0757853985 +fft-1.2779 0.092606537 +fft-1.2786 -0.0503352992 +fft-1.2793 -0.0514675565 +fft-1.2800 -0.0251146257 +fft-1.2807 0.0622801557 +fft-1.2814 0.0457900763 +fft-1.2821 0.0237789992 +fft-1.2828 -0.0575744212 +fft-1.2835 -0.0613193028 +fft-1.2842 -0.08215639 +fft-1.2849 -0.0229710173 +fft-1.2856 0.0427998193 +fft-1.2863 0.0369163863 +fft-1.2870 0.00771182775 +fft-1.2877 -0.0235702153 +fft-1.2884 0.0431092642 +fft-1.2891 -0.0751905143 +fft-1.2898 0.0206357725 +fft-1.2905 0.070343174 +fft-1.2912 0.0284976494 +fft-1.2919 -0.0675101727 +fft-1.2926 -0.0407363139 +fft-1.2933 -0.0514144413 +fft-1.2940 -0.0322840512 +fft-1.2947 -0.036587853 +fft-1.2954 -0.0843002424 +fft-1.2961 0.0862213522 +fft-1.2968 -0.011416221 +fft-1.2975 0.0863837227 +fft-1.2982 -0.0643395856 +fft-1.2989 -0.0612709485 +fft-1.2996 -0.0252990257 +fft-1.3003 0.00584968319 +fft-1.3010 -0.0880160779 +fft-1.3017 -0.0365642272 +fft-1.3024 -0.0247559976 +fft-1.3031 0.0560694598 +fft-1.3038 0.0879878774 +fft-1.3045 0.0401863717 +fft-1.3052 -0.0268949997 +fft-1.3059 -0.0807790682 +fft-1.3066 0.0883926377 +fft-1.3073 0.0142348651 +fft-1.3080 0.0854472294 +fft-1.3087 -0.000554001366 +fft-1.3094 -0.055595614 +fft-1.3101 0.00124086149 +fft-1.3108 -0.0340678953 +fft-1.3115 -0.0849737376 +fft-1.3122 -0.0588447452 +fft-1.3129 -0.0360447243 +fft-1.3136 -0.085363321 +fft-1.3143 0.0503836274 +fft-1.3150 0.00876369514 +fft-1.3157 0.0662870929 +fft-1.3164 0.0507407449 +fft-1.3171 -0.00286497478 +fft-1.3178 -0.00168388488 +fft-1.3185 -0.0636533201 +fft-1.3192 -0.0870223269 +fft-1.3199 -0.0320675485 +fft-1.3206 -0.0879258141 +fft-1.3213 0.0975046381 +fft-1.3220 -0.0560179837 +fft-1.3227 0.0680699348 +fft-1.3234 -0.0527025573 +fft-1.3241 -0.00871736463 +fft-1.3248 0.0970138237 +fft-1.3255 0.000392687332 +fft-1.3262 0.0839140341 +fft-1.3269 -0.00542932143 +fft-1.3276 0.0074826479 +fft-1.3283 -0.0961893424 +fft-1.3290 0.0701122805 +fft-1.3297 -0.0564070158 +fft-1.3304 -0.0786676779 +fft-1.3311 -0.0269936156 +fft-1.3318 -0.015157992 +fft-1.3325 0.0585407875 +fft-1.3332 -0.0459077917 +fft-1.3339 -0.00276555424 +fft-1.3346 0.00518289814 +fft-1.3353 0.0225702059 +fft-1.3360 0.038279321 +fft-1.3367 -0.0868440121 +fft-1.3374 -0.0161559936 +fft-1.3381 -0.0168113466 +fft-1.3388 -0.0028439879 +fft-1.3395 -0.0626663417 +fft-1.3402 -0.0498607121 +fft-1.3409 -0.0286385063 +fft-1.3416 -0.0855636224 +fft-1.3423 -0.0865586847 +fft-1.3430 0.0309697986 +fft-1.3437 -0.0599636547 +fft-1.3444 0.076018095 +fft-1.3451 0.06592419 +fft-1.3458 -0.069058083 +fft-1.3465 -0.0522590652 +fft-1.3472 -0.0801160261 +fft-1.3479 0.0355855003 +fft-1.3486 0.0571740642 +fft-1.3493 -0.0162822194 +fft-1.3500 0.03480611 +fft-1.3507 0.0723574683 +fft-1.3514 0.0282528643 +fft-1.3521 0.0494005196 +fft-1.3528 -0.0102499006 +fft-1.3535 0.0509221666 +fft-1.3542 0.0115057947 +fft-1.3549 0.0465864912 +fft-1.3556 -0.00413554907 +fft-1.3563 0.00587871065 +fft-1.3570 0.00849649962 +fft-1.3577 0.082354717 +fft-1.3584 0.0139154671 +fft-1.3591 -0.0499723032 +fft-1.3598 0.0900680572 +fft-1.3605 0.0074693202 +fft-1.3612 -0.0260287356 +fft-1.3619 0.0183922648 +fft-1.3626 -0.0077533545 +fft-1.3633 -0.0995594412 +fft-1.3640 -0.0785905048 +fft-1.3647 -0.0178199708 +fft-1.3654 -0.0824798197 +fft-1.3661 0.0445742868 +fft-1.3668 -0.00539250998 +fft-1.3675 -0.0337952375 +fft-1.3682 0.0188416 +fft-1.3689 0.015343857 +fft-1.3696 0.0605993383 +fft-1.3703 0.0729285255 +fft-1.3710 0.0456232913 +fft-1.3717 -0.0820645615 +fft-1.3724 -0.0778391883 +fft-1.3731 -0.0439183824 +fft-1.3738 0.00724059343 +fft-1.3745 -0.0970381647 +fft-1.3752 0.0899222046 +fft-1.3759 0.0443984047 +fft-1.3766 0.0790044591 +fft-1.3773 -0.0925155059 +fft-1.3780 0.0681974441 +fft-1.3787 0.051230371 +fft-1.3794 0.0935977921 +fft-1.3801 -0.0311387237 +fft-1.3808 0.0889995024 +fft-1.3815 0.0146900183 +fft-1.3822 -0.0256765317 +fft-1.3829 -0.00576137891 +fft-1.3836 -0.0934659764 +fft-1.3843 -0.0968870595 +fft-1.3850 0.0172877442 +fft-1.3857 0.0872161314 +fft-1.3864 0.0582963601 +fft-1.3871 0.0716056228 +fft-1.3878 0.0200511348 +fft-1.3885 0.0989028439 +fft-1.3892 -0.0140003981 +fft-1.3899 -0.0699282885 +fft-1.3906 0.038719546 +fft-1.3913 -0.0242881607 +fft-1.3920 0.0825636983 +fft-1.3927 -0.0492571183 +fft-1.3934 0.00278930669 +fft-1.3941 -0.0583148599 +fft-1.3948 0.0261548515 +fft-1.3955 -0.0257159118 +fft-1.3962 -0.00576529512 +fft-1.3969 -0.0208444484 +fft-1.3976 0.0099823717 +fft-1.3983 0.0776210055 +fft-1.3990 0.0798105374 +fft-1.3997 0.0547857992 +fft-1.4004 -0.0809947699 +fft-1.4011 0.0678694174 +fft-1.4018 0.0236401688 +fft-1.4025 -0.0285877474 +fft-1.4032 0.0871877223 +fft-1.4039 0.0642022118 +fft-1.4046 0.00297262683 +fft-1.4053 -0.0210871454 +fft-1.4060 -0.0261483137 +fft-1.4067 0.0511567108 +fft-1.4074 0.0700118765 +fft-1.4081 0.034361124 +fft-1.4088 -0.0329067782 +fft-1.4095 0.0932406932 +fft0.0 -0.047069706 +fft0.7 0.0604396723 +fft0.14 0.062802054 +fft0.21 -0.00821822882 +fft0.28 0.0495537631 +fft0.35 0.0285441037 +fft0.42 -0.0450735278 +fft0.49 0.0701034442 +fft0.56 0.0543211475 +fft0.63 -0.00292198057 +fft0.70 -0.0307158828 +fft0.77 0.0690330043 +fft0.84 -0.0874522552 +fft0.91 0.0377756022 +fft0.98 0.0765054375 +fft0.105 0.0301455613 +fft0.112 -0.0978915095 +fft0.119 0.081541501 +fft0.126 -0.00680800667 +fft0.133 -0.0755758882 +fft0.140 0.0332190171 +fft0.147 0.0713378787 +fft0.154 0.0415614359 +fft0.161 0.00637040148 +fft0.168 0.0439847969 +fft0.175 0.0148073556 +fft0.182 0.0870043039 +fft0.189 0.0599021204 +fft0.196 0.0645837113 +fft0.203 0.0339485668 +fft0.210 -0.00449363003 +fft0.217 0.0971169695 +fft0.224 0.0177794099 +fft0.231 0.0785646215 +fft0.238 0.0545008667 +fft0.245 0.0937504992 +fft0.252 -0.0868687332 +fft0.259 -0.00582800526 +fft0.266 -0.0753531232 +fft0.273 0.0195937399 +fft0.280 -0.0554562211 +fft0.287 -0.00485174684 +fft0.294 0.0627510324 +fft0.301 -0.09354987 +fft0.308 0.0266952999 +fft0.315 0.0367863886 +fft0.322 0.0569135435 +fft0.329 0.0832529441 +fft0.336 -0.0365745239 +fft0.343 -0.0358700156 +fft0.350 0.0923705325 +fft0.357 0.0982633829 +fft0.364 -0.00712723751 +fft0.371 0.0294474848 +fft0.378 -0.0559159294 +fft0.385 0.0526711605 +fft0.392 0.028000176 +fft0.399 -0.042352926 +fft0.406 -0.088629052 +fft0.413 0.0570058711 +fft0.420 0.0448017716 +fft0.427 0.0884220824 +fft0.434 -0.000986886094 +fft0.441 0.068440415 +fft0.448 0.000737249851 +fft0.455 0.064469032 +fft0.462 0.078051284 +fft0.469 -0.0831541196 +fft0.476 0.0263435375 +fft0.483 0.052370429 +fft0.490 -0.0115594631 +fft0.497 -0.0581142716 +fft0.504 -0.0101999938 +fft0.511 -0.0684792921 +fft0.518 0.0600306988 +fft0.525 -0.0879122615 +fft0.532 -0.0204491373 +fft0.539 0.0331249833 +fft0.546 0.0945589766 +fft0.553 0.0304818042 +fft0.560 -0.000163245204 +fft0.567 0.0956336632 +fft0.574 -0.0916342959 +fft0.581 0.0591627471 +fft0.588 0.00168246031 +fft0.595 -0.097834982 +fft0.602 0.0599067211 +fft0.609 0.0207566153 +fft0.616 0.0815118104 +fft0.623 0.0430860408 +fft0.630 0.0567830205 +fft0.637 0.0562267676 +fft0.644 -0.0735707358 +fft0.651 0.0697655827 +fft0.658 -0.0738440081 +fft0.665 0.0783148929 +fft0.672 -0.0498798192 +fft0.679 -0.0787034407 +fft0.686 -0.0867345706 +fft0.693 -0.0445482098 +fft0.700 0.0423093326 +fft0.707 0.0959906504 +fft0.714 -0.0555950478 +fft0.721 0.0207702275 +fft0.728 -0.0739777014 +fft0.735 -0.0651311651 +fft0.742 0.0213061702 +fft0.749 -0.0504747294 +fft0.756 0.00493328599 +fft0.763 0.0201689359 +fft0.770 -0.0328256302 +fft0.777 0.0680834204 +fft0.784 0.0847377107 +fft0.791 -0.0357904099 +fft0.798 -0.0420242548 +fft0.805 -0.0567212366 +fft0.812 0.0228037592 +fft0.819 -0.0429952331 +fft0.826 0.00890908297 +fft0.833 -0.0892884731 +fft0.840 0.0341726057 +fft0.847 0.0162650347 +fft0.854 0.0537463538 +fft0.861 0.00110499864 +fft0.868 -0.0140580358 +fft0.875 -0.0518744849 +fft0.882 -0.0292131733 +fft0.889 -0.040154811 +fft0.896 0.0457529798 +fft0.903 -0.0585221723 +fft0.910 0.0662211999 +fft0.917 0.00234060292 +fft0.924 0.0816268921 +fft0.931 0.071225442 +fft0.938 -0.0985076204 +fft0.945 0.0187128671 +fft0.952 -0.0370742977 +fft0.959 0.0313335918 +fft0.966 -0.0950128138 +fft0.973 -0.0108906804 +fft0.980 -0.0197788831 +fft0.987 -0.0574608035 +fft0.994 -0.0771661699 +fft0.1001 -0.073209323 +fft0.1008 0.0300882813 +fft0.1015 -0.0299659204 +fft0.1022 -0.00807912368 +fft0.1029 -0.0392172299 +fft0.1036 0.0600903518 +fft0.1043 -0.0576072894 +fft0.1050 0.0319029093 +fft0.1057 0.0742858797 +fft0.1064 0.00515239267 +fft0.1071 0.0383578539 +fft0.1078 -0.0528752618 +fft0.1085 0.0599520095 +fft0.1092 -0.0968871042 +fft0.1099 0.0133867031 +fft0.1106 -0.00875139888 +fft0.1113 0.017867554 +fft0.1120 -0.0749596134 +fft0.1127 0.0182151552 +fft0.1134 0.0237520933 +fft0.1141 -0.0857801363 +fft0.1148 0.0588920824 +fft0.1155 -0.0574893616 +fft0.1162 -0.083834812 +fft0.1169 0.0876574889 +fft0.1176 0.0699134618 +fft0.1183 0.0944324285 +fft0.1190 -0.0796539113 +fft0.1197 0.0455285423 +fft0.1204 0.0102498056 +fft0.1211 0.0947386026 +fft0.1218 0.0375609174 +fft0.1225 -0.0695443526 +fft0.1232 0.0410399102 +fft0.1239 0.0567021258 +fft0.1246 0.0365130678 +fft0.1253 0.0452755205 +fft0.1260 -0.00257472997 +fft0.1267 -0.0355212949 +fft0.1274 -0.0843150765 +fft0.1281 -0.0839686319 +fft0.1288 -0.0890918151 +fft0.1295 -0.00723351864 +fft0.1302 -0.0287195574 +fft0.1309 0.0407675505 +fft0.1316 -0.0197671652 +fft0.1323 0.0367581621 +fft0.1330 -0.0564566813 +fft0.1337 0.0911282897 +fft0.1344 0.0140375374 +fft0.1351 0.0222290754 +fft0.1358 -0.0570198186 +fft0.1365 0.0648104101 +fft0.1372 -0.0282999706 +fft0.1379 -0.0922030509 +fft0.1386 0.0364210606 +fft0.1393 -0.031057978 +fft0.1400 -0.0534175448 +fft0.1407 -0.0294719581 +fft0.1414 -0.0156966802 +fft0.1421 0.0679832622 +fft0.1428 0.0601983778 +fft0.1435 0.00263570552 +fft0.1442 0.0529692434 +fft0.1449 0.046258498 +fft0.1456 0.0662487969 +fft0.1463 -0.059230756 +fft0.1470 -0.0290699136 +fft0.1477 -0.0190567207 +fft0.1484 0.0420723073 +fft0.1491 0.0627171174 +fft0.1498 -0.0560800545 +fft0.1505 0.0190617088 +fft0.1512 0.0912496969 +fft0.1519 0.0635620579 +fft0.1526 -0.0655305311 +fft0.1533 -0.0979006439 +fft0.1540 0.0948440582 +fft0.1547 0.078515552 +fft0.1554 -0.0854295865 +fft0.1561 -0.00139232283 +fft0.1568 0.0754375085 +fft0.1575 -0.0317034237 +fft0.1582 0.0227123741 +fft0.1589 -0.0127039431 +fft0.1596 -0.0549600907 +fft0.1603 -0.0962201506 +fft0.1610 0.04490906 +fft0.1617 0.0793380737 +fft0.1624 -0.0228523258 +fft0.1631 -0.0307443328 +fft0.1638 -0.0914448723 +fft0.1645 0.0240406394 +fft0.1652 -0.0138839185 +fft0.1659 -0.0173791293 +fft0.1666 -0.0108422404 +fft0.1673 -0.0985752121 +fft0.1680 0.0437486283 +fft0.1687 -0.0171247255 +fft0.1694 0.0104512693 +fft0.1701 -0.0886109471 +fft0.1708 0.0284618493 +fft0.1715 -0.0349536724 +fft0.1722 -0.0663329288 +fft0.1729 0.00833690166 +fft0.1736 0.0213946234 +fft0.1743 0.0399267189 +fft0.1750 -0.0363901965 +fft0.1757 0.032913994 +fft0.1764 0.0787453279 +fft0.1771 -0.0154129146 +fft0.1778 0.023193432 +fft0.1785 -0.08970429 +fft0.1792 0.0815523192 +fft0.1799 0.0485409983 +fft0.1806 0.02054739 +fft0.1813 -0.0407261327 +fft0.1820 0.0703507811 +fft0.1827 -0.0290975105 +fft0.1834 -0.023220038 +fft0.1841 -0.0432756022 +fft0.1848 0.0583205335 +fft0.1855 -0.0679702535 +fft0.1862 -0.00283081527 +fft0.1869 -0.0432596095 +fft0.1876 -0.0154103879 +fft0.1883 -0.0379422121 +fft0.1890 -0.0990191922 +fft0.1897 0.069504559 +fft0.1904 -0.0922467038 +fft0.1911 0.0308148395 +fft0.1918 -0.00510068564 +fft0.1925 0.00940793753 +fft0.1932 0.0171358716 +fft0.1939 0.00925261993 +fft0.1946 0.0152315376 +fft0.1953 -0.0625330359 +fft0.1960 -0.0774975047 +fft0.1967 -0.00609818101 +fft0.1974 0.0820617229 +fft0.1981 -0.00765821943 +fft0.1988 0.0944504961 +fft0.1995 0.0260694157 +fft0.2002 0.00404964713 +fft0.2009 -0.0107290093 +fft0.2016 -0.051763244 +fft0.2023 0.0712560564 +fft0.2030 -0.020210309 +fft0.2037 0.073859714 +fft0.2044 -0.0134250997 +fft0.2051 0.0129235629 +fft0.2058 -0.0982004032 +fft0.2065 -0.00381427421 +fft0.2072 0.0918421894 +fft0.2079 0.0954684988 +fft0.2086 0.0317755938 +fft0.2093 0.0890247598 +fft0.2100 0.0910952687 +fft0.2107 0.0623847358 +fft0.2114 0.0496400967 +fft0.2121 -0.0998727456 +fft0.2128 0.0333726183 +fft0.2135 -0.0788232014 +fft0.2142 0.00614769477 +fft0.2149 -0.0773210153 +fft0.2156 0.00384027953 +fft0.2163 0.0896277353 +fft0.2170 -0.0466689765 +fft0.2177 0.0919117704 +fft0.2184 0.0728909895 +fft0.2191 -0.0726988539 +fft0.2198 -0.0734210312 +fft0.2205 -0.0620743893 +fft0.2212 -0.0427682884 +fft0.2219 -0.0540988036 +fft0.2226 0.00481491117 +fft0.2233 -0.0329299867 +fft0.2240 -0.0852813348 +fft0.2247 0.0648116022 +fft0.2254 0.0377317928 +fft0.2261 -0.0539929047 +fft0.2268 -0.0578438118 +fft0.2275 0.0396086946 +fft0.2282 0.0288043264 +fft0.2289 0.00834612828 +fft0.2296 0.00179822452 +fft0.2303 0.0657825246 +fft0.2310 0.0428879969 +fft0.2317 -0.0627100393 +fft0.2324 -0.0503336787 +fft0.2331 -0.0217983909 +fft0.2338 0.0861308575 +fft0.2345 -0.0276063681 +fft0.2352 -0.0594824962 +fft0.2359 0.0254624244 +fft0.2366 -0.0946625322 +fft0.2373 -0.0850216374 +fft0.2380 -0.0247672442 +fft0.2387 0.0403391011 +fft0.2394 -0.0739926472 +fft0.2401 0.0596446283 +fft0.2408 -0.0788054988 +fft0.2415 -0.0367974415 +fft0.2422 0.054313194 +fft0.2429 -0.0528410077 +fft0.2436 -0.0158369839 +fft0.2443 0.0554147735 +fft0.2450 -0.0656953976 +fft0.2457 -0.05369379 +fft0.2464 -0.0121563375 +fft0.2471 0.0783371702 +fft0.2478 -0.0911292359 +fft0.2485 0.0450279117 +fft0.2492 -0.00658700475 +fft0.2499 -0.0145737175 +fft0.2506 -0.043677628 +fft0.2513 -0.0744525194 +fft0.2520 0.0878263265 +fft0.2527 0.0741265416 +fft0.2534 -0.0386739485 +fft0.2541 -0.0295757409 +fft0.2548 -0.0735468045 +fft0.2555 -0.0613086484 +fft0.2562 -0.0999607965 +fft0.2569 -0.00864383578 +fft0.2576 0.0224402547 +fft0.2583 -0.075604707 +fft0.2590 -0.0123861907 +fft0.2597 0.0897226855 +fft0.2604 0.0974266157 +fft0.2611 -0.0301194079 +fft0.2618 0.00597782154 +fft0.2625 -0.0269873925 +fft0.2632 -0.0490044132 +fft0.2639 -0.0652072951 +fft0.2646 0.00427018432 +fft0.2653 0.0764827952 +fft0.2660 0.0243289005 +fft0.2667 0.0388018601 +fft0.2674 -0.0178337395 +fft0.2681 0.0547059774 +fft0.2688 -0.0748877153 +fft0.2695 0.0977174416 +fft0.2702 0.0603680126 +fft0.2709 0.0522160418 +fft0.2716 -0.0128641902 +fft0.2723 0.0993333012 +fft0.2730 -0.0138091268 +fft0.2737 0.0571925417 +fft0.2744 0.0211578254 +fft0.2751 0.0764200017 +fft0.2758 0.0756946951 +fft0.2765 -0.0170033872 +fft0.2772 -0.0757853985 +fft0.2779 0.092606537 +fft0.2786 -0.0503352992 +fft0.2793 -0.0514675565 +fft0.2800 -0.0251146257 +fft0.2807 0.0622801557 +fft0.2814 0.0457900763 +fft0.2821 0.0237789992 +fft0.2828 -0.0575744212 +fft0.2835 -0.0613193028 +fft0.2842 -0.08215639 +fft0.2849 -0.0229710173 +fft0.2856 0.0427998193 +fft0.2863 0.0369163863 +fft0.2870 0.00771182775 +fft0.2877 -0.0235702153 +fft0.2884 0.0431092642 +fft0.2891 -0.0751905143 +fft0.2898 0.0206357725 +fft0.2905 0.070343174 +fft0.2912 0.0284976494 +fft0.2919 -0.0675101727 +fft0.2926 -0.0407363139 +fft0.2933 -0.0514144413 +fft0.2940 -0.0322840512 +fft0.2947 -0.036587853 +fft0.2954 -0.0843002424 +fft0.2961 0.0862213522 +fft0.2968 -0.011416221 +fft0.2975 0.0863837227 +fft0.2982 -0.0643395856 +fft0.2989 -0.0612709485 +fft0.2996 -0.0252990257 +fft0.3003 0.00584968319 +fft0.3010 -0.0880160779 +fft0.3017 -0.0365642272 +fft0.3024 -0.0247559976 +fft0.3031 0.0560694598 +fft0.3038 0.0879878774 +fft0.3045 0.0401863717 +fft0.3052 -0.0268949997 +fft0.3059 -0.0807790682 +fft0.3066 0.0883926377 +fft0.3073 0.0142348651 +fft0.3080 0.0854472294 +fft0.3087 -0.000554001366 +fft0.3094 -0.055595614 +fft0.3101 0.00124086149 +fft0.3108 -0.0340678953 +fft0.3115 -0.0849737376 +fft0.3122 -0.0588447452 +fft0.3129 -0.0360447243 +fft0.3136 -0.085363321 +fft0.3143 0.0503836274 +fft0.3150 0.00876369514 +fft0.3157 0.0662870929 +fft0.3164 0.0507407449 +fft0.3171 -0.00286497478 +fft0.3178 -0.00168388488 +fft0.3185 -0.0636533201 +fft0.3192 -0.0870223269 +fft0.3199 -0.0320675485 +fft0.3206 -0.0879258141 +fft0.3213 0.0975046381 +fft0.3220 -0.0560179837 +fft0.3227 0.0680699348 +fft0.3234 -0.0527025573 +fft0.3241 -0.00871736463 +fft0.3248 0.0970138237 +fft0.3255 0.000392687332 +fft0.3262 0.0839140341 +fft0.3269 -0.00542932143 +fft0.3276 0.0074826479 +fft0.3283 -0.0961893424 +fft0.3290 0.0701122805 +fft0.3297 -0.0564070158 +fft0.3304 -0.0786676779 +fft0.3311 -0.0269936156 +fft0.3318 -0.015157992 +fft0.3325 0.0585407875 +fft0.3332 -0.0459077917 +fft0.3339 -0.00276555424 +fft0.3346 0.00518289814 +fft0.3353 0.0225702059 +fft0.3360 0.038279321 +fft0.3367 -0.0868440121 +fft0.3374 -0.0161559936 +fft0.3381 -0.0168113466 +fft0.3388 -0.0028439879 +fft0.3395 -0.0626663417 +fft0.3402 -0.0498607121 +fft0.3409 -0.0286385063 +fft0.3416 -0.0855636224 +fft0.3423 -0.0865586847 +fft0.3430 0.0309697986 +fft0.3437 -0.0599636547 +fft0.3444 0.076018095 +fft0.3451 0.06592419 +fft0.3458 -0.069058083 +fft0.3465 -0.0522590652 +fft0.3472 -0.0801160261 +fft0.3479 0.0355855003 +fft0.3486 0.0571740642 +fft0.3493 -0.0162822194 +fft0.3500 0.03480611 +fft0.3507 0.0723574683 +fft0.3514 0.0282528643 +fft0.3521 0.0494005196 +fft0.3528 -0.0102499006 +fft0.3535 0.0509221666 +fft0.3542 0.0115057947 +fft0.3549 0.0465864912 +fft0.3556 -0.00413554907 +fft0.3563 0.00587871065 +fft0.3570 0.00849649962 +fft0.3577 0.082354717 +fft0.3584 0.0139154671 +fft0.3591 -0.0499723032 +fft0.3598 0.0900680572 +fft0.3605 0.0074693202 +fft0.3612 -0.0260287356 +fft0.3619 0.0183922648 +fft0.3626 -0.0077533545 +fft0.3633 -0.0995594412 +fft0.3640 -0.0785905048 +fft0.3647 -0.0178199708 +fft0.3654 -0.0824798197 +fft0.3661 0.0445742868 +fft0.3668 -0.00539250998 +fft0.3675 -0.0337952375 +fft0.3682 0.0188416 +fft0.3689 0.015343857 +fft0.3696 0.0605993383 +fft0.3703 0.0729285255 +fft0.3710 0.0456232913 +fft0.3717 -0.0820645615 +fft0.3724 -0.0778391883 +fft0.3731 -0.0439183824 +fft0.3738 0.00724059343 +fft0.3745 -0.0970381647 +fft0.3752 0.0899222046 +fft0.3759 0.0443984047 +fft0.3766 0.0790044591 +fft0.3773 -0.0925155059 +fft0.3780 0.0681974441 +fft0.3787 0.051230371 +fft0.3794 0.0935977921 +fft0.3801 -0.0311387237 +fft0.3808 0.0889995024 +fft0.3815 0.0146900183 +fft0.3822 -0.0256765317 +fft0.3829 -0.00576137891 +fft0.3836 -0.0934659764 +fft0.3843 -0.0968870595 +fft0.3850 0.0172877442 +fft0.3857 0.0872161314 +fft0.3864 0.0582963601 +fft0.3871 0.0716056228 +fft0.3878 0.0200511348 +fft0.3885 0.0989028439 +fft0.3892 -0.0140003981 +fft0.3899 -0.0699282885 +fft0.3906 0.038719546 +fft0.3913 -0.0242881607 +fft0.3920 0.0825636983 +fft0.3927 -0.0492571183 +fft0.3934 0.00278930669 +fft0.3941 -0.0583148599 +fft0.3948 0.0261548515 +fft0.3955 -0.0257159118 +fft0.3962 -0.00576529512 +fft0.3969 -0.0208444484 +fft0.3976 0.0099823717 +fft0.3983 0.0776210055 +fft0.3990 0.0798105374 +fft0.3997 0.0547857992 +fft0.4004 -0.0809947699 +fft0.4011 0.0678694174 +fft0.4018 0.0236401688 +fft0.4025 -0.0285877474 +fft0.4032 0.0871877223 +fft0.4039 0.0642022118 +fft0.4046 0.00297262683 +fft0.4053 -0.0210871454 +fft0.4060 -0.0261483137 +fft0.4067 0.0511567108 +fft0.4074 0.0700118765 +fft0.4081 0.034361124 +fft0.4088 -0.0329067782 +fft0.4095 0.0932406932 +fft1.0 0 +fft1.7 0 +fft1.14 0 +fft1.21 0 +fft1.28 0 +fft1.35 0 +fft1.42 0 +fft1.49 0 +fft1.56 0 +fft1.63 0 +fft1.70 0 +fft1.77 0 +fft1.84 0 +fft1.91 0 +fft1.98 0 +fft1.105 0 +fft1.112 0 +fft1.119 0 +fft1.126 0 +fft1.133 0 +fft1.140 0 +fft1.147 0 +fft1.154 0 +fft1.161 0 +fft1.168 0 +fft1.175 0 +fft1.182 0 +fft1.189 0 +fft1.196 0 +fft1.203 0 +fft1.210 0 +fft1.217 0 +fft1.224 0 +fft1.231 0 +fft1.238 0 +fft1.245 0 +fft1.252 0 +fft1.259 0 +fft1.266 0 +fft1.273 0 +fft1.280 0 +fft1.287 0 +fft1.294 0 +fft1.301 0 +fft1.308 0 +fft1.315 0 +fft1.322 0 +fft1.329 0 +fft1.336 0 +fft1.343 0 +fft1.350 0 +fft1.357 0 +fft1.364 0 +fft1.371 0 +fft1.378 0 +fft1.385 0 +fft1.392 0 +fft1.399 0 +fft1.406 0 +fft1.413 0 +fft1.420 0 +fft1.427 0 +fft1.434 0 +fft1.441 0 +fft1.448 0 +fft1.455 0 +fft1.462 0 +fft1.469 0 +fft1.476 0 +fft1.483 0 +fft1.490 0 +fft1.497 0 +fft1.504 0 +fft1.511 0 +fft1.518 0 +fft1.525 0 +fft1.532 0 +fft1.539 0 +fft1.546 0 +fft1.553 0 +fft1.560 0 +fft1.567 0 +fft1.574 0 +fft1.581 0 +fft1.588 0 +fft1.595 0 +fft1.602 0 +fft1.609 0 +fft1.616 0 +fft1.623 0 +fft1.630 0 +fft1.637 0 +fft1.644 0 +fft1.651 0 +fft1.658 0 +fft1.665 0 +fft1.672 0 +fft1.679 0 +fft1.686 0 +fft1.693 0 +fft1.700 0 +fft1.707 0 +fft1.714 0 +fft1.721 0 +fft1.728 0 +fft1.735 0 +fft1.742 0 +fft1.749 0 +fft1.756 0 +fft1.763 0 +fft1.770 0 +fft1.777 0 +fft1.784 0 +fft1.791 0 +fft1.798 0 +fft1.805 0 +fft1.812 0 +fft1.819 0 +fft1.826 0 +fft1.833 0 +fft1.840 0 +fft1.847 0 +fft1.854 0 +fft1.861 0 +fft1.868 0 +fft1.875 0 +fft1.882 0 +fft1.889 0 +fft1.896 0 +fft1.903 0 +fft1.910 0 +fft1.917 0 +fft1.924 0 +fft1.931 0 +fft1.938 0 +fft1.945 0 +fft1.952 0 +fft1.959 0 +fft1.966 0 +fft1.973 0 +fft1.980 0 +fft1.987 0 +fft1.994 0 +fft1.1001 0 +fft1.1008 0 +fft1.1015 0 +fft1.1022 0 +fft1.1029 0 +fft1.1036 0 +fft1.1043 0 +fft1.1050 0 +fft1.1057 0 +fft1.1064 0 +fft1.1071 0 +fft1.1078 0 +fft1.1085 0 +fft1.1092 0 +fft1.1099 0 +fft1.1106 0 +fft1.1113 0 +fft1.1120 0 +fft1.1127 0 +fft1.1134 0 +fft1.1141 0 +fft1.1148 0 +fft1.1155 0 +fft1.1162 0 +fft1.1169 0 +fft1.1176 0 +fft1.1183 0 +fft1.1190 0 +fft1.1197 0 +fft1.1204 0 +fft1.1211 0 +fft1.1218 0 +fft1.1225 0 +fft1.1232 0 +fft1.1239 0 +fft1.1246 0 +fft1.1253 0 +fft1.1260 0 +fft1.1267 0 +fft1.1274 0 +fft1.1281 0 +fft1.1288 0 +fft1.1295 0 +fft1.1302 0 +fft1.1309 0 +fft1.1316 0 +fft1.1323 0 +fft1.1330 0 +fft1.1337 0 +fft1.1344 0 +fft1.1351 0 +fft1.1358 0 +fft1.1365 0 +fft1.1372 0 +fft1.1379 0 +fft1.1386 0 +fft1.1393 0 +fft1.1400 0 +fft1.1407 0 +fft1.1414 0 +fft1.1421 0 +fft1.1428 0 +fft1.1435 0 +fft1.1442 0 +fft1.1449 0 +fft1.1456 0 +fft1.1463 0 +fft1.1470 0 +fft1.1477 0 +fft1.1484 0 +fft1.1491 0 +fft1.1498 0 +fft1.1505 0 +fft1.1512 0 +fft1.1519 0 +fft1.1526 0 +fft1.1533 0 +fft1.1540 0 +fft1.1547 0 +fft1.1554 0 +fft1.1561 0 +fft1.1568 0 +fft1.1575 0 +fft1.1582 0 +fft1.1589 0 +fft1.1596 0 +fft1.1603 0 +fft1.1610 0 +fft1.1617 0 +fft1.1624 0 +fft1.1631 0 +fft1.1638 0 +fft1.1645 0 +fft1.1652 0 +fft1.1659 0 +fft1.1666 0 +fft1.1673 0 +fft1.1680 0 +fft1.1687 0 +fft1.1694 0 +fft1.1701 0 +fft1.1708 0 +fft1.1715 0 +fft1.1722 0 +fft1.1729 0 +fft1.1736 0 +fft1.1743 0 +fft1.1750 0 +fft1.1757 0 +fft1.1764 0 +fft1.1771 0 +fft1.1778 0 +fft1.1785 0 +fft1.1792 0 +fft1.1799 0 +fft1.1806 0 +fft1.1813 0 +fft1.1820 0 +fft1.1827 0 +fft1.1834 0 +fft1.1841 0 +fft1.1848 0 +fft1.1855 0 +fft1.1862 0 +fft1.1869 0 +fft1.1876 0 +fft1.1883 0 +fft1.1890 0 +fft1.1897 0 +fft1.1904 0 +fft1.1911 0 +fft1.1918 0 +fft1.1925 0 +fft1.1932 0 +fft1.1939 0 +fft1.1946 0 +fft1.1953 0 +fft1.1960 0 +fft1.1967 0 +fft1.1974 0 +fft1.1981 0 +fft1.1988 0 +fft1.1995 0 +fft1.2002 0 +fft1.2009 0 +fft1.2016 0 +fft1.2023 0 +fft1.2030 0 +fft1.2037 0 +fft1.2044 0 +fft1.2051 0 +fft1.2058 0 +fft1.2065 0 +fft1.2072 0 +fft1.2079 0 +fft1.2086 0 +fft1.2093 0 +fft1.2100 0 +fft1.2107 0 +fft1.2114 0 +fft1.2121 0 +fft1.2128 0 +fft1.2135 0 +fft1.2142 0 +fft1.2149 0 +fft1.2156 0 +fft1.2163 0 +fft1.2170 0 +fft1.2177 0 +fft1.2184 0 +fft1.2191 0 +fft1.2198 0 +fft1.2205 0 +fft1.2212 0 +fft1.2219 0 +fft1.2226 0 +fft1.2233 0 +fft1.2240 0 +fft1.2247 0 +fft1.2254 0 +fft1.2261 0 +fft1.2268 0 +fft1.2275 0 +fft1.2282 0 +fft1.2289 0 +fft1.2296 0 +fft1.2303 0 +fft1.2310 0 +fft1.2317 0 +fft1.2324 0 +fft1.2331 0 +fft1.2338 0 +fft1.2345 0 +fft1.2352 0 +fft1.2359 0 +fft1.2366 0 +fft1.2373 0 +fft1.2380 0 +fft1.2387 0 +fft1.2394 0 +fft1.2401 0 +fft1.2408 0 +fft1.2415 0 +fft1.2422 0 +fft1.2429 0 +fft1.2436 0 +fft1.2443 0 +fft1.2450 0 +fft1.2457 0 +fft1.2464 0 +fft1.2471 0 +fft1.2478 0 +fft1.2485 0 +fft1.2492 0 +fft1.2499 0 +fft1.2506 0 +fft1.2513 0 +fft1.2520 0 +fft1.2527 0 +fft1.2534 0 +fft1.2541 0 +fft1.2548 0 +fft1.2555 0 +fft1.2562 0 +fft1.2569 0 +fft1.2576 0 +fft1.2583 0 +fft1.2590 0 +fft1.2597 0 +fft1.2604 0 +fft1.2611 0 +fft1.2618 0 +fft1.2625 0 +fft1.2632 0 +fft1.2639 0 +fft1.2646 0 +fft1.2653 0 +fft1.2660 0 +fft1.2667 0 +fft1.2674 0 +fft1.2681 0 +fft1.2688 0 +fft1.2695 0 +fft1.2702 0 +fft1.2709 0 +fft1.2716 0 +fft1.2723 0 +fft1.2730 0 +fft1.2737 0 +fft1.2744 0 +fft1.2751 0 +fft1.2758 0 +fft1.2765 0 +fft1.2772 0 +fft1.2779 0 +fft1.2786 0 +fft1.2793 0 +fft1.2800 0 +fft1.2807 0 +fft1.2814 0 +fft1.2821 0 +fft1.2828 0 +fft1.2835 0 +fft1.2842 0 +fft1.2849 0 +fft1.2856 0 +fft1.2863 0 +fft1.2870 0 +fft1.2877 0 +fft1.2884 0 +fft1.2891 0 +fft1.2898 0 +fft1.2905 0 +fft1.2912 0 +fft1.2919 0 +fft1.2926 0 +fft1.2933 0 +fft1.2940 0 +fft1.2947 0 +fft1.2954 0 +fft1.2961 0 +fft1.2968 0 +fft1.2975 0 +fft1.2982 0 +fft1.2989 0 +fft1.2996 0 +fft1.3003 0 +fft1.3010 0 +fft1.3017 0 +fft1.3024 0 +fft1.3031 0 +fft1.3038 0 +fft1.3045 0 +fft1.3052 0 +fft1.3059 0 +fft1.3066 0 +fft1.3073 0 +fft1.3080 0 +fft1.3087 0 +fft1.3094 0 +fft1.3101 0 +fft1.3108 0 +fft1.3115 0 +fft1.3122 0 +fft1.3129 0 +fft1.3136 0 +fft1.3143 0 +fft1.3150 0 +fft1.3157 0 +fft1.3164 0 +fft1.3171 0 +fft1.3178 0 +fft1.3185 0 +fft1.3192 0 +fft1.3199 0 +fft1.3206 0 +fft1.3213 0 +fft1.3220 0 +fft1.3227 0 +fft1.3234 0 +fft1.3241 0 +fft1.3248 0 +fft1.3255 0 +fft1.3262 0 +fft1.3269 0 +fft1.3276 0 +fft1.3283 0 +fft1.3290 0 +fft1.3297 0 +fft1.3304 0 +fft1.3311 0 +fft1.3318 0 +fft1.3325 0 +fft1.3332 0 +fft1.3339 0 +fft1.3346 0 +fft1.3353 0 +fft1.3360 0 +fft1.3367 0 +fft1.3374 0 +fft1.3381 0 +fft1.3388 0 +fft1.3395 0 +fft1.3402 0 +fft1.3409 0 +fft1.3416 0 +fft1.3423 0 +fft1.3430 0 +fft1.3437 0 +fft1.3444 0 +fft1.3451 0 +fft1.3458 0 +fft1.3465 0 +fft1.3472 0 +fft1.3479 0 +fft1.3486 0 +fft1.3493 0 +fft1.3500 0 +fft1.3507 0 +fft1.3514 0 +fft1.3521 0 +fft1.3528 0 +fft1.3535 0 +fft1.3542 0 +fft1.3549 0 +fft1.3556 0 +fft1.3563 0 +fft1.3570 0 +fft1.3577 0 +fft1.3584 0 +fft1.3591 0 +fft1.3598 0 +fft1.3605 0 +fft1.3612 0 +fft1.3619 0 +fft1.3626 0 +fft1.3633 0 +fft1.3640 0 +fft1.3647 0 +fft1.3654 0 +fft1.3661 0 +fft1.3668 0 +fft1.3675 0 +fft1.3682 0 +fft1.3689 0 +fft1.3696 0 +fft1.3703 0 +fft1.3710 0 +fft1.3717 0 +fft1.3724 0 +fft1.3731 0 +fft1.3738 0 +fft1.3745 0 +fft1.3752 0 +fft1.3759 0 +fft1.3766 0 +fft1.3773 0 +fft1.3780 0 +fft1.3787 0 +fft1.3794 0 +fft1.3801 0 +fft1.3808 0 +fft1.3815 0 +fft1.3822 0 +fft1.3829 0 +fft1.3836 0 +fft1.3843 0 +fft1.3850 0 +fft1.3857 0 +fft1.3864 0 +fft1.3871 0 +fft1.3878 0 +fft1.3885 0 +fft1.3892 0 +fft1.3899 0 +fft1.3906 0 +fft1.3913 0 +fft1.3920 0 +fft1.3927 0 +fft1.3934 0 +fft1.3941 0 +fft1.3948 0 +fft1.3955 0 +fft1.3962 0 +fft1.3969 0 +fft1.3976 0 +fft1.3983 0 +fft1.3990 0 +fft1.3997 0 +fft1.4004 0 +fft1.4011 0 +fft1.4018 0 +fft1.4025 0 +fft1.4032 0 +fft1.4039 0 +fft1.4046 0 +fft1.4053 0 +fft1.4060 0 +fft1.4067 0 +fft1.4074 0 +fft1.4081 0 +fft1.4088 0 +fft1.4095 0 +sessionPeakDBC 112.572418 +noiseDose 0.00259832549 diff --git a/run-tests.sh b/run-tests.sh new file mode 100755 index 0000000..a4d0c23 --- /dev/null +++ b/run-tests.sh @@ -0,0 +1,29 @@ +#!/bin/bash +# Build and run the unit + processor regression tests outside iCloud Drive. +# +# ./run-tests.sh tolerance mode (same as CI) +# ./run-tests.sh --exact bit-identical check against Tests/golden (use for refactors) +# ./run-tests.sh --update rewrite the processor golden files (only for intended changes!) +set -euo pipefail + +cd "$(dirname "$0")" +export DEVELOPER_DIR=/Applications/Xcode.app/Contents/Developer +export CMAKE_POLICY_VERSION_MINIMUM=3.5 + +BUILD_DIR="${SPLMETER_TEST_BUILD_DIR:-${TMPDIR:-/tmp}/splmeter-tests}" +CMAKE=$(command -v cmake || echo /opt/homebrew/bin/cmake) + +JUCE_SRC_ARG=() +[ -d build-local/_deps/juce-src ] && JUCE_SRC_ARG=(-DFETCHCONTENT_SOURCE_DIR_JUCE="$PWD/build-local/_deps/juce-src") + +"$CMAKE" -S . -B "$BUILD_DIR" -DCMAKE_BUILD_TYPE=Release -DSPLMETER_TFLITE=OFF \ + -DSPLMETER_BUILD_TESTS=ON "${JUCE_SRC_ARG[@]}" > /dev/null +"$CMAKE" --build "$BUILD_DIR" --target SPLMeterTests SPLMeterProcessorTests -j "$(sysctl -n hw.ncpu 2>/dev/null || nproc)" + +case "${1:-}" in + --exact) export SPLMETER_GOLDEN_EXACT=1 ;; + --update) export SPLMETER_UPDATE_GOLDEN=1 ;; +esac + +"$BUILD_DIR/SPLMeterTests" +"$BUILD_DIR/SPLMeterProcessorTests" From a86f8c28932e7a35a8592475d7d2e85a61d54d55 Mon Sep 17 00:00:00 2001 From: Philipp Paul Klose Date: Thu, 12 Nov 2026 16:58:02 +0100 Subject: [PATCH 03/30] tests: report regression mismatches with values Co-Authored-By: Claude Opus 5.5 --- Tests/ProcessorRegressionTests.cpp | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/Tests/ProcessorRegressionTests.cpp b/Tests/ProcessorRegressionTests.cpp index 0b8bf9b..042ccce 100644 --- a/Tests/ProcessorRegressionTests.cpp +++ b/Tests/ProcessorRegressionTests.cpp @@ -247,16 +247,21 @@ TEST_CASE ("Processor regression: outputs match golden files", "[regression]") REQUIRE (expected.size() == values.size()); int mismatches = 0; + float maxDiff = 0.0f; + std::string report; for (size_t i = 0; i < values.size(); ++i) { const auto& [key, actual] = values[i]; REQUIRE (key == expected[i].first); const bool ok = exact ? (formatValue (actual) == formatValue (expected[i].second)) : closeEnough (key, expected[i].second, actual); - if (! ok && ++mismatches <= 20) - UNSCOPED_INFO (key << ": expected " << formatValue (expected[i].second) - << ", got " << formatValue (actual)); + if (ok) continue; + maxDiff = std::max (maxDiff, std::fabs (actual - expected[i].second)); + if (++mismatches <= 20) + report += key + ": expected " + formatValue (expected[i].second) + + ", got " + formatValue (actual) + "\n"; } + INFO (mismatches << " mismatches, max abs diff " << maxDiff << "\n" << report); CHECK (mismatches == 0); } } From b4776c718c410e698a732dca6c87296d30e148ac Mon Sep 17 00:00:00 2001 From: Philipp Paul Klose Date: Thu, 12 Nov 2026 17:04:45 +0100 Subject: [PATCH 04/30] tests: per-scenario cross-platform tolerance for the bandpass scenario The 8th-order float bandpass leaves platform-dependent rounding residues for a 5 Hz tone deep in its stopband (Linux x86 vs macOS arm64: max diff 0.067, peak SPL 0.015 dB). Exact mode stays bit-identical locally. Co-Authored-By: Claude Opus 5.5 --- Tests/ProcessorRegressionTests.cpp | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/Tests/ProcessorRegressionTests.cpp b/Tests/ProcessorRegressionTests.cpp index 042ccce..5d216f2 100644 --- a/Tests/ProcessorRegressionTests.cpp +++ b/Tests/ProcessorRegressionTests.cpp @@ -38,6 +38,8 @@ struct Scenario double seconds; SignalFn signal; std::function configure; + // Cross-platform absolute tolerance (tolerance mode only; exact mode is always bit-identical) + float crossPlatformTol = 1.0e-3f; }; float sine (double freq, double amp, int n) @@ -87,7 +89,12 @@ std::vector scenarios() { "stereo_bandpass_lowfreq", 2, 3.0, [] (int ch, int n) { return ch == 0 ? sine (5.0, 0.5, n) + sine (40.0, 0.1, n) : sine (12500.0, 0.05, n); }, - [] (SPLMeterAudioProcessor& p) { setParam (p, "bandpassEnabled", 1.0f); } }, + [] (SPLMeterAudioProcessor& p) { setParam (p, "bandpassEnabled", 1.0f); }, + // The 8th-order float bandpass drives the 5 Hz tone deep into its stopband; + // rounding residues there differ between arm64/macOS and x86/Linux libm+FMA + // (measured max diff 0.067, peak SPL 0.015 dB) and the psychoacoustic + // estimators amplify them slightly. + 0.1f }, { "stereo_slow_muted", 2, 3.0, [] (int ch, int n) { return ch == 0 ? noise (ch, n, 0.1f) : sine (2000.0, 0.5, n); }, @@ -194,14 +201,14 @@ bool envSet (const char* name) // Tolerance for cross-platform runs: libm and FMA contraction differ between // compilers/architectures. Tight enough that any real behaviour change fails. -bool closeEnough (const std::string& key, float expected, float actual) +bool closeEnough (const std::string& key, float expected, float actual, float absTol) { if (expected == actual) return true; if (std::isnan (expected) || std::isnan (actual)) return std::isnan (expected) && std::isnan (actual); const float diff = std::fabs (expected - actual); if (key.rfind ("fft", 0) == 0) - return diff <= 1.0e-6f + 1.0e-5f * std::fabs (expected); - return diff <= 1.0e-3f + 1.0e-4f * std::fabs (expected); + return diff <= absTol * 1.0e-3f + 1.0e-5f * std::fabs (expected); + return diff <= absTol + 1.0e-4f * std::fabs (expected); } } // namespace @@ -254,7 +261,7 @@ TEST_CASE ("Processor regression: outputs match golden files", "[regression]") const auto& [key, actual] = values[i]; REQUIRE (key == expected[i].first); const bool ok = exact ? (formatValue (actual) == formatValue (expected[i].second)) - : closeEnough (key, expected[i].second, actual); + : closeEnough (key, expected[i].second, actual, sc.crossPlatformTol); if (ok) continue; maxDiff = std::max (maxDiff, std::fabs (actual - expected[i].second)); if (++mismatches <= 20) From d107596cc75c72ce611a627817e667deb494fb5d Mon Sep 17 00:00:00 2001 From: Philipp Paul Klose Date: Thu, 12 Nov 2026 17:12:08 +0100 Subject: [PATCH 05/30] tests: separate FFT cross-platform tolerance for the bandpass scenario Co-Authored-By: Claude Opus 5.5 --- Tests/ProcessorRegressionTests.cpp | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/Tests/ProcessorRegressionTests.cpp b/Tests/ProcessorRegressionTests.cpp index 5d216f2..fb05b70 100644 --- a/Tests/ProcessorRegressionTests.cpp +++ b/Tests/ProcessorRegressionTests.cpp @@ -39,7 +39,8 @@ struct Scenario SignalFn signal; std::function configure; // Cross-platform absolute tolerance (tolerance mode only; exact mode is always bit-identical) - float crossPlatformTol = 1.0e-3f; + float crossPlatformTol = 1.0e-3f; // meter/log values (dB, metric units) + float crossPlatformFftTol = 1.0e-6f; // FFT ring-buffer samples (linear FS) }; float sine (double freq, double amp, int n) @@ -92,9 +93,9 @@ std::vector scenarios() [] (SPLMeterAudioProcessor& p) { setParam (p, "bandpassEnabled", 1.0f); }, // The 8th-order float bandpass drives the 5 Hz tone deep into its stopband; // rounding residues there differ between arm64/macOS and x86/Linux libm+FMA - // (measured max diff 0.067, peak SPL 0.015 dB) and the psychoacoustic - // estimators amplify them slightly. - 0.1f }, + // (measured max diff 0.067, peak SPL 0.015 dB; FFT samples 2.6e-4 ≈ -72 dBFS) + // and the psychoacoustic estimators amplify them slightly. + 0.1f, 1.0e-3f }, { "stereo_slow_muted", 2, 3.0, [] (int ch, int n) { return ch == 0 ? noise (ch, n, 0.1f) : sine (2000.0, 0.5, n); }, @@ -201,13 +202,13 @@ bool envSet (const char* name) // Tolerance for cross-platform runs: libm and FMA contraction differ between // compilers/architectures. Tight enough that any real behaviour change fails. -bool closeEnough (const std::string& key, float expected, float actual, float absTol) +bool closeEnough (const std::string& key, float expected, float actual, float absTol, float fftAbsTol) { if (expected == actual) return true; if (std::isnan (expected) || std::isnan (actual)) return std::isnan (expected) && std::isnan (actual); const float diff = std::fabs (expected - actual); if (key.rfind ("fft", 0) == 0) - return diff <= absTol * 1.0e-3f + 1.0e-5f * std::fabs (expected); + return diff <= fftAbsTol + 1.0e-5f * std::fabs (expected); return diff <= absTol + 1.0e-4f * std::fabs (expected); } } // namespace @@ -261,7 +262,8 @@ TEST_CASE ("Processor regression: outputs match golden files", "[regression]") const auto& [key, actual] = values[i]; REQUIRE (key == expected[i].first); const bool ok = exact ? (formatValue (actual) == formatValue (expected[i].second)) - : closeEnough (key, expected[i].second, actual, sc.crossPlatformTol); + : closeEnough (key, expected[i].second, actual, + sc.crossPlatformTol, sc.crossPlatformFftTol); if (ok) continue; maxDiff = std::max (maxDiff, std::fabs (actual - expected[i].second)); if (++mismatches <= 20) From 24a8131e2b69fd9b5a94b7ef0ceb4269f50c26e0 Mon Sep 17 00:00:00 2001 From: Philipp Paul Klose Date: Thu, 12 Nov 2026 17:14:21 +0100 Subject: [PATCH 06/30] docs: vibration spec targets v3.6.0 Co-Authored-By: Claude Opus 5.5 --- docs/VIBRATION_SPEC.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/VIBRATION_SPEC.md b/docs/VIBRATION_SPEC.md index 1336923..0aa2045 100644 --- a/docs/VIBRATION_SPEC.md +++ b/docs/VIBRATION_SPEC.md @@ -1,6 +1,6 @@ # SPLMeter — Vibration Measurement (Accelerometer) Specification -Status: **Draft v0.2** · 2026-11-12 · target: next minor version after v3.5.2 +Status: **Draft v0.2** · 2026-11-12 · target: **v3.6.0** (v0.2: open points resolved, weighting parameters and limit values cross-checked against public sources — see §14) ## 1. Goals @@ -322,7 +322,7 @@ Manual verification: handheld calibrator per axis; compare a short machinery and 10. Accumulating detectors: a_w,rms, MTVV, VDV, crest factor, PPV + f_dom, KB_F/KB_Fmax/KB_FTr; session reset integration. 11. Assessment engine with editable limits (§9.3) and the panel's status dot. 12. HTML report (§9) with inline SVG charts. -13. README + user documentation; version bump. +13. README + user documentation; version bump to **v3.6.0** (CMakeLists.txt, SPLMeter.jucer, JucePluginDefines.h, PluginEditor version label). ### Later From 69b15b8f23f01ee67bdbb0ccfa30461771c0244f Mon Sep 17 00:00:00 2001 From: Philipp Paul Klose Date: Thu, 12 Nov 2026 17:20:21 +0100 Subject: [PATCH 07/30] Vibration step 1: per-input sensor roles (channel model) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - SensorConfig.h: SensorRole {Mic, AccelX/Y/Z, AccelUniaxial, Off} and validation (one accelerometer sensor: up to one channel per axis, or exactly one uniaxial) - Processor: roles persisted in UIState/Inputs (non-Mic entries only), mirrored into atomics for the audio thread; only Mic inputs feed the SPL mix, active-channel count and 20 Hz bandpass; non-Mic inputs are restored after the correction convolution. File mode unchanged (§7.5). - Default (all Mic) is bit-identical to v3.5.2 (regression --exact) - Tests: validation, accel/Off excluded from mix (bit-identical to mic-only run), no-mic silence, bandpass/correction bypass for accel, role persistence, v3.5.2 state loads as all-Mic Co-Authored-By: Claude Opus 5.5 --- CMakeLists.txt | 1 + Source/PluginProcessor.cpp | 75 +++++++- Source/PluginProcessor.h | 25 +++ Source/SensorConfig.h | 94 ++++++++++ Tests/ProcessorRegressionTests.cpp | 118 +------------ Tests/ProcessorTestHelpers.h | 131 ++++++++++++++ Tests/SensorRoleTests.cpp | 271 +++++++++++++++++++++++++++++ 7 files changed, 594 insertions(+), 121 deletions(-) create mode 100644 Source/SensorConfig.h create mode 100644 Tests/ProcessorTestHelpers.h create mode 100644 Tests/SensorRoleTests.cpp diff --git a/CMakeLists.txt b/CMakeLists.txt index 005d1b8..34362e4 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -339,6 +339,7 @@ if(SPLMETER_BUILD_TESTS) # JUCE modules (linking juce:: modules again would duplicate symbols). add_executable(SPLMeterProcessorTests Tests/ProcessorRegressionTests.cpp + Tests/SensorRoleTests.cpp ) target_link_libraries(SPLMeterProcessorTests PRIVATE SPLMeter diff --git a/Source/PluginProcessor.cpp b/Source/PluginProcessor.cpp index 6db3dc1..9b097f1 100644 --- a/Source/PluginProcessor.cpp +++ b/Source/PluginProcessor.cpp @@ -238,6 +238,9 @@ void SPLMeterAudioProcessor::prepareToPlay (double sampleRate, int samplesPerBlo transportSource.prepareToPlay (samplesPerBlock, sampleRate); fileReadBuffer.setSize (2, samplesPerBlock, false, true, false); + + nonMicScratch_.setSize (juce::jmax (1, juce::jmin (getTotalNumInputChannels(), SensorConfig::kMaxInputs)), + samplesPerBlock, false, true, false); } void SPLMeterAudioProcessor::releaseResources() @@ -324,6 +327,17 @@ void SPLMeterAudioProcessor::processBlock (juce::AudioBuffer& buffer, buffer.clear (ch, 0, numSamples); } + // --- Sensor roles: only Mic inputs feed the SPL mix, bandpass and correction --- + // (File mode keeps mixing all file channels; role-aware playback follows with + // multichannel recording, vibration spec §7.5.) + bool isMic[SensorConfig::kMaxInputs]; + bool allMic = true; + for (int ch = 0; ch < SensorConfig::kMaxInputs; ++ch) + { + isMic[ch] = channelRoles_[(size_t) ch].load (std::memory_order_relaxed) == (int) SensorRole::Mic; + allMic = allMic && (isMic[ch] || ch >= numChannels); + } + // --- File mode: pull audio from transport instead of live input --- const bool fileMode = fileModeActive.load(); if (fileMode) @@ -361,12 +375,14 @@ void SPLMeterAudioProcessor::processBlock (juce::AudioBuffer& buffer, // 20Hz-20kHz bandpass (48dB/oct) applied per channel before mono mix if (apvts.getRawParameterValue ("bandpassEnabled")->load() > 0.5f) { - auto applyBP = [this] (juce::AudioBuffer& buf) + auto applyBP = [this, &isMic] (juce::AudioBuffer& buf, bool respectRoles) { const int nCh = std::min (buf.getNumChannels(), 8); const int nSa = buf.getNumSamples(); for (int ch = 0; ch < nCh; ++ch) { + if (respectRoles && ! isMic[ch]) + continue; float* data = buf.getWritePointer (ch); for (int st = 0; st < kBpStages; ++st) { @@ -375,8 +391,8 @@ void SPLMeterAudioProcessor::processBlock (juce::AudioBuffer& buffer, } } }; - if (fileMode) applyBP (fileReadBuffer); - else applyBP (buffer); + if (fileMode) applyBP (fileReadBuffer, false); + else applyBP (buffer, true); } // Correction filter (applied after bandpass, before metering) @@ -401,8 +417,22 @@ void SPLMeterAudioProcessor::processBlock (juce::AudioBuffer& buffer, const auto chClamped = juce::jmin (block.getNumChannels(), (size_t) correctionPreparedCh_); auto sub = block.getSubsetChannelBlock (0, chClamped); + + // The convolution runs on all channels at once: keep non-Mic inputs untouched + const bool keepNonMic = ! fileMode && ! allMic + && numSamples <= nonMicScratch_.getNumSamples(); + if (keepNonMic) + for (int ch = 0; ch < juce::jmin ((int) chClamped, nonMicScratch_.getNumChannels()); ++ch) + if (! isMic[ch]) + nonMicScratch_.copyFrom (ch, 0, src, ch, 0, numSamples); + juce::dsp::ProcessContextReplacing ctx (sub); correctionConv_.process (ctx); + + if (keepNonMic) + for (int ch = 0; ch < juce::jmin ((int) chClamped, nonMicScratch_.getNumChannels()); ++ch) + if (! isMic[ch]) + src.copyFrom (ch, 0, nonMicScratch_, ch, 0, numSamples); } } @@ -413,7 +443,8 @@ void SPLMeterAudioProcessor::processBlock (juce::AudioBuffer& buffer, // Muted channels have already been zeroed above, so they contribute 0 here. int activeChannels = 0; for (int ch = 0; ch < numChannels; ++ch) - if (buffer.getMagnitude (ch, 0, numSamples) > 1e-9f) + if ((ch >= SensorConfig::kMaxInputs || isMic[ch]) + && buffer.getMagnitude (ch, 0, numSamples) > 1e-9f) ++activeChannels; if (activeChannels == 0) activeChannels = 1; // silence guard const float channelScale = 1.0f / static_cast (activeChannels); @@ -439,7 +470,8 @@ void SPLMeterAudioProcessor::processBlock (juce::AudioBuffer& buffer, else { for (int ch = 0; ch < numChannels; ++ch) - raw += buffer.getReadPointer (ch)[s]; + if (ch >= SensorConfig::kMaxInputs || isMic[ch]) + raw += buffer.getReadPointer (ch)[s]; raw *= channelScale; } @@ -717,6 +749,7 @@ void SPLMeterAudioProcessor::restoreStateXml (const juce::XmlElement& xml) for (int i = 0; i < 32; ++i) channelNames_[i] = xml.getStringAttribute ("channelName_" + juce::String (i), ""); apvts.replaceState (juce::ValueTree::fromXml (xml)); + loadChannelRolesFromState(); // Apply the non-parameter settings held in UIState auto ui = getUiState(); @@ -772,6 +805,38 @@ void SPLMeterAudioProcessor::setStateInformation (const void* data, int sizeInBy restoreStateXml (*xml); } +//============================================================================== +// Sensor roles — persisted in UIState/Inputs as "role" (non-Mic entries only) +void SPLMeterAudioProcessor::setChannelRole (int ch, SensorRole role) +{ + if (ch < 0 || ch >= SensorConfig::kMaxInputs) + return; + channelRoles_[(size_t) ch].store ((int) role, std::memory_order_relaxed); + + auto inputs = getUiState().getOrCreateChildWithName ("Inputs", nullptr); + const juce::Identifier key ("role" + juce::String (ch)); + if (role == SensorRole::Mic) inputs.removeProperty (key, nullptr); + else inputs.setProperty (key, (int) role, nullptr); +} + +SensorConfig::Roles SPLMeterAudioProcessor::getChannelRoles() const noexcept +{ + SensorConfig::Roles r; + for (int ch = 0; ch < SensorConfig::kMaxInputs; ++ch) + r[(size_t) ch] = getChannelRole (ch); + return r; +} + +void SPLMeterAudioProcessor::loadChannelRolesFromState() +{ + const auto inputs = getUiState().getChildWithName ("Inputs"); + for (int ch = 0; ch < SensorConfig::kMaxInputs; ++ch) + { + const int v = inputs.isValid() ? (int) inputs.getProperty ("role" + juce::String (ch), 0) : 0; + channelRoles_[(size_t) ch].store ((int) SensorConfig::fromInt (v), std::memory_order_relaxed); + } +} + //============================================================================== void SPLMeterAudioProcessor::loadFile (const juce::File& file) { diff --git a/Source/PluginProcessor.h b/Source/PluginProcessor.h index e621529..6f78c73 100644 --- a/Source/PluginProcessor.h +++ b/Source/PluginProcessor.h @@ -8,6 +8,8 @@ #include "ImpulsivenessEstimator.h" #include "TonalityEstimator.h" #include "SoundDetective.h" +#include "SensorConfig.h" +#include #include #include @@ -268,6 +270,21 @@ class SPLMeterAudioProcessor : public juce::AudioProcessor channelNames_[ch] = name; } + //========================================================================== + // Sensor roles per input (vibration spec §3.1). Default: all Mic. + // Persisted in UIState/Inputs; mirrored into atomics for the audio thread. + SensorRole getChannelRole (int ch) const noexcept + { + jassert (ch >= 0 && ch < SensorConfig::kMaxInputs); + return SensorConfig::fromInt (channelRoles_[(size_t) ch].load (std::memory_order_relaxed)); + } + void setChannelRole (int ch, SensorRole role); + SensorConfig::Roles getChannelRoles() const noexcept; + SensorConfig::Validity getSensorValidity() const noexcept + { + return SensorConfig::validate (getChannelRoles(), getTotalNumInputChannels()); + } + //========================================================================== juce::AudioProcessorValueTreeState apvts; @@ -278,6 +295,14 @@ class SPLMeterAudioProcessor : public juce::AudioProcessor AWeightingFilter aWeightL; CWeightingFilter cWeightL; + // Sensor roles (audio-thread mirror of UIState/Inputs) + std::array, SensorConfig::kMaxInputs> channelRoles_ {}; + void loadChannelRolesFromState(); + + // Accelerometer channels are restored from here after the correction + // convolution, which processes all channels at once (allocated in prepareToPlay) + juce::AudioBuffer nonMicScratch_; + // 20Hz-20kHz bandpass: 8th-order Butterworth = 4 cascaded biquad stages static constexpr int kBpStages = 4; juce::IIRFilter bpHP[32][kBpStages]; diff --git a/Source/SensorConfig.h b/Source/SensorConfig.h new file mode 100644 index 0000000..9c844f4 --- /dev/null +++ b/Source/SensorConfig.h @@ -0,0 +1,94 @@ +#pragma once +#include +#include + +//============================================================================== +// Per-input sensor roles (vibration spec §3.1). +// +// Every physical input has a role. The default (all Mic) is the pre-3.6 +// behaviour: every input is part of the microphone mix. Accelerometer and Off +// inputs are excluded from the mix, the 20 Hz bandpass and the correction filter. +// The numeric values are persisted in UIState/Inputs — never reorder them. +enum class SensorRole : int +{ + Mic = 0, + AccelX = 1, + AccelY = 2, + AccelZ = 3, + AccelUniaxial = 4, + Off = 5 +}; + +namespace SensorConfig +{ + static constexpr int kMaxInputs = 32; + + using Roles = std::array; + + inline Roles defaultRoles() noexcept + { + Roles r; + r.fill (SensorRole::Mic); + return r; + } + + inline bool isAccel (SensorRole r) noexcept + { + return r == SensorRole::AccelX || r == SensorRole::AccelY + || r == SensorRole::AccelZ || r == SensorRole::AccelUniaxial; + } + + inline SensorRole fromInt (int v) noexcept + { + return (v >= 0 && v <= static_cast (SensorRole::Off)) ? static_cast (v) + : SensorRole::Mic; + } + + enum class Validity + { + NoAccelerometer, // only Mic / Off — valid, accelerometer path inactive + Triaxial, // one channel each for X, Y and Z + Biaxial, // two of X/Y/Z (allowed: e.g. 2-channel interface) + SingleAxis, // exactly one of X/Y/Z + Uniaxial, // exactly one AccelUniaxial + DuplicateAxis, // invalid: an axis is assigned more than once + MixedKinds // invalid: AccelUniaxial combined with X/Y/Z, or >1 uniaxial + }; + + // One accelerometer sensor per session (spec §1): either up to one channel + // per axis X/Y/Z, or exactly one uniaxial channel. + inline Validity validate (const Roles& roles, int numInputs = kMaxInputs) noexcept + { + int x = 0, y = 0, z = 0, uni = 0; + const int n = numInputs < kMaxInputs ? numInputs : kMaxInputs; + for (int ch = 0; ch < n; ++ch) + { + switch (roles[static_cast (ch)]) + { + case SensorRole::AccelX: ++x; break; + case SensorRole::AccelY: ++y; break; + case SensorRole::AccelZ: ++z; break; + case SensorRole::AccelUniaxial: ++uni; break; + case SensorRole::Mic: + case SensorRole::Off: break; + } + } + + const int axes = (x > 0) + (y > 0) + (z > 0); + if (uni > 1 || (uni == 1 && axes > 0)) return Validity::MixedKinds; + if (x > 1 || y > 1 || z > 1) return Validity::DuplicateAxis; + if (uni == 1) return Validity::Uniaxial; + switch (axes) + { + case 3: return Validity::Triaxial; + case 2: return Validity::Biaxial; + case 1: return Validity::SingleAxis; + default: return Validity::NoAccelerometer; + } + } + + inline bool isValid (Validity v) noexcept + { + return v != Validity::DuplicateAxis && v != Validity::MixedKinds; + } +} diff --git a/Tests/ProcessorRegressionTests.cpp b/Tests/ProcessorRegressionTests.cpp index fb05b70..d6f0f3b 100644 --- a/Tests/ProcessorRegressionTests.cpp +++ b/Tests/ProcessorRegressionTests.cpp @@ -2,6 +2,7 @@ #include #include #include "PluginProcessor.h" +#include "ProcessorTestHelpers.h" #include #include @@ -25,43 +26,7 @@ namespace { -constexpr double kSampleRate = 48000.0; -constexpr int kBlockSize = 480; // deliberately not a power of two -constexpr int kFftWindow = 4096; - -using SignalFn = std::function; - -struct Scenario -{ - const char* name; - int numChannels; - double seconds; - SignalFn signal; - std::function configure; - // Cross-platform absolute tolerance (tolerance mode only; exact mode is always bit-identical) - float crossPlatformTol = 1.0e-3f; // meter/log values (dB, metric units) - float crossPlatformFftTol = 1.0e-6f; // FFT ring-buffer samples (linear FS) -}; - -float sine (double freq, double amp, int n) -{ - return static_cast (amp * std::sin (2.0 * juce::MathConstants::pi * freq * n / kSampleRate)); -} - -// Deterministic white noise, one independent LCG stream per channel -float noise (int channel, int n, float amp) -{ - uint32_t seed = 12345u + 7919u * static_cast (channel) + static_cast (n) * 2654435761u; - seed ^= seed >> 15; seed *= 2246822519u; seed ^= seed >> 13; seed *= 3266489917u; seed ^= seed >> 16; - return amp * (static_cast (seed) / static_cast (UINT32_MAX) * 2.0f - 1.0f); -} - -void setParam (SPLMeterAudioProcessor& p, const char* id, float value) -{ - auto* param = p.apvts.getParameter (id); - REQUIRE (param != nullptr); - param->setValueNotifyingHost (param->convertTo0to1 (value)); -} +using namespace ProcTest; std::vector scenarios() { @@ -108,85 +73,6 @@ std::vector scenarios() }; } -// Runs a scenario and returns the captured outputs as "key value" lines. -std::vector> runScenario (const Scenario& sc) -{ - // Heap-allocated like in a host: the processor holds ~6 MB of FFT ring buffers - auto procPtr = std::make_unique(); - auto& proc = *procPtr; - - auto layout = proc.getBusesLayout(); - layout.inputBuses.getReference (0) = juce::AudioChannelSet::discreteChannels (sc.numChannels); - REQUIRE (proc.setBusesLayout (layout)); - - sc.configure (proc); - proc.setRateAndBufferSizeDetails (kSampleRate, kBlockSize); - proc.prepareToPlay (kSampleRate, kBlockSize); - - const int numBusChannels = juce::jmax (proc.getTotalNumInputChannels(), proc.getTotalNumOutputChannels()); - juce::AudioBuffer buffer (numBusChannels, kBlockSize); - juce::MidiBuffer midi; - - std::vector> out; - auto add = [&out] (const std::string& key, float v) { out.emplace_back (key, v); }; - - const int totalBlocks = static_cast (sc.seconds * kSampleRate) / kBlockSize; - for (int b = 0; b < totalBlocks; ++b) - { - buffer.clear(); - for (int ch = 0; ch < sc.numChannels; ++ch) - { - auto* d = buffer.getWritePointer (ch); - for (int s = 0; s < kBlockSize; ++s) - d[s] = sc.signal (ch, b * kBlockSize + s); - } - proc.processBlock (buffer, midi); - - if (b % 10 == 9) - { - const std::string k = "blk" + std::to_string (b) + "."; - add (k + "peakSPL", proc.getPeakSPL()); - add (k + "peakDBA", proc.getPeakDBASPL()); - add (k + "peakDBC", proc.getPeakDBCSPL()); - add (k + "rmsSPL", proc.getRMSSPL()); - add (k + "rmsDBA", proc.getRMSDBASPL()); - add (k + "rmsDBC", proc.getRMSDBCSPL()); - add (k + "rough", proc.getRoughness()); - add (k + "sharp", proc.getSharpness()); - add (k + "fluct", proc.getFluctuation()); - add (k + "impuls", proc.getImpulsiveness()); - add (k + "tonal", proc.getTonality()); - } - } - - const auto log = proc.copyLog(); - add ("log.count", static_cast (log.size())); - for (size_t i = 0; i < log.size(); ++i) - { - const auto& e = log[i]; - const std::string k = "log" + std::to_string (i) + "."; - add (k + "peakSPL", e.peakSPL); add (k + "peakDBA", e.peakDBASPL); add (k + "peakDBC", e.peakDBCSPL); - add (k + "rmsSPL", e.rmsSPL); add (k + "rmsDBA", e.rmsDBASPL); add (k + "rmsDBC", e.rmsDBCSPL); - add (k + "rough", e.roughness); add (k + "fluct", e.fluctuation); add (k + "sharp", e.sharpness); - add (k + "sone", e.loudnessSone); add (k + "impuls", e.impulsiveness); add (k + "tonal", e.tonality); - add (k + "annoy", e.psychoAnnoyance); - } - - std::vector fft (kFftWindow); - for (int ch : { -1, 0, 1 }) - { - proc.copyFftWindow (fft.data(), kFftWindow, ch); - for (int i = 0; i < kFftWindow; i += 7) - add ("fft" + std::to_string (ch) + "." + std::to_string (i), fft[(size_t) i]); - } - - add ("sessionPeakDBC", proc.getSessionPeakDBCSPL()); - add ("noiseDose", proc.getNoiseDosePct()); - - proc.releaseResources(); - return out; -} - std::string formatValue (float v) { char buf[64]; diff --git a/Tests/ProcessorTestHelpers.h b/Tests/ProcessorTestHelpers.h new file mode 100644 index 0000000..e79a8a0 --- /dev/null +++ b/Tests/ProcessorTestHelpers.h @@ -0,0 +1,131 @@ +#pragma once +#include +#include +#include "PluginProcessor.h" + +#include +#include +#include +#include + +// Shared helpers for tests that drive the real SPLMeterAudioProcessor. +namespace ProcTest +{ +constexpr double kSampleRate = 48000.0; +constexpr int kBlockSize = 480; // deliberately not a power of two +constexpr int kFftWindow = 4096; + +using SignalFn = std::function; + +struct Scenario +{ + const char* name; + int numChannels; + double seconds; + SignalFn signal; + std::function configure; + // Cross-platform absolute tolerance (tolerance mode only; exact mode is always bit-identical) + float crossPlatformTol = 1.0e-3f; // meter/log values (dB, metric units) + float crossPlatformFftTol = 1.0e-6f; // FFT ring-buffer samples (linear FS) +}; + +inline float sine (double freq, double amp, int n) +{ + return static_cast (amp * std::sin (2.0 * juce::MathConstants::pi * freq * n / kSampleRate)); +} + +// Deterministic white noise, one independent LCG stream per channel +inline float noise (int channel, int n, float amp) +{ + uint32_t seed = 12345u + 7919u * static_cast (channel) + static_cast (n) * 2654435761u; + seed ^= seed >> 15; seed *= 2246822519u; seed ^= seed >> 13; seed *= 3266489917u; seed ^= seed >> 16; + return amp * (static_cast (seed) / static_cast (UINT32_MAX) * 2.0f - 1.0f); +} + +inline void setParam (SPLMeterAudioProcessor& p, const char* id, float value) +{ + auto* param = p.apvts.getParameter (id); + REQUIRE (param != nullptr); + param->setValueNotifyingHost (param->convertTo0to1 (value)); +} + +// Runs a scenario and returns the captured outputs as "key value" lines. +inline std::vector> runScenario (const Scenario& sc) +{ + // Heap-allocated like in a host: the processor holds ~6 MB of FFT ring buffers + auto procPtr = std::make_unique(); + auto& proc = *procPtr; + + auto layout = proc.getBusesLayout(); + layout.inputBuses.getReference (0) = juce::AudioChannelSet::discreteChannels (sc.numChannels); + REQUIRE (proc.setBusesLayout (layout)); + + sc.configure (proc); + proc.setRateAndBufferSizeDetails (kSampleRate, kBlockSize); + proc.prepareToPlay (kSampleRate, kBlockSize); + + const int numBusChannels = juce::jmax (proc.getTotalNumInputChannels(), proc.getTotalNumOutputChannels()); + juce::AudioBuffer buffer (numBusChannels, kBlockSize); + juce::MidiBuffer midi; + + std::vector> out; + auto add = [&out] (const std::string& key, float v) { out.emplace_back (key, v); }; + + const int totalBlocks = static_cast (sc.seconds * kSampleRate) / kBlockSize; + for (int b = 0; b < totalBlocks; ++b) + { + buffer.clear(); + for (int ch = 0; ch < sc.numChannels; ++ch) + { + auto* d = buffer.getWritePointer (ch); + for (int s = 0; s < kBlockSize; ++s) + d[s] = sc.signal (ch, b * kBlockSize + s); + } + proc.processBlock (buffer, midi); + + if (b % 10 == 9) + { + const std::string k = "blk" + std::to_string (b) + "."; + add (k + "peakSPL", proc.getPeakSPL()); + add (k + "peakDBA", proc.getPeakDBASPL()); + add (k + "peakDBC", proc.getPeakDBCSPL()); + add (k + "rmsSPL", proc.getRMSSPL()); + add (k + "rmsDBA", proc.getRMSDBASPL()); + add (k + "rmsDBC", proc.getRMSDBCSPL()); + add (k + "rough", proc.getRoughness()); + add (k + "sharp", proc.getSharpness()); + add (k + "fluct", proc.getFluctuation()); + add (k + "impuls", proc.getImpulsiveness()); + add (k + "tonal", proc.getTonality()); + } + } + + const auto log = proc.copyLog(); + add ("log.count", static_cast (log.size())); + for (size_t i = 0; i < log.size(); ++i) + { + const auto& e = log[i]; + const std::string k = "log" + std::to_string (i) + "."; + add (k + "peakSPL", e.peakSPL); add (k + "peakDBA", e.peakDBASPL); add (k + "peakDBC", e.peakDBCSPL); + add (k + "rmsSPL", e.rmsSPL); add (k + "rmsDBA", e.rmsDBASPL); add (k + "rmsDBC", e.rmsDBCSPL); + add (k + "rough", e.roughness); add (k + "fluct", e.fluctuation); add (k + "sharp", e.sharpness); + add (k + "sone", e.loudnessSone); add (k + "impuls", e.impulsiveness); add (k + "tonal", e.tonality); + add (k + "annoy", e.psychoAnnoyance); + } + + std::vector fft (kFftWindow); + for (int ch : { -1, 0, 1 }) + { + proc.copyFftWindow (fft.data(), kFftWindow, ch); + for (int i = 0; i < kFftWindow; i += 7) + add ("fft" + std::to_string (ch) + "." + std::to_string (i), fft[(size_t) i]); + } + + add ("sessionPeakDBC", proc.getSessionPeakDBCSPL()); + add ("noiseDose", proc.getNoiseDosePct()); + + proc.releaseResources(); + return out; +} + +} // namespace ProcTest diff --git a/Tests/SensorRoleTests.cpp b/Tests/SensorRoleTests.cpp new file mode 100644 index 0000000..b458598 --- /dev/null +++ b/Tests/SensorRoleTests.cpp @@ -0,0 +1,271 @@ +#include +#include "ProcessorTestHelpers.h" +#include "SensorConfig.h" + +#include + +// Vibration spec §3.1: per-input sensor roles. Accelerometer / Off inputs must be +// excluded from the microphone mix, the 20 Hz bandpass and the correction filter. + +using namespace ProcTest; + +namespace +{ +// Exact comparison on purpose (identical computations must give identical bits) +bool bitEqual (float a, float b) { return std::memcmp (&a, &b, sizeof (float)) == 0; } + +SensorConfig::Roles rolesOf (std::initializer_list list) +{ + auto r = SensorConfig::defaultRoles(); + size_t i = 0; + for (auto role : list) r[i++] = role; + return r; +} + +std::vector> withoutKeysStartingWith ( + const std::vector>& values, std::initializer_list prefixes) +{ + std::vector> out; + for (const auto& kv : values) + { + bool skip = false; + for (auto* p : prefixes) skip = skip || kv.first.rfind (p, 0) == 0; + if (! skip) out.push_back (kv); + } + return out; +} + +// Last n samples of an FFT ring-buffer channel +std::vector lastSamples (const SPLMeterAudioProcessor& p, int channel, int n) +{ + std::vector v ((size_t) n); + p.copyFftWindow (v.data(), n, channel); + return v; +} +} // namespace + +TEST_CASE ("SensorConfig: validation of role combinations", "[roles]") +{ + using SensorConfig::Validity; + using R = SensorRole; + CHECK (SensorConfig::validate (SensorConfig::defaultRoles()) == Validity::NoAccelerometer); + CHECK (SensorConfig::validate (rolesOf ({ R::Mic, R::AccelX, R::AccelY, R::AccelZ })) == Validity::Triaxial); + CHECK (SensorConfig::validate (rolesOf ({ R::AccelZ, R::Off, R::AccelX })) == Validity::Biaxial); + CHECK (SensorConfig::validate (rolesOf ({ R::Mic, R::AccelZ })) == Validity::SingleAxis); + CHECK (SensorConfig::validate (rolesOf ({ R::Mic, R::AccelUniaxial })) == Validity::Uniaxial); + CHECK (SensorConfig::validate (rolesOf ({ R::AccelX, R::AccelX })) == Validity::DuplicateAxis); + CHECK (SensorConfig::validate (rolesOf ({ R::AccelUniaxial, R::AccelZ })) == Validity::MixedKinds); + CHECK (SensorConfig::validate (rolesOf ({ R::AccelUniaxial, R::AccelUniaxial })) == Validity::MixedKinds); + CHECK_FALSE (SensorConfig::isValid (Validity::DuplicateAxis)); + CHECK (SensorConfig::isValid (Validity::Triaxial)); + + // Only the channels the device actually has are considered + CHECK (SensorConfig::validate (rolesOf ({ R::Mic, R::Mic, R::AccelX, R::AccelX }), 3) == Validity::SingleAxis); + + // Unknown persisted values fall back to Mic + CHECK (SensorConfig::fromInt (99) == R::Mic); + CHECK (SensorConfig::fromInt (-1) == R::Mic); +} + +TEST_CASE ("Sensor roles: accelerometer and Off inputs are excluded from the SPL mix", "[roles]") +{ + juce::ScopedJuceInitialiser_GUI juceInit; + + // Reference: the microphone signal alone on a mono input + const Scenario mono { "mono_ref", 1, 2.0, + [] (int, int n) { return sine (1000.0, 0.1, n) + noise (0, n, 0.01f); }, + [] (SPLMeterAudioProcessor&) {} }; + + // Same mic signal on input 1, loud signals on accelerometer / Off inputs + const Scenario quad { "quad_roles", 4, 2.0, + [] (int ch, int n) + { + switch (ch) + { + case 0: return sine (1000.0, 0.1, n) + noise (0, n, 0.01f); + case 1: return sine (80.0, 0.8, n); + case 2: return noise (2, n, 0.5f); + default: return sine (5000.0, 0.7, n); + } + }, + [] (SPLMeterAudioProcessor& p) + { + p.setChannelRole (1, SensorRole::AccelX); + p.setChannelRole (2, SensorRole::AccelY); + p.setChannelRole (3, SensorRole::Off); + } }; + + // fft0/fft1 hold inputs 1/2 individually (input 2 differs by design) + const auto ref = withoutKeysStartingWith (runScenario (mono), { "fft0.", "fft1." }); + const auto got = withoutKeysStartingWith (runScenario (quad), { "fft0.", "fft1." }); + + REQUIRE (ref.size() == got.size()); + int mismatches = 0; + std::string report; + for (size_t i = 0; i < ref.size(); ++i) + { + REQUIRE (ref[i].first == got[i].first); + if (! bitEqual (ref[i].second, got[i].second) && ++mismatches <= 10) + report += ref[i].first + ": " + std::to_string (ref[i].second) + + " vs " + std::to_string (got[i].second) + "\n"; + } + INFO (mismatches << " mismatches\n" << report); + CHECK (mismatches == 0); // identical computation, so bit-identical +} + +TEST_CASE ("Sensor roles: SPL is silent when no input is a microphone", "[roles]") +{ + juce::ScopedJuceInitialiser_GUI juceInit; + + auto proc = std::make_unique(); + auto layout = proc->getBusesLayout(); + layout.inputBuses.getReference (0) = juce::AudioChannelSet::discreteChannels (2); + REQUIRE (proc->setBusesLayout (layout)); + proc->setChannelRole (0, SensorRole::AccelZ); + proc->setChannelRole (1, SensorRole::Off); + proc->prepareToPlay (kSampleRate, kBlockSize); + + juce::AudioBuffer buffer (proc->getTotalNumInputChannels(), kBlockSize); + juce::MidiBuffer midi; + for (int b = 0; b < 100; ++b) + { + for (int ch = 0; ch < 2; ++ch) + for (int s = 0; s < kBlockSize; ++s) + buffer.setSample (ch, s, sine (440.0, 0.5, b * kBlockSize + s)); + proc->processBlock (buffer, midi); + } + CHECK (proc->getRMSSPL() < 0.0f); // -inf / floor: no microphone signal at all + CHECK (proc->getPeakSPL() < 0.0f); +} + +TEST_CASE ("Sensor roles: bandpass and correction filter leave accelerometer inputs untouched", "[roles]") +{ + juce::ScopedJuceInitialiser_GUI juceInit; + + auto proc = std::make_unique(); + auto layout = proc->getBusesLayout(); + layout.inputBuses.getReference (0) = juce::AudioChannelSet::discreteChannels (2); + REQUIRE (proc->setBusesLayout (layout)); + proc->setChannelRole (1, SensorRole::AccelX); + + // Input 1 (Mic) and input 2 (Accel) get the same 5 Hz + 200 Hz signal + auto signal = [] (int n) { return sine (5.0, 0.4, n) + sine (200.0, 0.2, n); }; + + auto runBlocks = [&] (int numBlocks, int& n, bool slowDown) + { + juce::AudioBuffer buffer (juce::jmax (proc->getTotalNumInputChannels(), + proc->getTotalNumOutputChannels()), kBlockSize); + juce::MidiBuffer midi; + for (int b = 0; b < numBlocks; ++b) + { + buffer.clear(); + for (int ch = 0; ch < 2; ++ch) + for (int s = 0; s < kBlockSize; ++s) + buffer.setSample (ch, s, signal (n + s)); + n += kBlockSize; + proc->processBlock (buffer, midi); + if (slowDown) // let the convolution load its impulse response in the background + juce::Thread::sleep (5); + } + }; + + auto expectAccelUntouched = [&] (int n) + { + const int len = 4096; + const auto accel = lastSamples (*proc, 1, len); + const auto mic = lastSamples (*proc, 0, len); + int accelDiffs = 0; + double micDiff = 0.0; + for (int i = 0; i < len; ++i) + { + const float input = signal (n - len + i); + if (! bitEqual (accel[(size_t) i], input)) ++accelDiffs; + micDiff = std::max (micDiff, (double) std::fabs (mic[(size_t) i] - input)); + } + CHECK (accelDiffs == 0); // accelerometer input passes unchanged + CHECK (micDiff > 0.05); // while the mic input was really filtered + }; + + SECTION ("bandpass") + { + setParam (*proc, "bandpassEnabled", 1.0f); + proc->prepareToPlay (kSampleRate, kBlockSize); + int n = 0; + runBlocks (100, n, false); + expectAccelUntouched (n); + } + + SECTION ("correction filter") + { + proc->prepareToPlay (kSampleRate, kBlockSize); + + const auto tmp = juce::File::createTempFile ("splmeter-correction.txt"); + REQUIRE (tmp.replaceWithText ("20 -12\n100 -12\n1000 0\n10000 6\n20000 6\n")); + proc->loadCorrectionFilter (tmp); + REQUIRE (proc->apvts.getRawParameterValue ("correctionEnabled")->load() > 0.5f); + + int n = 0; + runBlocks (60, n, true); // warm-up while the IR loads + runBlocks (100, n, false); + REQUIRE (proc->isCorrectionLoaded()); + expectAccelUntouched (n); + + proc->clearCorrectionFilter(); + tmp.deleteFile(); + } +} + +TEST_CASE ("Sensor roles: persisted in plugin state, default adds nothing", "[roles][state]") +{ + juce::ScopedJuceInitialiser_GUI juceInit; + + SECTION ("default roles leave the state without an Inputs node") + { + auto proc = std::make_unique(); + CHECK_FALSE (proc->getUiState().getChildWithName ("Inputs").isValid()); + CHECK (proc->getSensorValidity() == SensorConfig::Validity::NoAccelerometer); + } + + SECTION ("roles round-trip through get/setStateInformation") + { + auto proc = std::make_unique(); + proc->setChannelRole (0, SensorRole::Mic); + proc->setChannelRole (1, SensorRole::AccelX); + proc->setChannelRole (2, SensorRole::AccelY); + proc->setChannelRole (3, SensorRole::AccelZ); + proc->setChannelRole (7, SensorRole::Off); + + juce::MemoryBlock blob; + proc->getStateInformation (blob); + + auto restored = std::make_unique(); + restored->setChannelRole (5, SensorRole::AccelUniaxial); // must be overwritten by the load + restored->setStateInformation (blob.getData(), (int) blob.getSize()); + + CHECK (restored->getChannelRole (0) == SensorRole::Mic); + CHECK (restored->getChannelRole (1) == SensorRole::AccelX); + CHECK (restored->getChannelRole (2) == SensorRole::AccelY); + CHECK (restored->getChannelRole (3) == SensorRole::AccelZ); + CHECK (restored->getChannelRole (5) == SensorRole::Mic); + CHECK (restored->getChannelRole (7) == SensorRole::Off); + + // Switching back to Mic removes the entry again + restored->setChannelRole (7, SensorRole::Mic); + CHECK_FALSE (restored->getUiState().getChildWithName ("Inputs").hasProperty ("role7")); + } + + SECTION ("v3.5.2 state loads as all-Mic") + { + const auto fixture = juce::File (SPLMETER_GOLDEN_DIR).getChildFile ("state_v3.5.2.xml"); + const auto xml = juce::XmlDocument::parse (fixture); + REQUIRE (xml != nullptr); + juce::MemoryBlock blob; + juce::AudioProcessor::copyXmlToBinary (*xml, blob); + + auto proc = std::make_unique(); + proc->setChannelRole (2, SensorRole::AccelZ); // stale role must be cleared by the load + proc->setStateInformation (blob.getData(), (int) blob.getSize()); + for (int ch = 0; ch < SensorConfig::kMaxInputs; ++ch) + CHECK (proc->getChannelRole (ch) == SensorRole::Mic); + } +} From f58964e6db1c2f9d8080a444d7fa941278b64036 Mon Sep 17 00:00:00 2001 From: Philipp Paul Klose Date: Thu, 12 Nov 2026 17:30:01 +0100 Subject: [PATCH 08/30] Vibration step 2: per-input FFT buffers + FFT source selector - Processor: FFT ring buffer per input (up to 8), heap-allocated in prepareToPlay, grow-only and published via atomic pointers so the GUI never reads reallocated memory; replaces the 2 fixed dual arrays (processor object 4 MB smaller). copyFftWindow(channel) now serves any input; missing inputs read as silence. - New parameter fftSource: Mix / Dual (1+2) / Input 1..8. setFftSource() keeps the legacy fftDual flag in step (sessions stay readable by 3.5.2); sessions without fftSource are migrated from fftDual. - LogComponent analyses the selected source; single inputs get a legend with the channel name. - Settings: FFT source combo replaces the Dual FFT button. - JSON settings export/import: fftSource, with fftDual fallback. - Tests: per-input buffers (6 inputs, mono device, device change), source parameter, fftDual sync, state round-trip, 3.5.2 migration. Regression --exact still bit-identical. Co-Authored-By: Claude Opus 5.5 --- CMakeLists.txt | 1 + Source/LogComponent.cpp | 53 ++++++----- Source/LogComponent.h | 18 +++- Source/PluginEditor.cpp | 9 +- Source/PluginProcessor.cpp | 78 ++++++++++++++-- Source/PluginProcessor.h | 19 +++- Source/SettingsComponent.h | 57 ++++++++---- Tests/FftSourceTests.cpp | 177 +++++++++++++++++++++++++++++++++++++ 8 files changed, 356 insertions(+), 56 deletions(-) create mode 100644 Tests/FftSourceTests.cpp diff --git a/CMakeLists.txt b/CMakeLists.txt index 34362e4..5368de4 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -340,6 +340,7 @@ if(SPLMETER_BUILD_TESTS) add_executable(SPLMeterProcessorTests Tests/ProcessorRegressionTests.cpp Tests/SensorRoleTests.cpp + Tests/FftSourceTests.cpp ) target_link_libraries(SPLMeterProcessorTests PRIVATE SPLMeter diff --git a/Source/LogComponent.cpp b/Source/LogComponent.cpp index d90e459..33a15f5 100644 --- a/Source/LogComponent.cpp +++ b/Source/LogComponent.cpp @@ -806,7 +806,7 @@ void LogComponent::paint (juce::Graphics& g) for (int c = 0; c < numFftChannels(); ++c) { - g.setColour (fftDual_ ? (c == 0 ? colFftIn1 : colFftIn2) : crossCol); + g.setColour (fftDual() ? (c == 0 ? colFftIn1 : colFftIn2) : crossCol); const float y = dbToY (fftCh_[c].bandsSmoothed[bestBand]); g.fillEllipse (crossX - 4.0f, y - 4.0f, 8.0f, 8.0f); } @@ -817,7 +817,8 @@ void LogComponent::paint (juce::Graphics& g) : juce::String (static_cast (bandFreq + 0.5f)) + " Hz"; juce::String label = freqStr; for (int c = 0; c < numFftChannels(); ++c) - label << " " << (fftDual_ ? processor.getChannelName (c) + " " : juce::String()) + label << " " << (fftSourceChannel (c) >= 0 ? processor.getChannelName (fftSourceChannel (c)) + " " + : juce::String()) << juce::String (fftCh_[c].bandsSmoothed[bestBand], 1) << " dB"; g.setFont (juce::Font (juce::FontOptions().withHeight (16.0f).withStyle ("Bold"))); @@ -850,13 +851,13 @@ void LogComponent::computeFftBands() const int fftOrder = kFftOrders[sizeIdx]; const int fftSize = 1 << fftOrder; - // Switching between mono mix and Dual FFT changes what each channel state - // is fed with, so its history must start over too - const bool dual = processor.apvts.getRawParameterValue ("fftDual")->load() > 0.5f; + // Switching the FFT source (mix / input / dual) changes what each channel + // state is fed with, so its history must start over too + const int source = processor.getFftSource(); - if (fftOrder != currentFftOrder_ || dual != fftDual_) + if (fftOrder != currentFftOrder_ || source != fftSource_) { - if (dual != fftDual_) + if (source != fftSource_) { for (auto& ch : fftCh_) { @@ -867,7 +868,7 @@ void LogComponent::computeFftBands() } currentFftOrder_ = fftOrder; - fftDual_ = dual; + fftSource_ = source; fft_ = std::make_unique (fftOrder); windowCoeffs_.assign (fftSize, 0.0f); for (auto& ch : fftCh_) @@ -921,7 +922,7 @@ void LogComponent::computeFftBands() } for (int c = 0; c < numFftChannels(); ++c) - processFftChannel (fftCh_[c], fftDual_ ? c : -1); + processFftChannel (fftCh_[c], fftSourceChannel (c)); } // Runs one analysis frame for a single signal. All channels share the FFT size, @@ -1134,10 +1135,26 @@ void LogComponent::drawFftOverlay (juce::Graphics& g, const juce::Rectangle (lx + 14.0f, legendY, tw + 4.0f, 16.0f), + juce::Justification::centredLeft, false); + legendY += 18.0f; + }; + + if (! fftDual()) { drawChannel (fftCh_[0], juce::Colour (0xff34c759), juce::Colour (0xaa34c759), juce::Colour (0xffffcc00)); // amber peak line + if (fftSourceChannel (0) >= 0) // single input: name it, the mix needs no legend + drawLegend ("FFT " + processor.getChannelName (fftSourceChannel (0)), juce::Colour (0xff34c759)); } else { @@ -1145,20 +1162,8 @@ void LogComponent::drawFftOverlay (juce::Graphics& g, const juce::Rectangle (lx + 14.0f, ly, tw + 4.0f, 16.0f), - juce::Justification::centredLeft, false); - ly += 18.0f; - } + drawLegend ("FFT " + processor.getChannelName (0), colFftIn1); + drawLegend ("FFT " + processor.getChannelName (1), colFftIn2); } // ---- Graph Overlay: dashed blue frequency-response curve ---- diff --git a/Source/LogComponent.h b/Source/LogComponent.h index eba4c7b..ee172e4 100644 --- a/Source/LogComponent.h +++ b/Source/LogComponent.h @@ -65,8 +65,9 @@ class LogComponent : public juce::Component, static constexpr int kMaxFftOrder = 19; // 2^19 = 524288, matches PluginProcessor::kFftCircBufSize static constexpr int kMaxFftBands = 256; // enough for 1/24-Oct (~240 bands) - // Per-signal analysis state. Mono mode uses fftCh_[0] fed by the input mix; - // Dual FFT feeds fftCh_[0] / fftCh_[1] from inputs 1 / 2 with identical settings. + // Per-signal analysis state. Mix / single-input mode uses fftCh_[0]; Dual FFT + // feeds fftCh_[0] / fftCh_[1] from inputs 1 / 2 with identical settings. + // fftSource_ is the processor's FftSource value. struct FftChannel { std::vector inputHistory; // overlap history @@ -79,7 +80,16 @@ class LogComponent : public juce::Component, double peakTimestamps[kMaxFftBands] {}; }; void processFftChannel (FftChannel&, int sourceChannel); - int numFftChannels() const noexcept { return fftDual_ ? 2 : 1; } + bool fftDual() const noexcept { return fftSource_ == SPLMeterAudioProcessor::FftSourceDual; } + int numFftChannels() const noexcept { return fftDual() ? 2 : 1; } + // Processor channel feeding fftCh_[c]: -1 = mix, otherwise the input index + int fftSourceChannel (int c) const noexcept + { + if (fftDual()) return c; + if (fftSource_ >= SPLMeterAudioProcessor::FftSourceInput1) + return fftSource_ - SPLMeterAudioProcessor::FftSourceInput1; + return -1; + } static const juce::Colour colFftIn1; // Dual FFT: input 1 (green) static const juce::Colour colFftIn2; // Dual FFT: input 2 (red) @@ -91,7 +101,7 @@ class LogComponent : public juce::Component, int currentNumBands_ = 0; int currentBandN_ = -1; int currentWindowType_ = -1; - bool fftDual_ = false; + int fftSource_ = SPLMeterAudioProcessor::FftSourceMix; bool fftEnabled_ = false; bool lightMode_ = false; diff --git a/Source/PluginEditor.cpp b/Source/PluginEditor.cpp index 76d5608..4618223 100644 --- a/Source/PluginEditor.cpp +++ b/Source/PluginEditor.cpp @@ -821,6 +821,7 @@ void SPLMeterAudioProcessorEditor::doSaveSettingsJson() p->setProperty ("fftOverlap", getInt ("fftOverlap")); p->setProperty ("fftRTAMode", getBool ("fftRTAMode")); p->setProperty ("fftDual", getBool ("fftDual")); + p->setProperty ("fftSource", getInt ("fftSource")); p->setProperty ("bandpassEnabled", getBool ("bandpassEnabled")); p->setProperty ("line94Enabled", getBool ("line94Enabled")); p->setProperty ("correctionEnabled", getBool ("correctionEnabled")); @@ -915,7 +916,13 @@ void SPLMeterAudioProcessorEditor::doLoadSettingsJson() applyB ("fftPeakHold"); applyI ("fftDisplayMode"); applyI ("fftBandRes"); applyI ("fftWindowType"); applyI ("fftOverlap"); applyB ("fftRTAMode"); - applyB ("fftDual"); + // fftSource supersedes fftDual; files from ≤ 3.5.2 only have fftDual + if (p->hasProperty ("fftSource")) + audioProcessor.setFftSource ((int) p->getProperty ("fftSource")); + else if (p->hasProperty ("fftDual")) + audioProcessor.setFftSource (static_cast (p->getProperty ("fftDual")) + ? SPLMeterAudioProcessor::FftSourceDual + : SPLMeterAudioProcessor::FftSourceMix); applyB ("bandpassEnabled"); applyB ("line94Enabled"); applyB ("correctionEnabled"); applyB ("graphOverlayEnabled"); applyB ("graphOverlay2Enabled"); diff --git a/Source/PluginProcessor.cpp b/Source/PluginProcessor.cpp index 9b097f1..bb98e81 100644 --- a/Source/PluginProcessor.cpp +++ b/Source/PluginProcessor.cpp @@ -95,7 +95,15 @@ SPLMeterAudioProcessor::createParameterLayout() "fftRTAMode", "FFT RTA +3dB/oct", false)); params.push_back (std::make_unique ( - "fftDual", "Dual FFT (Input 1 + 2)", false)); + "fftDual", "Dual FFT (Input 1 + 2)", false)); // legacy (≤ 3.5.2), mirrors fftSource == Dual + + { + juce::StringArray sources { "Mix", "Dual (1+2)" }; + for (int ch = 1; ch <= SPLMeterAudioProcessor::kMaxFftChannels; ++ch) + sources.add ("Input " + juce::String (ch)); + params.push_back (std::make_unique ( + "fftSource", "FFT Source", sources, 0)); + } params.push_back (std::make_unique ( "bandpassEnabled", "20-20k Bandpass", false)); @@ -239,6 +247,17 @@ void SPLMeterAudioProcessor::prepareToPlay (double sampleRate, int samplesPerBlo transportSource.prepareToPlay (samplesPerBlock, sampleRate); fileReadBuffer.setSize (2, samplesPerBlock, false, true, false); + // Per-input FFT buffers: grow only (never freed while the GUI may read them). + // Inputs 1 + 2 always exist so Dual FFT works on mono devices too. + for (int ch = 0; ch < juce::jlimit (2, kMaxFftChannels, getTotalNumInputChannels()); ++ch) + { + if (fftChStorage_[(size_t) ch] == nullptr) + { + fftChStorage_[(size_t) ch] = std::make_unique ((size_t) kFftCircBufSize); // zeroed + fftChBuf_[(size_t) ch].store (fftChStorage_[(size_t) ch].get(), std::memory_order_release); + } + } + nonMicScratch_.setSize (juce::jmax (1, juce::jmin (getTotalNumInputChannels(), SensorConfig::kMaxInputs)), samplesPerBlock, false, true, false); } @@ -449,11 +468,15 @@ void SPLMeterAudioProcessor::processBlock (juce::AudioBuffer& buffer, if (activeChannels == 0) activeChannels = 1; // silence guard const float channelScale = 1.0f / static_cast (activeChannels); - // Inputs 1 + 2 individually, for the Dual FFT (same processing stage as the mono mix) - const juce::AudioBuffer& dualSrc = fileMode ? fileReadBuffer : buffer; - const float* dualCh[2] = { - dualSrc.getNumChannels() > 0 ? dualSrc.getReadPointer (0) : nullptr, - dualSrc.getNumChannels() > 1 ? dualSrc.getReadPointer (1) : nullptr }; + // Each input individually, for per-input / Dual FFT (same processing stage as the mono mix) + const juce::AudioBuffer& chSrc = fileMode ? fileReadBuffer : buffer; + const float* chIn[kMaxFftChannels]; + float* chOut[kMaxFftChannels]; + for (int ch = 0; ch < kMaxFftChannels; ++ch) + { + chIn[ch] = ch < chSrc.getNumChannels() ? chSrc.getReadPointer (ch) : nullptr; + chOut[ch] = fftChBuf_[(size_t) ch].load (std::memory_order_acquire); + } for (int s = 0; s < numSamples; ++s) { @@ -482,8 +505,9 @@ void SPLMeterAudioProcessor::processBlock (juce::AudioBuffer& buffer, { int pos = fftWritePos_.load (std::memory_order_relaxed); fftCircBuf_[pos] = raw; - fftCircBufDual_[0][pos] = dualCh[0] != nullptr ? dualCh[0][s] : 0.0f; - fftCircBufDual_[1][pos] = dualCh[1] != nullptr ? dualCh[1][s] : 0.0f; + for (int ch = 0; ch < kMaxFftChannels; ++ch) + if (chOut[ch] != nullptr) + chOut[ch][pos] = chIn[ch] != nullptr ? chIn[ch][s] : 0.0f; fftWritePos_.store ((pos + 1) % kFftCircBufSize, std::memory_order_release); } @@ -694,7 +718,17 @@ void SPLMeterAudioProcessor::pruneLog (float logDurationSeconds) void SPLMeterAudioProcessor::copyFftWindow (float* dest, int size, int channel) const noexcept { - const auto& src = (channel == 0 || channel == 1) ? fftCircBufDual_[(size_t) channel] : fftCircBuf_; + const float* src = fftCircBuf_.data(); + if (channel >= 0) + { + src = channel < kMaxFftChannels ? fftChBuf_[(size_t) channel].load (std::memory_order_acquire) + : nullptr; + if (src == nullptr) + { + std::fill (dest, dest + size, 0.0f); + return; + } + } int writePos = fftWritePos_.load (std::memory_order_acquire); for (int i = 0; i < size; ++i) { @@ -751,6 +785,16 @@ void SPLMeterAudioProcessor::restoreStateXml (const juce::XmlElement& xml) apvts.replaceState (juce::ValueTree::fromXml (xml)); loadChannelRolesFromState(); + // ≤ 3.5.2 sessions have no fftSource: derive it from the legacy Dual FFT flag + { + bool hasSource = false; + for (auto* child : xml.getChildWithTagNameIterator ("PARAM")) + hasSource = hasSource || child->getStringAttribute ("id") == "fftSource"; + if (! hasSource) + setFftSource (apvts.getRawParameterValue ("fftDual")->load() > 0.5f ? FftSourceDual + : FftSourceMix); + } + // Apply the non-parameter settings held in UIState auto ui = getUiState(); dawSync_.store ((bool) ui.getProperty ("dawSync", false)); @@ -805,6 +849,22 @@ void SPLMeterAudioProcessor::setStateInformation (const void* data, int sizeInBy restoreStateXml (*xml); } +//============================================================================== +int SPLMeterAudioProcessor::getFftSource() const noexcept +{ + return juce::jlimit (0, kNumFftSources - 1, + (int) apvts.getRawParameterValue ("fftSource")->load()); +} + +void SPLMeterAudioProcessor::setFftSource (int source) +{ + source = juce::jlimit (0, kNumFftSources - 1, source); + if (auto* p = apvts.getParameter ("fftSource")) + p->setValueNotifyingHost (p->convertTo0to1 ((float) source)); + if (auto* d = apvts.getParameter ("fftDual")) + d->setValueNotifyingHost (source == FftSourceDual ? 1.0f : 0.0f); +} + //============================================================================== // Sensor roles — persisted in UIState/Inputs as "role" (non-Mic entries only) void SPLMeterAudioProcessor::setChannelRole (int ch, SensorRole role) diff --git a/Source/PluginProcessor.h b/Source/PluginProcessor.h index 6f78c73..4e22c11 100644 --- a/Source/PluginProcessor.h +++ b/Source/PluginProcessor.h @@ -145,8 +145,19 @@ class SPLMeterAudioProcessor : public juce::AudioProcessor // FFT circular buffer (audio thread → GUI, lock-free) // Sized to the largest selectable L_FFT window (524288 = 512k samples). static constexpr int kFftCircBufSize = 524288; - // channel -1 = mono mix of all inputs; 0 / 1 = input 1 / 2 alone (Dual FFT) + // channel -1 = mono mix of all inputs; 0 … kMaxFftChannels-1 = that input alone + // (post mute / bandpass / correction). Inputs without a buffer read as silence. + static constexpr int kMaxFftChannels = 8; void copyFftWindow (float* dest, int size, int channel = -1) const noexcept; + + // FFT source (parameter "fftSource"): what the timeline FFT analyses. + // Values are persisted — only append new entries. + enum FftSource { FftSourceMix = 0, FftSourceDual = 1, FftSourceInput1 = 2 }; + static constexpr int kNumFftSources = FftSourceInput1 + kMaxFftChannels; + int getFftSource() const noexcept; + // Sets "fftSource" and keeps the legacy "fftDual" flag in step, so sessions + // stay readable by v3.5.2 (message thread). + void setFftSource (int source); int pullSpectroSamples (float* dest, int maxSamples) noexcept; double getSampleRate() const noexcept { return currentSampleRate; } @@ -349,7 +360,11 @@ class SPLMeterAudioProcessor : public juce::AudioProcessor std::atomic midiLearnParamIndex { -1 }; std::array fftCircBuf_ {}; - std::array, 2> fftCircBufDual_ {}; // inputs 1 + 2, same write pos + // Per-input FFT ring buffers (same write position as fftCircBuf_). Allocated in + // prepareToPlay for the inputs present and never freed or moved afterwards, so + // the GUI can read through the published pointer at any time. + std::array, kMaxFftChannels> fftChStorage_; + std::array, kMaxFftChannels> fftChBuf_ {}; std::atomic fftWritePos_ { 0 }; std::atomic spectroReadPos_ { 0 }; diff --git a/Source/SettingsComponent.h b/Source/SettingsComponent.h index 22bea39..8e240cc 100644 --- a/Source/SettingsComponent.h +++ b/Source/SettingsComponent.h @@ -659,19 +659,20 @@ class SettingsComponent : public juce::Component, }; addAndMakeVisible (fftRTAButton); - // Dual FFT: separate spectra for input 1 (green) and input 2 (red) - fftDualButton.setColour (juce::TextButton::buttonColourId, juce::Colour (0xff3a3a3c)); - fftDualButton.setColour (juce::TextButton::buttonOnColourId, juce::Colour (0xff34c759)); - fftDualButton.setColour (juce::TextButton::textColourOffId, juce::Colours::white); - fftDualButton.setColour (juce::TextButton::textColourOnId, juce::Colours::black); - fftDualButton.setClickingTogglesState (true); - fftDualButton.setTooltip ("Separate FFT for input 1 (green) and input 2 (red), same analysis settings"); - fftDualButton.onClick = [this, &p] + // FFT source: input mix, a single input, or Dual (input 1 green / input 2 red) + fftSourceCombo.setColour (juce::ComboBox::backgroundColourId, juce::Colour (0xff3a3a3c)); + fftSourceCombo.setColour (juce::ComboBox::textColourId, juce::Colours::white); + fftSourceCombo.setColour (juce::ComboBox::outlineColourId, juce::Colour (0xff48484a)); + fftSourceCombo.setColour (juce::ComboBox::arrowColourId, juce::Colours::white); + fftSourceCombo.setTooltip ("FFT source: mix of all microphone inputs, a single input, " + "or Dual = input 1 (green) and input 2 (red) with identical analysis settings"); + fftSourceCombo.onChange = [this, &p] { - auto* param = p.apvts.getParameter ("fftDual"); - param->setValueNotifyingHost (fftDualButton.getToggleState() ? 1.0f : 0.0f); + if (const int id = fftSourceCombo.getSelectedId(); id > 0) + p.setFftSource (id - 1); }; - addAndMakeVisible (fftDualButton); + refreshFftSourceItems(); + addAndMakeVisible (fftSourceCombo); // FFT frequency range sliders setupKnob (fftLowerFreqSlider, fftLowerFreqLabel, "f Lower"); @@ -981,7 +982,7 @@ class SettingsComponent : public juce::Component, auto btnRow = r.removeFromTop (28); const int bw = btnRow.getWidth() / 3; fftEnableButton.setBounds (btnRow.removeFromLeft (bw).reduced (2, 0)); - fftDualButton.setBounds (btnRow.removeFromLeft (bw).reduced (2, 0)); + fftSourceCombo.setBounds (btnRow.removeFromLeft (bw).reduced (2, 0)); bandpassButton.setBounds (btnRow.reduced (2, 0)); r.removeFromTop (5); @@ -1146,7 +1147,6 @@ class SettingsComponent : public juce::Component, styleBtn (dispPeakButton, juce::Colour (0xff34c759)); styleBtn (fftPeakHoldButton, juce::Colour (0xffffcc00)); styleBtn (fftRTAButton, juce::Colour (0xffff6b35)); - styleBtn (fftDualButton, juce::Colour (0xff34c759)); styleBtn (bandpassButton, juce::Colour (0xffff9f0a)); styleBtn (line94Button, juce::Colour (0xffff453a)); styleBtn (correctionEnableButton, juce::Colour (0xff34c759)); @@ -1232,8 +1232,8 @@ class SettingsComponent : public juce::Component, fftPeakHoldButton.setToggleState (peakOn, juce::dontSendNotification); bool rtaOn = processor.apvts.getRawParameterValue ("fftRTAMode")->load() > 0.5f; fftRTAButton.setToggleState (rtaOn, juce::dontSendNotification); - bool dualOn = processor.apvts.getRawParameterValue ("fftDual")->load() > 0.5f; - fftDualButton.setToggleState (dualOn, juce::dontSendNotification); + refreshFftSourceItems(); + fftSourceCombo.setSelectedId (processor.getFftSource() + 1, juce::dontSendNotification); bool bpOn = processor.apvts.getRawParameterValue ("bandpassEnabled")->load() > 0.5f; @@ -1311,7 +1311,32 @@ class SettingsComponent : public juce::Component, // FFT Peak Hold + RTA juce::TextButton fftPeakHoldButton { "Peak Hold" }; juce::TextButton fftRTAButton { "RTA +3dB/Oct" }; - juce::TextButton fftDualButton { "Dual FFT" }; + juce::ComboBox fftSourceCombo; + juce::String fftSourceItemsKey_; // input count + names the items were built for + + // (Re)builds the FFT source items when the input count or channel names change + void refreshFftSourceItems() + { + const int numInputs = juce::jmin (processor.getTotalNumInputChannels(), + SPLMeterAudioProcessor::kMaxFftChannels); + juce::String key (numInputs); + for (int ch = 0; ch < SPLMeterAudioProcessor::kMaxFftChannels; ++ch) + key << '|' << processor.getChannelName (ch); + if (key == fftSourceItemsKey_) + return; + fftSourceItemsKey_ = key; + + fftSourceCombo.clear (juce::dontSendNotification); + fftSourceCombo.addItem ("FFT: Mix", SPLMeterAudioProcessor::FftSourceMix + 1); + fftSourceCombo.addItem ("FFT: Dual (1+2)", SPLMeterAudioProcessor::FftSourceDual + 1); + for (int ch = 0; ch < SPLMeterAudioProcessor::kMaxFftChannels; ++ch) + { + const int id = SPLMeterAudioProcessor::FftSourceInput1 + ch + 1; + fftSourceCombo.addItem ("FFT: " + processor.getChannelName (ch), id); + fftSourceCombo.setItemEnabled (id, ch < numInputs); + } + fftSourceCombo.setSelectedId (processor.getFftSource() + 1, juce::dontSendNotification); + } // Window function juce::TextButton winHannButton { "Hann" }; diff --git a/Tests/FftSourceTests.cpp b/Tests/FftSourceTests.cpp new file mode 100644 index 0000000..d73ce14 --- /dev/null +++ b/Tests/FftSourceTests.cpp @@ -0,0 +1,177 @@ +#include +#include "ProcessorTestHelpers.h" + +#include +#include + +// Vibration spec §7.4: per-input FFT ring buffers and the "fftSource" parameter +// (Mix / Dual (1+2) / Input 1…8) replacing the Dual FFT toggle. + +using namespace ProcTest; + +namespace +{ +bool bitEqual (float a, float b) { return std::memcmp (&a, &b, sizeof (float)) == 0; } + +std::unique_ptr makeProcessor (int numInputs) +{ + auto proc = std::make_unique(); + auto layout = proc->getBusesLayout(); + layout.inputBuses.getReference (0) = juce::AudioChannelSet::discreteChannels (numInputs); + REQUIRE (proc->setBusesLayout (layout)); + proc->prepareToPlay (kSampleRate, kBlockSize); + return proc; +} + +// Distinct deterministic signal per input +float inputSignal (int ch, int n) { return sine (100.0 * (ch + 1), 0.05 * (ch + 1), n); } + +int runBlocks (SPLMeterAudioProcessor& proc, int numInputs, int numBlocks) +{ + juce::AudioBuffer buffer (juce::jmax (proc.getTotalNumInputChannels(), + proc.getTotalNumOutputChannels()), kBlockSize); + juce::MidiBuffer midi; + int n = 0; + for (int b = 0; b < numBlocks; ++b, n += kBlockSize) + { + buffer.clear(); + for (int ch = 0; ch < numInputs; ++ch) + for (int s = 0; s < kBlockSize; ++s) + buffer.setSample (ch, s, inputSignal (ch, n + s)); + proc.processBlock (buffer, midi); + } + return n; +} + +juce::MemoryBlock stateOf (SPLMeterAudioProcessor& proc) +{ + juce::MemoryBlock blob; + proc.getStateInformation (blob); + return blob; +} +} // namespace + +TEST_CASE ("FFT buffers: every input up to 8 is recorded individually", "[fft]") +{ + juce::ScopedJuceInitialiser_GUI juceInit; + + constexpr int numInputs = 6; + auto proc = makeProcessor (numInputs); + const int n = runBlocks (*proc, numInputs, 30); + + const int len = 2048; + std::vector buf ((size_t) len); + for (int ch = 0; ch < numInputs; ++ch) + { + proc->copyFftWindow (buf.data(), len, ch); + int diffs = 0; + for (int i = 0; i < len; ++i) + if (! bitEqual (buf[(size_t) i], inputSignal (ch, n - len + i))) ++diffs; + INFO ("input " << ch + 1); + CHECK (diffs == 0); + } + + // Inputs the device does not have read as silence (no buffer allocated) + proc->copyFftWindow (buf.data(), len, 7); + CHECK (std::all_of (buf.begin(), buf.end(), [] (float v) { return v == 0.0f; })); + proc->copyFftWindow (buf.data(), len, 42); + CHECK (std::all_of (buf.begin(), buf.end(), [] (float v) { return v == 0.0f; })); +} + +TEST_CASE ("FFT buffers: mono device still provides inputs 1 + 2 for Dual FFT", "[fft]") +{ + juce::ScopedJuceInitialiser_GUI juceInit; + + auto proc = makeProcessor (1); + const int n = runBlocks (*proc, 1, 10); + + std::vector buf (1024); + proc->copyFftWindow (buf.data(), 1024, 0); + CHECK (bitEqual (buf.back(), inputSignal (0, n - 1))); + proc->copyFftWindow (buf.data(), 1024, 1); + CHECK (std::all_of (buf.begin(), buf.end(), [] (float v) { return v == 0.0f; })); +} + +TEST_CASE ("FFT buffers: more inputs after a device change get buffers too", "[fft]") +{ + juce::ScopedJuceInitialiser_GUI juceInit; + + auto proc = makeProcessor (2); + runBlocks (*proc, 2, 5); + + auto layout = proc->getBusesLayout(); + layout.inputBuses.getReference (0) = juce::AudioChannelSet::discreteChannels (8); + REQUIRE (proc->setBusesLayout (layout)); + proc->prepareToPlay (kSampleRate, kBlockSize); + const int n = runBlocks (*proc, 8, 5); + + std::vector buf (512); + proc->copyFftWindow (buf.data(), 512, 7); + CHECK (bitEqual (buf.back(), inputSignal (7, n - 1))); +} + +TEST_CASE ("FFT source: parameter, legacy fftDual flag and migration", "[fft][state]") +{ + juce::ScopedJuceInitialiser_GUI juceInit; + + SECTION ("default is the mix") + { + auto proc = std::make_unique(); + CHECK (proc->getFftSource() == SPLMeterAudioProcessor::FftSourceMix); + } + + SECTION ("setFftSource keeps fftDual in step") + { + auto proc = std::make_unique(); + proc->setFftSource (SPLMeterAudioProcessor::FftSourceDual); + CHECK (proc->apvts.getRawParameterValue ("fftDual")->load() > 0.5f); + proc->setFftSource (SPLMeterAudioProcessor::FftSourceInput1 + 2); + CHECK (proc->getFftSource() == SPLMeterAudioProcessor::FftSourceInput1 + 2); + CHECK (proc->apvts.getRawParameterValue ("fftDual")->load() < 0.5f); + proc->setFftSource (999); // clamped + CHECK (proc->getFftSource() == SPLMeterAudioProcessor::kNumFftSources - 1); + } + + SECTION ("source round-trips through the plugin state") + { + auto proc = std::make_unique(); + proc->setFftSource (SPLMeterAudioProcessor::FftSourceInput1 + 4); + const auto blob = stateOf (*proc); + + auto restored = std::make_unique(); + restored->setStateInformation (blob.getData(), (int) blob.getSize()); + CHECK (restored->getFftSource() == SPLMeterAudioProcessor::FftSourceInput1 + 4); + } + + SECTION ("v3.5.2 session with Dual FFT on opens as Dual (1+2)") + { + const auto fixture = juce::File (SPLMETER_GOLDEN_DIR).getChildFile ("state_v3.5.2.xml"); + const auto xml = juce::XmlDocument::parse (fixture); + REQUIRE (xml != nullptr); + REQUIRE (xml->getChildByAttribute ("id", "fftSource") == nullptr); // truly an old session + + juce::MemoryBlock blob; + juce::AudioProcessor::copyXmlToBinary (*xml, blob); + auto proc = std::make_unique(); + proc->setFftSource (SPLMeterAudioProcessor::FftSourceInput1); // must be overridden + proc->setStateInformation (blob.getData(), (int) blob.getSize()); + CHECK (proc->getFftSource() == SPLMeterAudioProcessor::FftSourceDual); + } + + SECTION ("old session with Dual FFT off opens as Mix") + { + const auto fixture = juce::File (SPLMETER_GOLDEN_DIR).getChildFile ("state_v3.5.2.xml"); + auto xml = juce::XmlDocument::parse (fixture); + REQUIRE (xml != nullptr); + auto* dual = xml->getChildByAttribute ("id", "fftDual"); + REQUIRE (dual != nullptr); + dual->setAttribute ("value", 0.0); + + juce::MemoryBlock blob; + juce::AudioProcessor::copyXmlToBinary (*xml, blob); + auto proc = std::make_unique(); + proc->setFftSource (SPLMeterAudioProcessor::FftSourceDual); + proc->setStateInformation (blob.getData(), (int) blob.getSize()); + CHECK (proc->getFftSource() == SPLMeterAudioProcessor::FftSourceMix); + } +} From e6cb7dbaee484227e3e2cf34939c416ce739cbf3 Mon Sep 17 00:00:00 2001 From: Philipp Paul Klose Date: Thu, 12 Nov 2026 17:50:22 +0100 Subject: [PATCH 09/30] Vibration step 3: accelerometer DSP classes (Source/Vibration) Header-only, no JUCE dependency: - Biquad.h: double-precision biquads, bilinear transform with prewarping - Weighting.h: ISO 8041 Wb/Wc/Wd/We/Wf/Wh/Wj/Wk/Wm, KB (DIN 4150-2), band-limit; digital filters + exact analog magnitude - Decimator.h: half-band FIR cascade (75 taps, -92 dB) to fs >= 8 kHz - Calibration.h: calibrator and datasheet methods (dB re 1 um/s^2) - AccelChannel.h: cal -> HP -> integrate (full rate, no DC pole) -> decimate -> weighting Tests (VibrationDspTests.cpp, 8 cases / 1093 assertions): - parameters vs ~300 public reference values (<= 0.02 dB; Wb 0.06) - digital vs analog within nominal ranges (+-0.1 dB) - decimator ripple/stopband/aliasing, calibration formulas, velocity/displacement accuracy (0.5 %), Wk end to end Spec: datasheet formula needs sqrt(2); integration before decimation. Co-Authored-By: Claude Opus 5.5 --- CMakeLists.txt | 1 + Source/Vibration/AccelChannel.h | 107 ++++++++++++ Source/Vibration/Biquad.h | 105 ++++++++++++ Source/Vibration/Calibration.h | 45 +++++ Source/Vibration/Decimator.h | 117 +++++++++++++ Source/Vibration/Weighting.h | 186 ++++++++++++++++++++ Tests/VibrationDspTests.cpp | 291 ++++++++++++++++++++++++++++++++ docs/VIBRATION_SPEC.md | 15 +- 8 files changed, 861 insertions(+), 6 deletions(-) create mode 100644 Source/Vibration/AccelChannel.h create mode 100644 Source/Vibration/Biquad.h create mode 100644 Source/Vibration/Calibration.h create mode 100644 Source/Vibration/Decimator.h create mode 100644 Source/Vibration/Weighting.h create mode 100644 Tests/VibrationDspTests.cpp diff --git a/CMakeLists.txt b/CMakeLists.txt index 5368de4..68025a7 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -317,6 +317,7 @@ if(SPLMETER_BUILD_TESTS) Tests/StateSerializationTests.cpp Tests/MarkerTests.cpp Tests/LeqTests.cpp + Tests/VibrationDspTests.cpp ) target_include_directories(SPLMeterTests PRIVATE Source) diff --git a/Source/Vibration/AccelChannel.h b/Source/Vibration/AccelChannel.h new file mode 100644 index 0000000..57ce104 --- /dev/null +++ b/Source/Vibration/AccelChannel.h @@ -0,0 +1,107 @@ +#pragma once +#include "Biquad.h" +#include "Calibration.h" +#include "Decimator.h" +#include "Weighting.h" + +namespace vib +{ +//============================================================================== +// Signal chain of one accelerometer axis (vibration spec §5.1): +// +// raw (FS) ─► ×cal (m/s²) ─► HP (2nd-order Butterworth) +// ├─► full-rate output: acceleration, m/s² (FFT, structure-borne) +// └─► quantity (a / v / d) ─► decimate ÷D (fs_d ≥ 8 kHz) ─► weighting +// +// Integration uses s / (s² + ω/Q·s + ω²) at the high-pass corner: an integrator +// above the corner that has no pole at DC, so offsets cannot make it drift. It runs +// at the full rate, where the bilinear integrator is accurate to 0.14 % at 1 kHz +// (at 12 kHz it would be 2.3 % low — too much for ISO 20816 up to 1000 Hz). +// Units: acceleration m/s², velocity m/s, displacement m. +enum class Quantity : int { Acceleration = 0, Velocity = 1, Displacement = 2 }; + +struct AccelChannelConfig +{ + double calDb = 140.0; + double highPassHz = 1.0; + Quantity quantity = Quantity::Acceleration; + Weighting weighting = Weighting::None; + double bandLowHz = 0.0; // Weighting::BandLimit only + double bandHighHz = kInf; +}; + +class AccelChannel +{ +public: + static constexpr double kMinDecimatedRate = 8000.0; + + void prepare (double fs, const AccelChannelConfig& cfg) + { + fs_ = fs; + cfg_ = cfg; + scale_ = calibration::scale (cfg.calDb); + + const double Q = 1.0 / std::sqrt (2.0); + highPass_ = Biquad::highPass (cfg.highPassHz, Q, fs); + + decimator_.prepare (fs, kMinDecimatedRate); + const double fsd = decimator_.outputRate (fs); + + // Integrators at the HP corner (Q = 1/√2 keeps the corner Butterworth-like) + const double w = 2.0 * kPi * cfg.highPassHz; + const auto integ = Biquad::fromAnalog (0.0, 1.0, 0.0, w * w, w / Q, 1.0, fs, 0.0); + numIntegrators_ = static_cast (cfg.quantity); + for (auto& i : integrators_) i = integ; + + weighting_.prepare (cfg.weighting, fsd, cfg.bandLowHz, cfg.bandHighHz); + reset(); + } + + void reset() noexcept + { + highPass_.reset(); + decimator_.reset(); + for (auto& i : integrators_) i.reset(); + weighting_.reset(); + } + + // Processes one raw input sample. fullRate receives the calibrated, high-passed + // acceleration; returns true when a decimated, weighted sample is written to out. + bool process (float raw, double& fullRate, double& out) noexcept + { + fullRate = highPass_.process (static_cast (raw) * scale_); + double q = fullRate; + for (int i = 0; i < numIntegrators_; ++i) + q = integrators_[i].process (q); + double d; + if (! decimator_.push (q, d)) + return false; + out = weighting_.process (d); + return true; + } + + double decimatedRate() const noexcept { return decimator_.outputRate (fs_); } + int decimationFactor() const noexcept { return decimator_.factor(); } + const AccelChannelConfig& config() const noexcept { return cfg_; } + + // Magnitude of quantity + weighting at f (Hz), relative to acceleration input — + // excludes the channel high-pass and decimator (used by tests and the UI) + double pathMagnitude (double f) const + { + double m = weighting_.magnitude (f); + for (int i = 0; i < numIntegrators_; ++i) + m *= std::abs (integrators_[i].response (f, fs_)); + return m; + } + +private: + AccelChannelConfig cfg_; + double fs_ = 48000.0; + double scale_ = 1.0; + Biquad highPass_; + Decimator decimator_; + Biquad integrators_[2]; + int numIntegrators_ = 0; + WeightingFilter weighting_; +}; +} // namespace vib diff --git a/Source/Vibration/Biquad.h b/Source/Vibration/Biquad.h new file mode 100644 index 0000000..8b41fc7 --- /dev/null +++ b/Source/Vibration/Biquad.h @@ -0,0 +1,105 @@ +#pragma once +#include +#include + +namespace vib +{ +constexpr double kPi = 3.14159265358979323846; + +//============================================================================== +// Double-precision biquad (transposed direct form II). +// The vibration path needs double precision: weighting poles down to 0.08 Hz sit +// extremely close to z = 1 even at the decimated sample rate. +struct Biquad +{ + double b0 = 1.0, b1 = 0.0, b2 = 0.0, a1 = 0.0, a2 = 0.0; + double z1 = 0.0, z2 = 0.0; + + void reset() noexcept { z1 = z2 = 0.0; } + + double process (double x) noexcept + { + const double y = b0 * x + z1; + z1 = b1 * x - a1 * y + z2; + z2 = b2 * x - a2 * y; + return y; + } + + // Complex frequency response at f (Hz) for sample rate fs + std::complex response (double f, double fs) const + { + const auto z1c = std::polar (1.0, -2.0 * kPi * f / fs); // z^-1 + const auto z2c = z1c * z1c; + return (b0 + b1 * z1c + b2 * z2c) / (1.0 + a1 * z1c + a2 * z2c); + } + + // Analog section H(s) = (B0 + B1 s + B2 s²) / (A0 + A1 s + A2 s²) → digital via the + // bilinear transform, prewarped so the response is exact at fWarp (Hz). + static Biquad fromAnalog (double B0, double B1, double B2, + double A0, double A1, double A2, + double fs, double fWarp) + { + double K = 2.0 * fs; + if (fWarp > 0.0 && fWarp < 0.5 * fs) + { + const double w = 2.0 * kPi * fWarp; + K = w / std::tan (w / (2.0 * fs)); + } + const double K2 = K * K; + const double nb0 = B0 + B1 * K + B2 * K2; + const double nb1 = 2.0 * B0 - 2.0 * B2 * K2; + const double nb2 = B0 - B1 * K + B2 * K2; + const double na0 = A0 + A1 * K + A2 * K2; + const double na1 = 2.0 * A0 - 2.0 * A2 * K2; + const double na2 = A0 - A1 * K + A2 * K2; + + Biquad q; + q.b0 = nb0 / na0; q.b1 = nb1 / na0; q.b2 = nb2 / na0; + q.a1 = na1 / na0; q.a2 = na2 / na0; + return q; + } + + // 2nd-order high-pass, H(s) = s² / (s² + ω/Q s + ω²) + static Biquad highPass (double fc, double Q, double fs) + { + const double w = 2.0 * kPi * fc; + return fromAnalog (0.0, 0.0, 1.0 / (w * w), 1.0, 1.0 / (w * Q), 1.0 / (w * w), fs, fc); + } + + // 2nd-order low-pass, H(s) = ω² / (s² + ω/Q s + ω²) + static Biquad lowPass (double fc, double Q, double fs) + { + const double w = 2.0 * kPi * fc; + return fromAnalog (1.0, 0.0, 0.0, 1.0, 1.0 / (w * Q), 1.0 / (w * w), fs, fc); + } +}; + +// Fixed cascade of biquads (no allocation) +template +struct BiquadCascade +{ + Biquad sections[MaxSections]; + int numSections = 0; + double gain = 1.0; + + void clear() noexcept { numSections = 0; gain = 1.0; } + void add (const Biquad& q) noexcept { if (numSections < MaxSections) sections[numSections++] = q; } + void reset() noexcept { for (int i = 0; i < numSections; ++i) sections[i].reset(); } + + double process (double x) noexcept + { + x *= gain; + for (int i = 0; i < numSections; ++i) + x = sections[i].process (x); + return x; + } + + std::complex response (double f, double fs) const + { + std::complex h (gain, 0.0); + for (int i = 0; i < numSections; ++i) + h *= sections[i].response (f, fs); + return h; + } +}; +} // namespace vib diff --git a/Source/Vibration/Calibration.h b/Source/Vibration/Calibration.h new file mode 100644 index 0000000..842ac62 --- /dev/null +++ b/Source/Vibration/Calibration.h @@ -0,0 +1,45 @@ +#pragma once +#include + +namespace vib +{ +//============================================================================== +// Accelerometer calibration (vibration spec §4). +// +// Per-channel calDb maps the input to acceleration level in dB re 1 µm/s² (ISO 1683): +// L_a = 20·log10(rms_FS) + calDb +// so one full-scale unit (sample value 1.0) corresponds to scale() m/s². +namespace calibration +{ + constexpr double kRefAccel = 1.0e-6; // 1 µm/s² + constexpr double kGravity = 9.80665; // m/s² per g + constexpr double kCalibratorRms = 10.0; // handheld calibrator, m/s² RMS at 159.2 Hz + constexpr double kMinCalDb = 60.0; + constexpr double kMaxCalDb = 220.0; + + // m/s² per full-scale unit + inline double scale (double calDb) noexcept { return std::pow (10.0, (calDb - 120.0) / 20.0); } + + inline double levelDb (double accelRms) noexcept { return 20.0 * std::log10 (accelRms / kRefAccel); } + + // Calibrator method: the reference acceleration (RMS) produced measuredRmsFS + inline double calDbFromCalibrator (double measuredRmsFS, double referenceRms = kCalibratorRms) noexcept + { + return levelDb (referenceRms) - 20.0 * std::log10 (measuredRmsFS); + } + + // Datasheet method. A full-scale sine (sample peak 1.0) produces fullScaleVrms at the + // interface input; the sensor delivers sensitivity_mV_per_ms2 mV per m/s². + // Sample value 1.0 ↔ √2·V_FS,rms / S m/s². + inline double calDbFromDatasheet (double fullScaleVrms, double sensitivity_mV_per_ms2) noexcept + { + const double peakVolts = std::sqrt (2.0) * fullScaleVrms; + return 120.0 + 20.0 * std::log10 (peakVolts * 1000.0 / sensitivity_mV_per_ms2); + } + + inline double mVperMs2FromMVperG (double mVperG) noexcept { return mVperG / kGravity; } + + // dBu (0 dBu = 0.7746 Vrms) → Vrms, for interfaces specified as "+X dBu at 0 dBFS" + inline double dBuToVrms (double dBu) noexcept { return 0.774597 * std::pow (10.0, dBu / 20.0); } +} +} // namespace vib diff --git a/Source/Vibration/Decimator.h b/Source/Vibration/Decimator.h new file mode 100644 index 0000000..8ead548 --- /dev/null +++ b/Source/Vibration/Decimator.h @@ -0,0 +1,117 @@ +#pragma once +#include "Biquad.h" +#include +#include + +namespace vib +{ +//============================================================================== +// Decimation by a power of two with a cascade of half-band FIR stages +// (vibration spec §5.1). Each stage: Kaiser-windowed half-band, passband up to +// 0.2·fs_in, stopband from 0.3·fs_in with ≥ 90 dB attenuation. +class HalfBandStage +{ +public: + static constexpr int kTaps = 75; // 4k+3 → non-zero end taps; −92 dB at Δf = 0.1·fs + + HalfBandStage() + { + const int M = kTaps - 1; + const double beta = 9.0; // Kaiser β; with 75 taps: stopband −92 dB, ripple 0.0002 dB + auto bessel0 = [] (double x) + { + double sum = 1.0, term = 1.0; + for (int k = 1; k < 50; ++k) + { + term *= (x / (2.0 * k)) * (x / (2.0 * k)); + sum += term; + } + return sum; + }; + double total = 0.0; + for (int n = 0; n < kTaps; ++n) + { + const double m = n - M / 2.0; + const double sinc = (m == 0.0) ? 0.5 : std::sin (kPi * m / 2.0) / (kPi * m); + const double r = 2.0 * n / M - 1.0; + const double win = bessel0 (beta * std::sqrt (std::max (0.0, 1.0 - r * r))) / bessel0 (beta); + h_[(size_t) n] = (n != M / 2 && ((n - M / 2) % 2) == 0) ? 0.0 : sinc * win; // exact zeros + total += h_[(size_t) n]; + } + for (auto& v : h_) v /= total; // unity DC gain + reset(); + } + + void reset() noexcept { line_.fill (0.0); pos_ = 0; phase_ = 0; } + + // Feeds one input sample; returns true and sets out when an output sample is due + bool push (double x, double& out) noexcept + { + line_[(size_t) pos_] = x; + line_[(size_t) (pos_ + kTaps)] = x; // mirrored copy → contiguous window + pos_ = (pos_ + 1) % kTaps; + phase_ ^= 1; + if (phase_ != 0) + return false; + + const double* w = line_.data() + pos_; // oldest … newest + double acc = 0.0; + for (int n = 0; n < kTaps; ++n) + acc += h_[(size_t) n] * w[n]; + out = acc; + return true; + } + + // Frequency response (normalised frequency f / fs_in) + double magnitude (double fNorm) const + { + std::complex sum (0.0, 0.0); + for (int n = 0; n < kTaps; ++n) + sum += h_[(size_t) n] * std::polar (1.0, -2.0 * kPi * fNorm * n); + return std::abs (sum); + } + +private: + std::array h_ {}; + std::array line_ {}; + int pos_ = 0, phase_ = 0; +}; + +class Decimator +{ +public: + static constexpr int kMaxStages = 5; // up to ÷32 (e.g. 384 kHz → 12 kHz) + + // Chooses the largest power-of-two factor that keeps fs / D ≥ minRate + void prepare (double fs, double minRate = 8000.0) + { + numStages_ = 0; + while (numStages_ < kMaxStages && fs / (double) (2 << numStages_) >= minRate) + ++numStages_; + reset(); + } + + void reset() noexcept { for (auto& s : stages_) s.reset(); } + + int factor() const noexcept { return 1 << numStages_; } + double outputRate (double fs) const noexcept { return fs / factor(); } + + // Pushes one input sample; returns true when a decimated sample is produced + bool push (double x, double& out) noexcept + { + double v = x; + for (int i = 0; i < numStages_; ++i) + if (! stages_[(size_t) i].push (v, v)) + return false; + out = v; + return true; + } + + const HalfBandStage& stage (int i) const { return stages_[(size_t) i]; } + int numStages() const noexcept { return numStages_; } + +private: + std::array stages_; + int numStages_ = 0; +}; +} // namespace vib diff --git a/Source/Vibration/Weighting.h b/Source/Vibration/Weighting.h new file mode 100644 index 0000000..049bce3 --- /dev/null +++ b/Source/Vibration/Weighting.h @@ -0,0 +1,186 @@ +#pragma once +#include "Biquad.h" +#include + +namespace vib +{ +//============================================================================== +// Frequency weightings (vibration spec §5.2). +// +// ISO 8041 weightings are the product of band-limiting (2nd-order Butterworth HP at +// f1 and LP at f2), an a–v transition, an upward step and a gain K. Parameters were +// cross-checked against public sources (spec §14 [V], band limits [I]). +// Values are persisted — only append new entries. +enum class Weighting : int +{ + None = 0, // unweighted (only the channel high-pass applies) + BandLimit, // user band: 2nd-order Butterworth HP + LP + Wb, Wc, Wd, We, Wf, Wh, Wj, Wk, Wm, + KB // DIN 4150-2 / DIN 45669-1, applied to velocity +}; + +constexpr double kInf = std::numeric_limits::infinity(); + +struct WeightingParams +{ + double f1, f2; // band-limiting HP / LP (Hz); Q1 = Q2 = 1/√2 + double f3, f4, Q4; // a–v transition (kInf = section absent) + double f5, Q5, f6, Q6; // upward step (kInf = section absent) + double K; // gain +}; + +inline bool isIsoWeighting (Weighting w) noexcept +{ + return static_cast (w) >= static_cast (Weighting::Wb) + && static_cast (w) <= static_cast (Weighting::Wm); +} + +inline WeightingParams isoParams (Weighting w) noexcept +{ + const double s28 = 1.0 / (0.028 * 2.0 * kPi); // Wm f3 = f4 ≈ 5.684 Hz + const double h16 = 100.0 / (2.0 * kPi); // Wh f3 = f4 ≈ 15.915 Hz + switch (w) + { + // f1 f2 f3 f4 Q4 f5 Q5 f6 Q6 K + case Weighting::Wb: return { 0.4, 100.0, 16.0, 16.0, 0.55, 2.5, 0.90, 4.0, 0.95, 1.024 }; + case Weighting::Wc: return { 0.4, 100.0, 8.0, 8.0, 0.63, kInf, 1.0, kInf, 1.0, 1.0 }; + case Weighting::Wd: return { 0.4, 100.0, 2.0, 2.0, 0.63, kInf, 1.0, kInf, 1.0, 1.0 }; + case Weighting::We: return { 0.4, 100.0, 1.0, 1.0, 0.63, kInf, 1.0, kInf, 1.0, 1.0 }; + case Weighting::Wf: return { 0.08, 0.63, kInf, 0.25, 0.86, 0.0625, 0.80, 0.10, 0.80, 1.0 }; + case Weighting::Wh: return { std::pow (10.0, 0.8), std::pow (10.0, 3.1), h16, h16, 0.64, kInf, 1.0, kInf, 1.0, 1.0 }; + case Weighting::Wj: return { 0.4, 100.0, kInf, kInf, 1.0, 3.75, 0.91, 5.32, 0.91, 1.0 }; + case Weighting::Wk: return { 0.4, 100.0, 12.5, 12.5, 0.63, 2.37, 0.91, 3.35, 0.91, 1.0 }; + case Weighting::Wm: return { std::pow (10.0, -0.1), 100.0, s28, s28, 0.50, kInf, 1.0, kInf, 1.0, 1.0 }; + case Weighting::None: + case Weighting::BandLimit: + case Weighting::KB: + default: return { 0.0, kInf, kInf, kInf, 1.0, kInf, 1.0, kInf, 1.0, 1.0 }; + } +} + +// KB weighting (DIN 4150-2): first-order high-pass at f0 on velocity, +// |H| = 1/√(1 + (f0/f)²), band-limited to 1–80 Hz. +// ⚠ f0 and the band-limit filter type are not yet cross-checked (spec §13). +constexpr double kKbF0 = 5.6; +constexpr double kKbBandLow = 1.0; +constexpr double kKbBandHigh = 80.0; + +//============================================================================== +// Exact analog magnitude of a weighting — the reference the digital filter must +// reproduce (used by the unit tests). bandLow/bandHigh only for BandLimit. +inline double analogMagnitude (Weighting w, double f, double bandLow = 0.0, double bandHigh = kInf) +{ + const std::complex s (0.0, 2.0 * kPi * f); + auto hp2 = [&] (double fc) { const double wc = 2.0 * kPi * fc; + return (s * s) / (s * s + s * wc * std::sqrt (2.0) + wc * wc); }; + auto lp2 = [&] (double fc) { const double wc = 2.0 * kPi * fc; + return (wc * wc) / (s * s + s * wc * std::sqrt (2.0) + wc * wc); }; + + switch (w) + { + case Weighting::None: return 1.0; + case Weighting::BandLimit: + { + std::complex h (1.0, 0.0); + if (bandLow > 0.0) h *= hp2 (bandLow); + if (std::isfinite (bandHigh)) h *= lp2 (bandHigh); + return std::abs (h); + } + case Weighting::KB: + { + const double w0 = 2.0 * kPi * kKbF0; + return std::abs (s / (s + w0) * hp2 (kKbBandLow) * lp2 (kKbBandHigh)); + } + default: break; + } + + const auto p = isoParams (w); + std::complex h = hp2 (p.f1) * lp2 (p.f2) * p.K; + if (std::isfinite (p.f4)) + { + const double w4 = 2.0 * kPi * p.f4; + const std::complex num = std::isfinite (p.f3) ? 1.0 + s / (2.0 * kPi * p.f3) + : std::complex (1.0, 0.0); + h *= num / (1.0 + s / (w4 * p.Q4) + s * s / (w4 * w4)); + } + if (std::isfinite (p.f5)) + { + const double w5 = 2.0 * kPi * p.f5, w6 = 2.0 * kPi * p.f6; + h *= (1.0 + s / (w5 * p.Q5) + s * s / (w5 * w5)) + / (1.0 + s / (w6 * p.Q6) + s * s / (w6 * w6)) + * ((p.f5 / p.f6) * (p.f5 / p.f6)); + } + return std::abs (h); +} + +//============================================================================== +// Digital weighting filter: each analog section is mapped with the bilinear +// transform, prewarped at its own characteristic frequency. +class WeightingFilter +{ +public: + void prepare (Weighting w, double fs, double bandLow = 0.0, double bandHigh = kInf) + { + weighting_ = w; + fs_ = fs; + cascade_.clear(); + const double Q = 1.0 / std::sqrt (2.0); + auto inBand = [fs] (double f) { return f > 0.0 && std::isfinite (f) && f < 0.45 * fs; }; + + switch (w) + { + case Weighting::None: + break; + + case Weighting::BandLimit: + if (inBand (bandLow)) cascade_.add (Biquad::highPass (bandLow, Q, fs)); + if (inBand (bandHigh)) cascade_.add (Biquad::lowPass (bandHigh, Q, fs)); + break; + + case Weighting::KB: + { + const double w0 = 2.0 * kPi * kKbF0; // s / (s + ω0) + cascade_.add (Biquad::fromAnalog (0.0, 1.0 / w0, 0.0, 1.0, 1.0 / w0, 0.0, fs, kKbF0)); + cascade_.add (Biquad::highPass (kKbBandLow, Q, fs)); + cascade_.add (Biquad::lowPass (kKbBandHigh, Q, fs)); + break; + } + + default: + { + const auto p = isoParams (w); + cascade_.add (Biquad::highPass (p.f1, Q, fs)); + if (inBand (p.f2)) cascade_.add (Biquad::lowPass (p.f2, Q, fs)); + if (std::isfinite (p.f4)) + { + const double w4 = 2.0 * kPi * p.f4; + const double B1 = std::isfinite (p.f3) ? 1.0 / (2.0 * kPi * p.f3) : 0.0; + cascade_.add (Biquad::fromAnalog (1.0, B1, 0.0, + 1.0, 1.0 / (w4 * p.Q4), 1.0 / (w4 * w4), fs, p.f4)); + } + if (std::isfinite (p.f5)) + { + const double w5 = 2.0 * kPi * p.f5, w6 = 2.0 * kPi * p.f6; + const double g = (p.f5 / p.f6) * (p.f5 / p.f6); + cascade_.add (Biquad::fromAnalog (g, g / (w5 * p.Q5), g / (w5 * w5), + 1.0, 1.0 / (w6 * p.Q6), 1.0 / (w6 * w6), + fs, std::sqrt (p.f5 * p.f6))); + } + cascade_.gain = p.K; + break; + } + } + cascade_.reset(); + } + + void reset() noexcept { cascade_.reset(); } + double process (double x) noexcept { return cascade_.process (x); } + double magnitude (double f) const { return std::abs (cascade_.response (f, fs_)); } + Weighting weighting() const noexcept { return weighting_; } + +private: + BiquadCascade<4> cascade_; + Weighting weighting_ = Weighting::None; + double fs_ = 48000.0; +}; +} // namespace vib diff --git a/Tests/VibrationDspTests.cpp b/Tests/VibrationDspTests.cpp new file mode 100644 index 0000000..8196360 --- /dev/null +++ b/Tests/VibrationDspTests.cpp @@ -0,0 +1,291 @@ +#include +#include +#include "Vibration/AccelChannel.h" + +#include +#include +#include + +// Vibration spec §4, §5.1, §5.2: calibration, decimation, integration and +// ISO 8041 weightings of the accelerometer signal chain. + +using Catch::Approx; +using namespace vib; + +namespace +{ +double dB (double m) { return 20.0 * std::log10 (m); } + +// 1/3-octave band n: nominal (preferred-number) and exact (10^(n/10)) centre frequencies +double exactFreq (int band) { return std::pow (10.0, band / 10.0); } + +struct RefRow { int band; double nominal; std::vector values; }; + +// Reference weightings in dB from Virtins Technology (2024), "Frequency Weightings for +// Sound and Vibration Perceived by Humans" (spec §14 [V]). Only the cleanly extracted +// rows are used. That table evaluates Wm and Wh at exact 1/3-octave frequencies and +// the other weightings at nominal frequencies. +const std::vector kLowCols { Weighting::Wk, Weighting::Wd, Weighting::Wf, Weighting::Wc, + Weighting::We, Weighting::Wj, Weighting::Wm, Weighting::Wb }; +const std::vector kLowRows { + { -10, 0.1, { -30.11, -24.09, -3.16, -24.11, -24.08, -30.18, -36.00, -32.04 } }, + { -9, 0.125, { -26.26, -20.24, -0.96, -20.25, -20.22, -26.32, -32.00, -28.20 } }, + { -8, 0.16, { -22.05, -16.01, 0.05, -16.03, -15.98, -22.11, -28.01, -23.98 } }, + { -7, 0.2, { -18.33, -12.28, -0.07, -12.30, -12.23, -18.38, -24.02, -20.23 } }, + { -6, 0.25, { -14.81, -8.75, -1.37, -8.78, -8.67, -14.86, -20.05, -16.71 } }, + { -5, 0.315, { -11.60, -5.52, -4.17, -5.56, -5.41, -11.65, -16.12, -13.51 } }, + { -4, 0.4, { -9.07, -2.94, -8.31, -3.01, -2.81, -9.10, -12.29, -10.98 } }, + { -3, 0.5, { -7.57, -1.38, -13.00, -1.48, -1.29, -7.60, -8.67, -9.53 } }, + { -2, 0.63, { -6.77, -0.50, -18.69, -0.64, -0.55, -6.78, -5.51, -8.71 } }, +}; +const std::vector kHighCols { Weighting::Wk, Weighting::Wd, Weighting::Wc, Weighting::We, + Weighting::Wj, Weighting::Wm, Weighting::Wb, Weighting::Wh }; +const std::vector kHighRows { + { 10, 10.0, { -0.10, -13.91, -2.20, -19.98, 0.26, -6.12, -0.23, -0.43 } }, + { 11, 12.5, { -0.89, -15.87, -3.79, -21.93, 0.22, -7.71, -0.85, -0.38 } }, + { 12, 16.0, { -2.28, -18.03, -5.82, -24.08, 0.16, -9.44, -1.83, -0.96 } }, + { 13, 20.0, { -3.93, -19.99, -7.77, -26.02, 0.10, -11.25, -3.00, -2.14 } }, + { 14, 25.0, { -5.80, -21.94, -9.76, -27.97, 0.06, -13.14, -4.44, -3.78 } }, + { 15, 31.5, { -7.86, -23.98, -11.84, -30.01, 0.00, -15.09, -6.16, -5.69 } }, + { 16, 40.0, { -10.05, -26.13, -14.02, -32.15, -0.08, -17.10, -8.11, -7.72 } }, + { 17, 50.0, { -12.19, -28.22, -16.13, -34.24, -0.24, -19.23, -10.09, -9.78 } }, + { 18, 63.0, { -14.61, -30.60, -18.53, -36.62, -0.62, -21.58, -12.43, -11.83 } }, + { 19, 80.0, { -17.56, -33.53, -21.47, -39.55, -1.48, -24.38, -15.34, -13.88 } }, + { 20, 100.0, { -21.04, -36.99, -24.94, -43.01, -3.01, -27.93, -18.72, -15.91 } }, + { 21, 125.0, { -25.35, -41.28, -29.24, -47.31, -5.36, -32.37, -23.00, -17.93 } }, + { 22, 160.0, { -30.91, -46.84, -34.80, -52.86, -8.78, -37.55, -28.56, -19.94 } }, + { 23, 200.0, { -36.38, -52.30, -40.26, -58.33, -12.30, -43.18, -34.03, -21.95 } }, + { 24, 250.0, { -42.04, -57.97, -45.92, -63.99, -16.03, -49.02, -39.69, -23.96 } }, + { 25, 315.0, { -48.00, -63.92, -51.88, -69.94, -19.98, -54.95, -45.65, -25.97 } }, + { 26, 400.0, { -54.20, -70.12, -58.08, -76.14, -24.10, -60.92, -51.84, -28.00 } }, +}; +const std::vector> kWhHigh { // Wh only, 500 Hz … 4 kHz + { 27, -30.07 }, { 28, -32.23 }, { 29, -34.60 }, { 30, -37.42 }, { 31, -40.97 }, + { 32, -45.42 }, { 33, -50.60 }, { 34, -56.23 }, { 35, -62.07 }, { 36, -68.01 }, +}; + +double refFreq (Weighting w, const RefRow& r) +{ + return (w == Weighting::Wm || w == Weighting::Wh) ? exactFreq (r.band) : r.nominal; +} + +// Wb rests on a single source and deviates systematically by up to 0.05 dB (spec §13) +double refTol (Weighting w) { return w == Weighting::Wb ? 0.06 : 0.02; } + +const char* nameOf (Weighting w) +{ + static const char* names[] = { "None", "BandLimit", "Wb", "Wc", "Wd", "We", "Wf", "Wh", "Wj", "Wk", "Wm", "KB" }; + return names[static_cast (w)]; +} + +// Steady-state RMS of a processed sine (skips the settling time) +template +double sineRms (Fn&& process, double f, double fs, double amp, double settleSec, double measureSec) +{ + const int settle = (int) (settleSec * fs); + const int measure = (int) (measureSec * fs); + double sum = 0.0; int count = 0; + for (int n = 0; n < settle + measure; ++n) + { + double y; + const bool produced = process (amp * std::sin (2.0 * kPi * f * n / fs), y); + if (produced && n >= settle) { sum += y * y; ++count; } + } + return std::sqrt (sum / count); +} +} // namespace + +//============================================================================== +TEST_CASE ("Vibration weightings: parameters reproduce the public reference table", "[vibration][weighting]") +{ + for (const auto& row : kLowRows) + for (size_t c = 0; c < kLowCols.size(); ++c) + { + const auto w = kLowCols[c]; + INFO (nameOf (w) << " at " << row.nominal << " Hz"); + CHECK (dB (analogMagnitude (w, refFreq (w, row))) == Approx (row.values[c]).margin (refTol (w))); + } + for (const auto& row : kHighRows) + for (size_t c = 0; c < kHighCols.size(); ++c) + { + const auto w = kHighCols[c]; + INFO (nameOf (w) << " at " << row.nominal << " Hz"); + CHECK (dB (analogMagnitude (w, refFreq (w, row))) == Approx (row.values[c]).margin (refTol (w))); + } + for (const auto& [band, value] : kWhHigh) + { + INFO ("Wh at band " << band); + CHECK (dB (analogMagnitude (Weighting::Wh, exactFreq (band))) == Approx (value).margin (0.02)); + } +} + +TEST_CASE ("Vibration weightings: digital filters match the analog definition", "[vibration][weighting]") +{ + // Nominal frequency range per weighting (ISO 2631-1/-2/-4, ISO 5349-1, DIN 4150-2). + // Inside: ±0.1 dB (±0.2 dB in the top 1/3 octave, where bilinear warping starts). + // Up to two octaves outside: never more than 1 dB *less* attenuation than the analog + // weighting; more attenuation is fine once the response is below −40 dB (near the + // decimated Nyquist frequency bilinear warping adds attenuation). + struct Range { Weighting w; int bandLo, bandHi; }; + const std::vector ranges { + { Weighting::Wb, -3, 19 }, { Weighting::Wc, -3, 19 }, { Weighting::Wd, -3, 19 }, + { Weighting::We, -3, 19 }, { Weighting::Wj, -3, 19 }, { Weighting::Wk, -3, 19 }, + { Weighting::Wm, 0, 19 }, { Weighting::Wf, -10, -3 }, { Weighting::Wh, 9, 30 }, + { Weighting::KB, 0, 19 }, + }; + for (double fs : { 11025.0, 12000.0 }) // decimated rates for 44.1 / 48 / 96 kHz + for (const auto& r : ranges) + { + WeightingFilter filter; + filter.prepare (r.w, fs); + for (int band = r.bandLo - 6; band <= r.bandHi + 6; ++band) + { + const double f = exactFreq (band); + const double ref = dB (analogMagnitude (r.w, f)); + const double dig = dB (filter.magnitude (f)); + INFO (nameOf (r.w) << " at " << f << " Hz, fs " << fs << ", analog " << ref + << " dB, digital " << dig << " dB"); + if (band >= r.bandLo && band <= r.bandHi) + { + CHECK (dig == Approx (ref).margin (band == r.bandHi ? 0.2 : 0.1)); + } + else + { + CHECK (dig <= ref + 1.0); + if (ref > -40.0) + CHECK (dig >= ref - 1.0); + } + } + } +} + +TEST_CASE ("Vibration weightings: KB and band-limit", "[vibration][weighting]") +{ + // KB: first-order high-pass at 5.6 Hz → -3 dB at 5.6 Hz (plus small band-limit effect) + CHECK (dB (analogMagnitude (Weighting::KB, 5.6)) == Approx (-3.01).margin (0.05)); + CHECK (dB (analogMagnitude (Weighting::KB, 20.0)) == Approx (-0.33).margin (0.05)); + + // Band-limit 10–1000 Hz (ISO 20816): -3 dB at both corners, flat in between + WeightingFilter bl; + bl.prepare (Weighting::BandLimit, 12000.0, 10.0, 1000.0); + CHECK (dB (bl.magnitude (10.0)) == Approx (-3.01).margin (0.05)); + CHECK (dB (bl.magnitude (1000.0)) == Approx (-3.01).margin (0.05)); + CHECK (dB (bl.magnitude (100.0)) == Approx (0.0).margin (0.01)); + + WeightingFilter none; + none.prepare (Weighting::None, 12000.0); + CHECK (none.magnitude (3.0) == Approx (1.0)); +} + +//============================================================================== +TEST_CASE ("Vibration decimator: rate selection, passband and ≥ 90 dB stopband", "[vibration][decimator]") +{ + Decimator d; + d.prepare (48000.0); CHECK (d.factor() == 4); CHECK (d.outputRate (48000.0) == 12000.0); + d.prepare (44100.0); CHECK (d.factor() == 4); CHECK (d.outputRate (44100.0) == 11025.0); + d.prepare (96000.0); CHECK (d.factor() == 8); + d.prepare (192000.0); CHECK (d.factor() == 16); + d.prepare (8000.0); CHECK (d.factor() == 1); + + const HalfBandStage stage; + double worstPass = 0.0, worstStop = -1000.0; + for (double fn = 0.0; fn <= 0.2; fn += 0.002) worstPass = std::max (worstPass, std::fabs (dB (stage.magnitude (fn)))); + for (double fn = 0.3; fn <= 0.5; fn += 0.001) worstStop = std::max (worstStop, dB (stage.magnitude (fn))); + INFO ("passband ripple " << worstPass << " dB, stopband " << worstStop << " dB"); + CHECK (worstPass < 0.01); + CHECK (worstStop < -90.0); +} + +TEST_CASE ("Vibration decimator: passes in-band tones, rejects aliases", "[vibration][decimator]") +{ + const double fs = 48000.0; + auto rmsAfter = [&] (double f) + { + Decimator d; + d.prepare (fs); + return sineRms ([&] (double x, double& y) { return d.push (x, y); }, f, fs, 1.0, 0.05, 0.5); + }; + CHECK (dB (rmsAfter (1000.0) * std::sqrt (2.0)) == Approx (0.0).margin (0.01)); + CHECK (dB (rmsAfter (4000.0) * std::sqrt (2.0)) == Approx (0.0).margin (0.01)); + CHECK (dB (rmsAfter (20000.0) * std::sqrt (2.0)) < -90.0); // would alias to 4 kHz + CHECK (dB (rmsAfter (8000.0) * std::sqrt (2.0)) < -90.0); // would alias to 4 kHz in stage 2 +} + +//============================================================================== +TEST_CASE ("Vibration calibration: calibrator and datasheet methods", "[vibration][calibration]") +{ + // A 10 m/s² RMS calibrator reading −20 dBFS RMS → 160 dB; one FS unit = 100 m/s² + const double rmsFS = std::pow (10.0, -20.0 / 20.0); + const double calDb = calibration::calDbFromCalibrator (rmsFS); + CHECK (calDb == Approx (160.0)); + CHECK (calibration::scale (calDb) * rmsFS == Approx (10.0)); + CHECK (calibration::levelDb (10.0) == Approx (140.0)); + + // Datasheet: 100 mV/g sensor, interface +4 dBu at 0 dBFS + const double S = calibration::mVperMs2FromMVperG (100.0); // 10.197 mV/(m/s²) + const double Vfs = calibration::dBuToVrms (4.0); // 1.228 Vrms + const double cal = calibration::calDbFromDatasheet (Vfs, S); + // A full-scale sine (RMS 1/√2 FS) must read V_FS,rms / S m/s² RMS + CHECK (calibration::scale (cal) / std::sqrt (2.0) == Approx (Vfs * 1000.0 / S).epsilon (1e-9)); + CHECK (cal == Approx (120.0 + 20.0 * std::log10 (std::sqrt (2.0) * Vfs * 1000.0 / S))); +} + +//============================================================================== +TEST_CASE ("Vibration chain: integration to velocity and displacement", "[vibration][chain]") +{ + const double fs = 48000.0; + const double a = 1.0; // m/s² peak + for (double f : { 5.0, 10.0, 50.0, 200.0, 1000.0 }) + { + for (auto q : { Quantity::Velocity, Quantity::Displacement }) + { + AccelChannelConfig cfg; + cfg.calDb = 120.0; // 1 FS unit = 1 m/s² + cfg.highPassHz = 1.0; // f ≥ 5 × corner + cfg.quantity = q; + AccelChannel ch; + ch.prepare (fs, cfg); + + const double rms = sineRms ([&] (double x, double& y) + { double full; return ch.process ((float) x, full, y); }, + f, fs, a, 3.0, 2.0); + const double w = 2.0 * kPi * f; + const double expected = (q == Quantity::Velocity ? a / w : a / (w * w)) / std::sqrt (2.0); + INFO ((q == Quantity::Velocity ? "velocity" : "displacement") << " at " << f << " Hz"); + CHECK (rms == Approx (expected).epsilon (0.005)); + } + } +} + +TEST_CASE ("Vibration chain: calibrated, weighted acceleration end to end", "[vibration][chain]") +{ + const double fs = 48000.0; + + // −20 dBFS sine on a channel calibrated with a 10 m/s² calibrator at −20 dBFS + AccelChannelConfig cfg; + cfg.calDb = calibration::calDbFromCalibrator (std::pow (10.0, -20.0 / 20.0)); + cfg.highPassHz = 0.1; + cfg.weighting = Weighting::Wk; + AccelChannel ch; + ch.prepare (fs, cfg); + CHECK (ch.decimatedRate() == 12000.0); + + const double amp = std::pow (10.0, -20.0 / 20.0) * std::sqrt (2.0); // −20 dBFS RMS + for (double f : { 2.0, 8.0, 31.5 }) + { + ch.reset(); + double fullSum = 0.0; int fullCount = 0; + const double rms = sineRms ([&] (double x, double& y) + { + double full; + const bool produced = ch.process ((float) x, full, y); + fullSum += full * full; ++fullCount; + return produced; + }, + f, fs, amp, 8.0, 4.0); + INFO ("Wk at " << f << " Hz"); + // full-rate acceleration (incl. settling) ≈ 10 m/s² RMS + CHECK (std::sqrt (fullSum / fullCount) == Approx (10.0).epsilon (0.01)); + CHECK (dB (rms / 10.0) == Approx (dB (analogMagnitude (Weighting::Wk, f))).margin (0.1)); + } +} diff --git a/docs/VIBRATION_SPEC.md b/docs/VIBRATION_SPEC.md index 0aa2045..45cc154 100644 --- a/docs/VIBRATION_SPEC.md +++ b/docs/VIBRATION_SPEC.md @@ -82,8 +82,8 @@ Calibration works like `calOffset`: a per-channel dB offset that maps dBFS to ** Two methods are available, per axis, in a calibration dialog: 1. **Handheld calibrator** (preferred): the user mounts the sensor on a calibrator and selects the reference (default **10 m/s² RMS at 159.2 Hz = 140 dB**; also 1 g = 9.80665 m/s² and a custom value). SPLMeter measures for 3 s with a narrow bandpass around the reference frequency and sets `calDb`. It rejects the measurement if the frequency deviates by more than ±5 % or the level fluctuates by more than ±0.2 dB. -2. **Datasheet**: sensitivity *S* in mV/(m/s²) or mV/g, plus the interface's full-scale input voltage *V_FS* (Vrms or dBu at 0 dBFS). - `calDb = 120 + 20·log10(V_FS / S)` with *V_FS* in mV and *S* in mV/(m/s²). +2. **Datasheet**: sensitivity *S* in mV/(m/s²) or mV/g, plus the interface's full-scale input voltage *V_FS* (Vrms of a full-scale sine, or dBu at 0 dBFS). + `calDb = 120 + 20·log10(√2 · V_FS / S)` with *V_FS* in mV RMS and *S* in mV/(m/s²). The √2 is there because sample value 1.0 is the *peak* of a full-scale sine (implemented in `Source/Vibration/Calibration.h`). The calibration range is wider than `calOffset` (80–180): **60–220 dB**. @@ -94,12 +94,13 @@ The calibration range is wider than `calOffset` (80–180): **60–220 dB**. ``` raw (FS) ─► ×cal (m/s²) ─► HP (Butterworth, 2nd order, highPassHz) ├─► full-rate path: FFT buffer, structure-borne detectors, WAV recording - └─► decimate ÷D ─► quantity (a / v = ∫a / d = ∬a) ─► weighting ─► detectors + └─► quantity (a / v = ∫a / d = ∬a) ─► decimate ÷D ─► weighting ─► detectors ``` - **Precision**: all IIR filters in the vibration path use `double` biquads (TDF-II). Poles at 0.4 Hz are very close to z = 1 at 48 kHz. -- **Decimation**: the low-frequency path runs at `fs_d = fs / D`, where D is the largest power of two that keeps `fs_d ≥ 8 kHz` (44.1 kHz → D = 4, 11.025 kHz; 48 kHz → D = 4, 12 kHz; 96 kHz → D = 8, 12 kHz). 8 kHz is the lowest rate NI supports for Wh (upper band limit 1250 Hz); the whole-body weightings are supported from 1 kHz upward, so one shared decimated rate covers all weightings. A cascade of half-band FIR decimators with ≥ 90 dB stopband rejection is used. Structure-borne profiles use the full-rate path. -- **Integration**: trapezoidal (bilinear) integrator `H(s) = 1/s`, always cascaded after the HP, so the overall response is stable. Displacement uses two integrators, and the second gets its own HP at the same corner frequency. +- **Implementation**: header-only classes in `Source/Vibration/` (`Biquad.h`, `Weighting.h`, `Decimator.h`, `Calibration.h`, `AccelChannel.h`), no JUCE dependency, unit-tested in `Tests/VibrationDspTests.cpp`. +- **Decimation**: the low-frequency path runs at `fs_d = fs / D`, where D is the largest power of two that keeps `fs_d ≥ 8 kHz` (44.1 kHz → D = 4, 11.025 kHz; 48 kHz → D = 4, 12 kHz; 96 kHz → D = 8, 12 kHz). 8 kHz is the lowest rate NI supports for Wh (upper band limit 1250 Hz); the whole-body weightings are supported from 1 kHz upward, so one shared decimated rate covers all weightings. A cascade of half-band FIR decimators (75 taps, Kaiser β = 9: passband ripple 0.0002 dB up to 0.2·fs_in, stopband −92 dB from 0.3·fs_in) is used. Structure-borne profiles use the full-rate path. +- **Integration**: each integrator is the section `s / (s² + ω_c/Q·s + ω_c²)` at the HP corner (Q = 1/√2), mapped bilinearly: it equals `1/s` above the corner but has no pole at DC, so offsets cannot make it drift. Displacement uses two of them. Integration runs at the **full** rate (0.14 % error at 1 kHz; at 12 kHz it would be 2.3 %), before the decimator. ### 5.2 Frequency weightings (ISO 8041-1) @@ -132,7 +133,9 @@ Additionally: - **Band-limit only**: Butterworth HP/LP with user-defined corners (e.g. 10–1000 Hz for ISO 20816). - **None**: unweighted, full band. -Unit tests check each weighting at the nominal 1/3-octave frequencies (0.02 Hz – 4 kHz) against the reference dB table in [V]. The table is computed from the analog transfer functions, which is exactly what our digital filter must reproduce. Tolerance: ±0.1 dB inside the passband. +Unit tests (`Tests/VibrationDspTests.cpp`): +- **Parameters vs. reference table [V]** (~300 values): ≤ 0.02 dB for all weightings except Wb (≤ 0.06 dB, systematic ~0.05 dB deviation, single source). Note: [V] evaluates Wm and Wh at exact 1/3-octave frequencies (10^(n/10)) and the others at nominal frequencies. +- **Digital vs. analog** at fs_d = 11.025 and 12 kHz, within each weighting's nominal range (Wk/Wd/Wc/We/Wj/Wb 0.5–80 Hz, Wm/KB 1–80 Hz, Wf 0.1–0.5 Hz, Wh 8–1000 Hz): ±0.1 dB (±0.2 dB in the top band). Two octaves outside: never more than 1 dB less attenuation than analog. ### 5.3 Detectors (per axis and for the vector sum) From da37f545f5d7b78c89056a1424c5e3bc3badbb88 Mon Sep 17 00:00:00 2001 From: Philipp Paul Klose Date: Thu, 12 Nov 2026 17:57:24 +0100 Subject: [PATCH 10/30] Vibration step 4: accelerometer engine + detectors in the processor - VibrationEngine (JUCE-free): 1-3 axes (X/Y/Z or uniaxial), AccelChannel per axis, detectors per axis: running RMS (tau), interval peak, peak max-hold, peak-to-peak; vector sum with k-factors (RMS from k-weighted mean squares, peaks from sample-wise magnitude) - VibrationSnapshot published every 125 ms through a seqlock - Real-time-safe engine hand-over: built on the message thread, swapped in by the audio thread at block start, old engine freed on the next rebuild (audio thread never allocates or frees) - Settings in UIState/Accel (HP, quantity, weighting per axis, band, tau, k), calibration per input in UIState/Inputs (cal) - Pause / DAW sync hold the detectors; resetSessionPeak() also resets vibration statistics - No accelerometer: empty engine, SPL path bit-identical (--exact) - Tests: triax RMS/peak/p2p/Sigma, k-factors, calibrator calDb, velocity, Wd/Wk, runtime role changes, invalid config, missing inputs, pause/reset, persistence, CPU budget (0.38 % of one core for a weighted triax at 48 kHz) Co-Authored-By: Claude Opus 5.5 --- CMakeLists.txt | 1 + Source/PluginProcessor.cpp | 144 ++++++++++++- Source/PluginProcessor.h | 38 +++- Source/Vibration/Detectors.h | 133 ++++++++++++ Source/Vibration/VibrationEngine.h | 150 ++++++++++++++ Tests/VibrationProcessorTests.cpp | 316 +++++++++++++++++++++++++++++ 6 files changed, 780 insertions(+), 2 deletions(-) create mode 100644 Source/Vibration/Detectors.h create mode 100644 Source/Vibration/VibrationEngine.h create mode 100644 Tests/VibrationProcessorTests.cpp diff --git a/CMakeLists.txt b/CMakeLists.txt index 68025a7..36b83e7 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -342,6 +342,7 @@ if(SPLMETER_BUILD_TESTS) Tests/ProcessorRegressionTests.cpp Tests/SensorRoleTests.cpp Tests/FftSourceTests.cpp + Tests/VibrationProcessorTests.cpp ) target_link_libraries(SPLMeterProcessorTests PRIVATE SPLMeter diff --git a/Source/PluginProcessor.cpp b/Source/PluginProcessor.cpp index bb98e81..24db6eb 100644 --- a/Source/PluginProcessor.cpp +++ b/Source/PluginProcessor.cpp @@ -185,7 +185,12 @@ SPLMeterAudioProcessor::SPLMeterAudioProcessor() formatManager.registerBasicFormats(); } -SPLMeterAudioProcessor::~SPLMeterAudioProcessor() {} +SPLMeterAudioProcessor::~SPLMeterAudioProcessor() +{ + delete vibPending_.exchange (nullptr); + delete vibRetired_.exchange (nullptr); + delete vibActive_; +} //============================================================================== void SPLMeterAudioProcessor::prepareToPlay (double sampleRate, int samplesPerBlock) @@ -258,6 +263,15 @@ void SPLMeterAudioProcessor::prepareToPlay (double sampleRate, int samplesPerBlo } } + // Accelerometer engine for the new sample rate. The audio thread is stopped here, + // so the active engine can be replaced directly. + delete vibPending_.exchange (nullptr); + delete vibRetired_.exchange (nullptr); + delete vibActive_; + vibActive_ = buildVibrationEngine().release(); + vibWork_ = {}; + vibSnapshot_.write (vibWork_); + nonMicScratch_.setSize (juce::jmax (1, juce::jmin (getTotalNumInputChannels(), SensorConfig::kMaxInputs)), samplesPerBlock, false, true, false); } @@ -359,6 +373,34 @@ void SPLMeterAudioProcessor::processBlock (juce::AudioBuffer& buffer, // --- File mode: pull audio from transport instead of live input --- const bool fileMode = fileModeActive.load(); + + // --- Accelerometer: take over a newly built engine, then feed the live inputs --- + // (before bandpass/correction, which never touch accelerometer inputs anyway; + // file playback gets role-aware analysis with multichannel recording, spec §7.5) + if (vibPending_.load (std::memory_order_acquire) != nullptr + && vibRetired_.load (std::memory_order_acquire) == nullptr) + { + if (auto* next = vibPending_.exchange (nullptr, std::memory_order_acq_rel)) + { + vibRetired_.store (vibActive_, std::memory_order_release); + vibActive_ = next; + vibWork_ = {}; + vibSnapshot_.write (vibWork_); // invalid until the new engine publishes + } + } + if (vibActive_ != nullptr && vibActive_->hasAxes() && ! fileMode) + { + if (vibResetRequest_.exchange (false, std::memory_order_acq_rel)) + vibActive_->requestReset(); + const float* axisIn[3]; + for (int a = 0; a < 3; ++a) + { + const int ch = vibActive_->inputChannel (a); + axisIn[a] = (ch >= 0 && ch < numChannels) ? buffer.getReadPointer (ch) : nullptr; + } + if (vibActive_->process (axisIn, numSamples, ! skipMetering, vibWork_)) + vibSnapshot_.write (vibWork_); + } if (fileMode) { fileReadBuffer.setSize (2, numSamples, false, true, true); @@ -784,6 +826,7 @@ void SPLMeterAudioProcessor::restoreStateXml (const juce::XmlElement& xml) channelNames_[i] = xml.getStringAttribute ("channelName_" + juce::String (i), ""); apvts.replaceState (juce::ValueTree::fromXml (xml)); loadChannelRolesFromState(); + rebuildVibrationEngine(); // ≤ 3.5.2 sessions have no fftSource: derive it from the legacy Dual FFT flag { @@ -877,6 +920,105 @@ void SPLMeterAudioProcessor::setChannelRole (int ch, SensorRole role) const juce::Identifier key ("role" + juce::String (ch)); if (role == SensorRole::Mic) inputs.removeProperty (key, nullptr); else inputs.setProperty (key, (int) role, nullptr); + + rebuildVibrationEngine(); +} + +//============================================================================== +// Accelerometer settings and engine +namespace +{ + const juce::Identifier kAccelNode ("Accel"); + const char* const kWeightingKeys[3] = { "weightingX", "weightingY", "weightingZ" }; + const char* const kKKeys[3] = { "kx", "ky", "kz" }; +} + +vib::VibrationSettings SPLMeterAudioProcessor::getVibrationSettings() const +{ + vib::VibrationSettings s; + const auto node = apvts.state.getChildWithName ("UIState").getChildWithName (kAccelNode); + if (! node.isValid()) + return s; + s.highPassHz = juce::jlimit (0.05, 50.0, (double) node.getProperty ("highPassHz", s.highPassHz)); + s.quantity = static_cast (juce::jlimit (0, 2, (int) node.getProperty ("quantity", 0))); + for (int a = 0; a < 3; ++a) + { + s.weighting[a] = static_cast (juce::jlimit (0, (int) vib::Weighting::KB, + (int) node.getProperty (kWeightingKeys[a], 0))); + s.k[a] = juce::jlimit (0.0, 5.0, (double) node.getProperty (kKKeys[a], 1.0)); + } + s.bandLowHz = juce::jlimit (0.1, 1000.0, (double) node.getProperty ("bandLowHz", s.bandLowHz)); + s.bandHighHz = juce::jlimit (1.0, 20000.0, (double) node.getProperty ("bandHighHz", s.bandHighHz)); + s.tauSec = juce::jlimit (0.01, 10.0, (double) node.getProperty ("tauSec", s.tauSec)); + return s; +} + +void SPLMeterAudioProcessor::setVibrationSettings (const vib::VibrationSettings& s) +{ + auto node = getUiState().getOrCreateChildWithName (kAccelNode, nullptr); + node.setProperty ("highPassHz", s.highPassHz, nullptr); + node.setProperty ("quantity", (int) s.quantity, nullptr); + for (int a = 0; a < 3; ++a) + { + node.setProperty (kWeightingKeys[a], (int) s.weighting[a], nullptr); + node.setProperty (kKKeys[a], s.k[a], nullptr); + } + node.setProperty ("bandLowHz", s.bandLowHz, nullptr); + node.setProperty ("bandHighHz", s.bandHighHz, nullptr); + node.setProperty ("tauSec", s.tauSec, nullptr); + rebuildVibrationEngine(); +} + +double SPLMeterAudioProcessor::getAccelCalDb (int ch) const +{ + const auto inputs = apvts.state.getChildWithName ("UIState").getChildWithName ("Inputs"); + const double v = inputs.isValid() ? (double) inputs.getProperty ("cal" + juce::String (ch), 140.0) : 140.0; + return juce::jlimit (vib::calibration::kMinCalDb, vib::calibration::kMaxCalDb, v); +} + +void SPLMeterAudioProcessor::setAccelCalDb (int ch, double calDb) +{ + if (ch < 0 || ch >= SensorConfig::kMaxInputs) + return; + getUiState().getOrCreateChildWithName ("Inputs", nullptr) + .setProperty ("cal" + juce::String (ch), + juce::jlimit (vib::calibration::kMinCalDb, vib::calibration::kMaxCalDb, calDb), nullptr); + rebuildVibrationEngine(); +} + +std::unique_ptr SPLMeterAudioProcessor::buildVibrationEngine() const +{ + vib::AxisInput axes[3]; + bool uniaxial = false; + const auto roles = getChannelRoles(); + const int numInputs = juce::jmin (getTotalNumInputChannels(), SensorConfig::kMaxInputs); + + if (SensorConfig::isValid (SensorConfig::validate (roles, numInputs))) + { + for (int ch = 0; ch < numInputs; ++ch) + { + int axis = -1; + switch (roles[(size_t) ch]) + { + case SensorRole::AccelX: axis = vib::AxisX; break; + case SensorRole::AccelY: axis = vib::AxisY; break; + case SensorRole::AccelZ: axis = vib::AxisZ; break; + case SensorRole::AccelUniaxial: axis = vib::AxisX; uniaxial = true; break; + case SensorRole::Mic: + case SensorRole::Off: break; + } + if (axis >= 0) + axes[axis] = { ch, getAccelCalDb (ch) }; + } + } + // Without a (valid) accelerometer this is an empty engine: hasAxes() == false + return std::make_unique (currentSampleRate, getVibrationSettings(), axes, uniaxial); +} + +void SPLMeterAudioProcessor::rebuildVibrationEngine() +{ + delete vibRetired_.exchange (nullptr, std::memory_order_acq_rel); // no longer used by the audio thread + delete vibPending_.exchange (buildVibrationEngine().release(), std::memory_order_acq_rel); } SensorConfig::Roles SPLMeterAudioProcessor::getChannelRoles() const noexcept diff --git a/Source/PluginProcessor.h b/Source/PluginProcessor.h index 4e22c11..508af45 100644 --- a/Source/PluginProcessor.h +++ b/Source/PluginProcessor.h @@ -9,6 +9,7 @@ #include "TonalityEstimator.h" #include "SoundDetective.h" #include "SensorConfig.h" +#include "Vibration/VibrationEngine.h" #include #include #include @@ -189,7 +190,11 @@ class SPLMeterAudioProcessor : public juce::AudioProcessor // DIN 15905-5: session-long C-weighted peak (does not decay with peakHoldTime) float getSessionPeakDBCSPL () const noexcept { return sessionPeakDBCSPL_.load (std::memory_order_relaxed); } - void resetSessionPeak () noexcept { sessionPeakDBCSPL_.store (-999.0f, std::memory_order_relaxed); } + void resetSessionPeak () noexcept + { + sessionPeakDBCSPL_.store (-999.0f, std::memory_order_relaxed); + resetVibrationStats(); // session statistics reset together (spec §5.3) + } // NIOSH REL: cumulative 8-hour noise-dose percentage (100% = 85 dB(A) for 8 h, // 3 dB exchange rate, 80 dB(A) threshold). @@ -296,6 +301,23 @@ class SPLMeterAudioProcessor : public juce::AudioProcessor return SensorConfig::validate (getChannelRoles(), getTotalNumInputChannels()); } + //========================================================================== + // Accelerometer (vibration spec §3–§5). Settings persist in UIState/Accel, + // per-input calibration in UIState/Inputs ("cal"). Message thread only. + vib::VibrationSettings getVibrationSettings() const; + void setVibrationSettings (const vib::VibrationSettings& settings); + double getAccelCalDb (int ch) const; + void setAccelCalDb (int ch, double calDb); + + // Latest readout (published every 125 ms); valid == false without accelerometer + vib::VibrationSnapshot getVibrationSnapshot() const noexcept + { + vib::VibrationSnapshot s; + if (! vibSnapshot_.read (s)) s.valid = false; + return s; + } + void resetVibrationStats() noexcept { vibResetRequest_.store (true, std::memory_order_release); } + //========================================================================== juce::AudioProcessorValueTreeState apvts; @@ -310,6 +332,20 @@ class SPLMeterAudioProcessor : public juce::AudioProcessor std::array, SensorConfig::kMaxInputs> channelRoles_ {}; void loadChannelRolesFromState(); + // Accelerometer engine hand-over (real-time safe): the message thread builds a + // complete engine and puts it in vibPending_; the audio thread swaps it in at the + // start of a block and parks the previous one in vibRetired_, which the message + // thread deletes on its next rebuild (or in the destructor). The audio thread only + // swaps when vibRetired_ is empty, so it never allocates or frees. + std::unique_ptr buildVibrationEngine() const; + void rebuildVibrationEngine(); + std::atomic vibPending_ { nullptr }; + std::atomic vibRetired_ { nullptr }; + vib::VibrationEngine* vibActive_ = nullptr; // audio thread + std::atomic vibResetRequest_ { false }; + vib::SeqLock vibSnapshot_; + vib::VibrationSnapshot vibWork_; // audio thread + // Accelerometer channels are restored from here after the correction // convolution, which processes all channels at once (allocated in prepareToPlay) juce::AudioBuffer nonMicScratch_; diff --git a/Source/Vibration/Detectors.h b/Source/Vibration/Detectors.h new file mode 100644 index 0000000..c5af80b --- /dev/null +++ b/Source/Vibration/Detectors.h @@ -0,0 +1,133 @@ +#pragma once +#include +#include +#include +#include + +namespace vib +{ +//============================================================================== +// Axis slots of the vibration readout. A uniaxial sensor uses slot X. +enum Axis : int { AxisX = 0, AxisY = 1, AxisZ = 2, AxisSum = 3, kNumAxisSlots = 4 }; + +struct AxisValues +{ + float rms = 0.0f; // running RMS (exponential, time constant τ) + float peak = 0.0f; // max |x| in the last snapshot interval + float peakMax = 0.0f; // max |x| since the last reset + float p2p = 0.0f; // peak-to-peak in the last snapshot interval +}; + +// Published every snapshot interval (125 ms). Units follow the quantity: +// acceleration m/s², velocity m/s, displacement m. +struct VibrationSnapshot +{ + bool valid = false; // an accelerometer is configured and running + bool uniaxial = false; + int axisMask = 0; // bit per present slot (X/Y/Z); Σ present if > 1 axis + int quantity = 0; // vib::Quantity + int weighting[3] {}; // vib::Weighting per X/Y/Z + double seconds = 0.0; // metered time since the last reset + AxisValues axis[kNumAxisSlots]; +}; +static_assert (std::is_trivially_copyable_v); + +//============================================================================== +// Single-writer seqlock for trivially copyable data (audio thread writes, +// GUI thread reads; neither blocks). +template +class SeqLock +{ +public: + void write (const T& v) noexcept + { + const unsigned s = seq_.load (std::memory_order_relaxed); + seq_.store (s + 1, std::memory_order_relaxed); // odd: write in progress + std::atomic_thread_fence (std::memory_order_release); + copy (data_, v); + std::atomic_thread_fence (std::memory_order_release); + seq_.store (s + 2, std::memory_order_release); + } + + // Returns false only if the writer kept interfering (practically never) + bool read (T& out) const noexcept + { + for (int attempt = 0; attempt < 64; ++attempt) + { + const unsigned s1 = seq_.load (std::memory_order_acquire); + if (s1 & 1u) continue; + copy (out, data_); + std::atomic_thread_fence (std::memory_order_acquire); + if (seq_.load (std::memory_order_relaxed) == s1) + return true; + } + return false; + } + +private: + // Volatile byte copy: the compiler may not cache or reorder it across the fences + static void copy (T& dst, const T& src) noexcept + { + auto* d = reinterpret_cast (&dst); + auto* s = reinterpret_cast (&src); + for (size_t i = 0; i < sizeof (T); ++i) d[i] = s[i]; + } + + T data_ {}; + std::atomic seq_ { 0 }; +}; + +//============================================================================== +// Detectors of one axis (or of the vector sum), fed with decimated samples. +class AxisDetector +{ +public: + void prepare (double fs, double tauSec) noexcept + { + alpha_ = 1.0 - std::exp (-1.0 / (std::max (1.0e-3, tauSec) * fs)); + reset(); + } + + void reset() noexcept + { + meanSquare_ = 0.0; + peakMax_ = 0.0; + startInterval(); + } + + // x: signed sample (axes); for the vector sum pass the instantaneous magnitude + void process (double x) noexcept + { + meanSquare_ += alpha_ * (x * x - meanSquare_); + const double a = std::fabs (x); + peak_ = std::max (peak_, a); + peakMax_ = std::max (peakMax_, a); + min_ = std::min (min_, x); + max_ = std::max (max_, x); + } + + // Running mean square — the vector sum combines these + double meanSquare() const noexcept { return meanSquare_; } + + AxisValues values() const noexcept + { + AxisValues v; + v.rms = (float) std::sqrt (meanSquare_); + v.peak = (float) peak_; + v.peakMax = (float) peakMax_; + v.p2p = (max_ >= min_) ? (float) (max_ - min_) : 0.0f; + return v; + } + + void startInterval() noexcept + { + peak_ = 0.0; + min_ = 1.0e300; + max_ = -1.0e300; + } + +private: + double alpha_ = 0.0, meanSquare_ = 0.0; + double peak_ = 0.0, peakMax_ = 0.0, min_ = 1.0e300, max_ = -1.0e300; +}; +} // namespace vib diff --git a/Source/Vibration/VibrationEngine.h b/Source/Vibration/VibrationEngine.h new file mode 100644 index 0000000..d62d969 --- /dev/null +++ b/Source/Vibration/VibrationEngine.h @@ -0,0 +1,150 @@ +#pragma once +#include "AccelChannel.h" +#include "Detectors.h" + +namespace vib +{ +//============================================================================== +// Settings shared by all axes of the accelerometer sensor (spec §3.2). +// Persisted in UIState/Accel; per-input calibration lives in UIState/Inputs. +struct VibrationSettings +{ + double highPassHz = 1.0; + Quantity quantity = Quantity::Acceleration; + Weighting weighting[3] { Weighting::None, Weighting::None, Weighting::None }; // X, Y, Z (uniaxial: X) + double bandLowHz = 10.0; // Weighting::BandLimit + double bandHighHz = 1000.0; + double tauSec = 1.0; // running RMS time constant + double k[3] { 1.0, 1.0, 1.0 }; // vector-sum multiplying factors +}; + +// Which input feeds which axis (-1 = absent) and its calibration +struct AxisInput +{ + int inputChannel = -1; + double calDb = 140.0; +}; + +//============================================================================== +// One accelerometer sensor (1–3 axes): signal chain + detectors + vector sum. +// Built on the message thread, then handed to the audio thread as a whole. +class VibrationEngine +{ +public: + static constexpr double kSnapshotInterval = 0.125; // s, like the SPL log + + VibrationEngine (double fs, const VibrationSettings& settings, + const AxisInput (&axes)[3], bool uniaxial) + : settings_ (settings), uniaxial_ (uniaxial) + { + for (int a = 0; a < 3; ++a) + { + input_[a] = axes[a].inputChannel; + if (input_[a] < 0) continue; + + AccelChannelConfig cfg; + cfg.calDb = axes[a].calDb; + cfg.highPassHz = settings.highPassHz; + cfg.quantity = settings.quantity; + cfg.weighting = settings.weighting[a]; + cfg.bandLowHz = settings.bandLowHz; + cfg.bandHighHz = settings.bandHighHz; + channel_[a].prepare (fs, cfg); + fsd_ = channel_[a].decimatedRate(); + axisMask_ |= 1 << a; + ++numAxes_; + } + for (auto& d : detector_) + d.prepare (fsd_, settings.tauSec); + intervalSamples_ = std::max (1, (int) std::lround (kSnapshotInterval * fsd_)); + } + + int inputChannel (int axis) const noexcept { return input_[axis]; } + bool hasAxes() const noexcept { return numAxes_ > 0; } + + void requestReset() noexcept { resetPending_ = true; } + + // in[axis] = input samples for that axis (nullptr if absent). When metering is + // false (pause / DAW stopped) the filters keep running but detectors hold. + // Returns true when a new snapshot was written to out. + bool process (const float* const in[3], int numSamples, bool metering, VibrationSnapshot& out) noexcept + { + if (resetPending_) + { + for (auto& d : detector_) d.reset(); + meteredSamples_ = 0; + resetPending_ = false; + } + + bool published = false; + for (int s = 0; s < numSamples; ++s) + { + double decimated[3] = { 0.0, 0.0, 0.0 }; + bool produced = false; + for (int a = 0; a < 3; ++a) + { + if (input_[a] < 0) continue; + double full; + // All axes share the decimator phase, so they produce samples together + produced = channel_[a].process (in[a] != nullptr ? in[a][s] : 0.0f, full, decimated[a]); + } + if (! produced || ! metering) + continue; + + double sumSq = 0.0; + for (int a = 0; a < 3; ++a) + { + if (input_[a] < 0) continue; + detector_[a].process (decimated[a]); + const double kx = settings_.k[a] * decimated[a]; + sumSq += kx * kx; + } + detector_[AxisSum].process (std::sqrt (sumSq)); + ++meteredSamples_; + + if (++intervalCount_ >= intervalSamples_) + { + intervalCount_ = 0; + fillSnapshot (out); + for (auto& d : detector_) d.startInterval(); + published = true; + } + } + return published; + } + +private: + void fillSnapshot (VibrationSnapshot& out) const noexcept + { + out.valid = true; + out.uniaxial = uniaxial_; + out.axisMask = axisMask_; + out.quantity = static_cast (settings_.quantity); + out.seconds = meteredSamples_ / fsd_; + double sumMs = 0.0; + for (int a = 0; a < 3; ++a) + { + out.weighting[a] = static_cast (settings_.weighting[a]); + out.axis[a] = input_[a] >= 0 ? detector_[a].values() : AxisValues {}; + if (input_[a] >= 0) + sumMs += settings_.k[a] * settings_.k[a] * detector_[a].meanSquare(); + } + // Σ: RMS from the k-weighted axis mean squares (ISO 2631-1 a_v); peaks + // from the sample-wise vector magnitude + out.axis[AxisSum] = detector_[AxisSum].values(); + out.axis[AxisSum].rms = (float) std::sqrt (sumMs); + out.axis[AxisSum].p2p = 0.0f; // not defined for a magnitude + } + + VibrationSettings settings_; + bool uniaxial_ = false; + AccelChannel channel_[3]; + int input_[3] { -1, -1, -1 }; + AxisDetector detector_[kNumAxisSlots]; + int axisMask_ = 0, numAxes_ = 0; + double fsd_ = 12000.0; + int intervalSamples_ = 1500, intervalCount_ = 0; + long long meteredSamples_ = 0; + bool resetPending_ = false; +}; +} // namespace vib diff --git a/Tests/VibrationProcessorTests.cpp b/Tests/VibrationProcessorTests.cpp new file mode 100644 index 0000000..5f842e0 --- /dev/null +++ b/Tests/VibrationProcessorTests.cpp @@ -0,0 +1,316 @@ +#include +#include +#include "ProcessorTestHelpers.h" + +#include + +// Vibration spec step 4: accelerometer engine inside the processor — routing, +// calibration, detectors, vector sum, engine hand-over, pause/reset, persistence. + +using Catch::Approx; +using namespace ProcTest; + +namespace +{ +using SignalPerChannel = std::function; + +struct Rig +{ + std::unique_ptr proc; + int numInputs = 0; + int n = 0; // samples processed so far + + explicit Rig (int inputs) : numInputs (inputs) + { + proc = std::make_unique(); + auto layout = proc->getBusesLayout(); + layout.inputBuses.getReference (0) = juce::AudioChannelSet::discreteChannels (inputs); + REQUIRE (proc->setBusesLayout (layout)); + } + + void prepare() { proc->prepareToPlay (kSampleRate, kBlockSize); } + + void run (double seconds, const SignalPerChannel& signal) + { + juce::AudioBuffer buffer (juce::jmax (proc->getTotalNumInputChannels(), + proc->getTotalNumOutputChannels()), kBlockSize); + juce::MidiBuffer midi; + const int blocks = (int) (seconds * kSampleRate) / kBlockSize; + for (int b = 0; b < blocks; ++b, n += kBlockSize) + { + buffer.clear(); + for (int ch = 0; ch < numInputs; ++ch) + for (int s = 0; s < kBlockSize; ++s) + buffer.setSample (ch, s, signal (ch, n + s)); + proc->processBlock (buffer, midi); + } + } + + vib::VibrationSnapshot snap() const { return proc->getVibrationSnapshot(); } +}; + +// Unit calibration: 1 FS = 1 m/s² (calDb 120). τ = 0.125 s settles fast but ripples +// at low frequencies (±4 % RMS at 8 Hz) — low-frequency checks use τ = 1 s. +void configureTriax (SPLMeterAudioProcessor& p, int firstInput, vib::VibrationSettings s = {}, + double tauSec = 0.125) +{ + p.setChannelRole (firstInput, SensorRole::AccelX); + p.setChannelRole (firstInput + 1, SensorRole::AccelY); + p.setChannelRole (firstInput + 2, SensorRole::AccelZ); + for (int i = 0; i < 3; ++i) p.setAccelCalDb (firstInput + i, 120.0); + s.tauSec = tauSec; + p.setVibrationSettings (s); +} + +const double kRms = 1.0 / std::sqrt (2.0); +} // namespace + +TEST_CASE ("Vibration in processor: triaxial RMS, peak, peak-to-peak and vector sum", "[vibration][processor]") +{ + juce::ScopedJuceInitialiser_GUI juceInit; + + Rig rig (4); // mic on input 1, triax on inputs 2–4 + configureTriax (*rig.proc, 1); + rig.prepare(); + rig.run (3.0, [] (int ch, int n) + { + switch (ch) + { + case 0: return sine (1000.0, 0.1, n); // microphone + case 1: return sine (80.0, 1.0, n); // X: 1 m/s² peak + case 2: return sine (160.0, 2.0, n); // Y: 2 m/s² peak + default: return sine (40.0, 0.5, n); // Z: 0.5 m/s² peak + } + }); + + const auto s = rig.snap(); + REQUIRE (s.valid); + CHECK (s.axisMask == 0b111); + CHECK_FALSE (s.uniaxial); + CHECK (s.axis[vib::AxisX].rms == Approx (1.0 * kRms).epsilon (0.01)); + CHECK (s.axis[vib::AxisY].rms == Approx (2.0 * kRms).epsilon (0.01)); + CHECK (s.axis[vib::AxisZ].rms == Approx (0.5 * kRms).epsilon (0.01)); + CHECK (s.axis[vib::AxisX].peak == Approx (1.0).epsilon (0.01)); + CHECK (s.axis[vib::AxisX].p2p == Approx (2.0).epsilon (0.01)); + CHECK (s.axis[vib::AxisY].peakMax == Approx (2.0).epsilon (0.01)); + CHECK (s.axis[vib::AxisSum].rms == Approx (std::sqrt (0.5 + 2.0 + 0.125)).epsilon (0.01)); + CHECK (s.seconds == Approx (3.0).margin (0.15)); + + // The microphone path is unaffected: 0.1 peak sine = −23 dBFS → 104 dB at calOffset 127 + CHECK (rig.proc->getRMSSPL() == Approx (103.99).margin (0.05)); +} + +TEST_CASE ("Vibration in processor: k-factors weight the vector sum", "[vibration][processor]") +{ + juce::ScopedJuceInitialiser_GUI juceInit; + + vib::VibrationSettings settings; + settings.k[0] = settings.k[1] = 1.4; // ISO 2631-1 health, seated + Rig rig (3); + configureTriax (*rig.proc, 0, settings); + rig.prepare(); + rig.run (3.0, [] (int ch, int n) { return sine (20.0 + 30.0 * ch, 1.0, n); }); + + const auto s = rig.snap(); + REQUIRE (s.valid); + CHECK (s.axis[vib::AxisSum].rms == Approx (std::sqrt (1.96 * 0.5 + 1.96 * 0.5 + 0.5)).epsilon (0.01)); +} + +TEST_CASE ("Vibration in processor: calibration, integration and weighting", "[vibration][processor]") +{ + juce::ScopedJuceInitialiser_GUI juceInit; + + SECTION ("calibrator-derived calDb reads 10 m/s²") + { + Rig rig (1); + rig.proc->setChannelRole (0, SensorRole::AccelUniaxial); + rig.proc->setAccelCalDb (0, vib::calibration::calDbFromCalibrator (std::pow (10.0, -20.0 / 20.0))); + vib::VibrationSettings s; s.tauSec = 0.125; + rig.proc->setVibrationSettings (s); + rig.prepare(); + const double amp = std::pow (10.0, -20.0 / 20.0) * std::sqrt (2.0); // −20 dBFS RMS + rig.run (2.0, [amp] (int, int n) { return sine (159.2, amp, n); }); + + const auto snap = rig.snap(); + REQUIRE (snap.valid); + CHECK (snap.uniaxial); + CHECK (snap.axisMask == 0b001); + CHECK (snap.axis[vib::AxisX].rms == Approx (10.0).epsilon (0.01)); + CHECK (snap.axis[vib::AxisSum].rms == Approx (snap.axis[vib::AxisX].rms).epsilon (1e-6)); + } + + SECTION ("velocity") + { + vib::VibrationSettings s; + s.quantity = vib::Quantity::Velocity; + Rig rig (3); + configureTriax (*rig.proc, 0, s); + rig.prepare(); + rig.run (3.0, [] (int, int n) { return sine (50.0, 1.0, n); }); + const auto snap = rig.snap(); + REQUIRE (snap.valid); + CHECK (snap.quantity == (int) vib::Quantity::Velocity); + CHECK (snap.axis[vib::AxisZ].rms == Approx (1.0 / (2.0 * vib::kPi * 50.0) * kRms).epsilon (0.01)); + } + + SECTION ("Wd on X/Y, Wk on Z") + { + vib::VibrationSettings s; + s.highPassHz = 0.1; + s.weighting[0] = s.weighting[1] = vib::Weighting::Wd; + s.weighting[2] = vib::Weighting::Wk; + Rig rig (3); + configureTriax (*rig.proc, 0, s, 1.0); + rig.prepare(); + rig.run (10.0, [] (int, int n) { return sine (8.0, 1.0, n); }); + const auto snap = rig.snap(); + REQUIRE (snap.valid); + CHECK (snap.weighting[2] == (int) vib::Weighting::Wk); + const double dbX = 20.0 * std::log10 (snap.axis[vib::AxisX].rms / kRms); + const double dbZ = 20.0 * std::log10 (snap.axis[vib::AxisZ].rms / kRms); + CHECK (dbX == Approx (20.0 * std::log10 (vib::analogMagnitude (vib::Weighting::Wd, 8.0))).margin (0.15)); + CHECK (dbZ == Approx (20.0 * std::log10 (vib::analogMagnitude (vib::Weighting::Wk, 8.0))).margin (0.15)); + } +} + +TEST_CASE ("Vibration in processor: engine follows role changes at runtime", "[vibration][processor]") +{ + juce::ScopedJuceInitialiser_GUI juceInit; + + Rig rig (3); + rig.prepare(); + auto signal = [] (int ch, int n) { return sine (100.0, 0.5 + 0.25 * ch, n); }; + + rig.run (0.5, signal); + CHECK_FALSE (rig.snap().valid); // no accelerometer → no readout + + configureTriax (*rig.proc, 0); // while "running" + rig.run (1.5, signal); + auto s = rig.snap(); + REQUIRE (s.valid); + CHECK (s.axis[vib::AxisY].rms == Approx (0.75 * kRms).epsilon (0.02)); + + rig.proc->setChannelRole (1, SensorRole::AccelX); // duplicate X → invalid config + rig.run (0.5, signal); + CHECK_FALSE (rig.snap().valid); + + rig.proc->setChannelRole (1, SensorRole::AccelY); + rig.proc->setChannelRole (2, SensorRole::Mic); // biaxial X/Y is fine + rig.run (1.0, signal); + s = rig.snap(); + REQUIRE (s.valid); + CHECK (s.axisMask == 0b011); +} + +TEST_CASE ("Vibration in processor: inputs the device lacks are ignored", "[vibration][processor]") +{ + juce::ScopedJuceInitialiser_GUI juceInit; + + Rig rig (2); // e.g. a stereo DAW track + configureTriax (*rig.proc, 0); // Z would be input 3, which does not exist + rig.prepare(); + rig.run (1.0, [] (int, int n) { return sine (100.0, 1.0, n); }); + const auto s = rig.snap(); + REQUIRE (s.valid); + CHECK (s.axisMask == 0b011); +} + +TEST_CASE ("Vibration in processor: pause holds the detectors, session reset clears maxima", "[vibration][processor]") +{ + juce::ScopedJuceInitialiser_GUI juceInit; + + Rig rig (3); + configureTriax (*rig.proc, 0); + rig.prepare(); + // Reset only after settling: peakMax legitimately includes the high-pass + // start-up transient, and the filters still hold ~2 ms of earlier signal + rig.run (0.5, [] (int, int n) { return sine (100.0, 2.0, n); }); + rig.proc->resetSessionPeak(); + rig.run (1.0, [] (int, int n) { return sine (100.0, 2.0, n); }); + const auto before = rig.snap(); + REQUIRE (before.valid); + CHECK (before.axis[vib::AxisX].peakMax == Approx (2.0).epsilon (0.01)); + + rig.proc->setPaused (true); + rig.run (1.0, [] (int, int n) { return sine (100.0, 5.0, n); }); // ignored while paused + const auto paused = rig.snap(); + CHECK (paused.seconds == Approx (before.seconds)); + CHECK (paused.axis[vib::AxisX].peakMax == Approx (2.0).epsilon (0.01)); + rig.proc->setPaused (false); + + rig.run (1.0, [] (int, int n) { return sine (100.0, 0.5, n); }); // let the 1 Hz HP transient of the level jump decay + rig.proc->resetSessionPeak(); + rig.run (1.0, [] (int, int n) { return sine (100.0, 0.5, n); }); + const auto after = rig.snap(); + CHECK (after.axis[vib::AxisX].peakMax == Approx (0.5).epsilon (0.02)); + CHECK (after.seconds == Approx (1.0).margin (0.15)); +} + +TEST_CASE ("Vibration in processor: settings and calibration persist in the plugin state", "[vibration][processor][state]") +{ + juce::ScopedJuceInitialiser_GUI juceInit; + + auto proc = std::make_unique(); + vib::VibrationSettings s; + s.highPassHz = 0.4; + s.quantity = vib::Quantity::Displacement; + s.weighting[0] = vib::Weighting::Wd; + s.weighting[2] = vib::Weighting::Wk; + s.bandLowHz = 2.0; + s.bandHighHz = 500.0; + s.tauSec = 0.125; + s.k[0] = 1.4; s.k[1] = 1.4; s.k[2] = 1.0; + proc->setVibrationSettings (s); + proc->setChannelRole (2, SensorRole::AccelZ); + proc->setAccelCalDb (2, 153.25); + + juce::MemoryBlock blob; + proc->getStateInformation (blob); + auto restored = std::make_unique(); + restored->setStateInformation (blob.getData(), (int) blob.getSize()); + + const auto r = restored->getVibrationSettings(); + CHECK (r.highPassHz == Approx (0.4)); + CHECK (r.quantity == vib::Quantity::Displacement); + CHECK (r.weighting[0] == vib::Weighting::Wd); + CHECK (r.weighting[1] == vib::Weighting::None); + CHECK (r.weighting[2] == vib::Weighting::Wk); + CHECK (r.bandLowHz == Approx (2.0)); + CHECK (r.bandHighHz == Approx (500.0)); + CHECK (r.tauSec == Approx (0.125)); + CHECK (r.k[0] == Approx (1.4)); + CHECK (restored->getAccelCalDb (2) == Approx (153.25)); + CHECK (restored->getAccelCalDb (5) == Approx (140.0)); // default + CHECK (restored->getChannelRole (2) == SensorRole::AccelZ); +} + +TEST_CASE ("Vibration in processor: CPU budget", "[vibration][processor][performance]") +{ + juce::ScopedJuceInitialiser_GUI juceInit; + + auto timeFor = [] (bool withTriax) + { + Rig rig (4); + if (withTriax) + { + vib::VibrationSettings s; + s.quantity = vib::Quantity::Velocity; + s.weighting[0] = s.weighting[1] = vib::Weighting::Wd; + s.weighting[2] = vib::Weighting::Wk; + configureTriax (*rig.proc, 1, s); + } + rig.prepare(); + auto signal = [] (int ch, int n) { return sine (50.0 * (ch + 1), 0.3, n) + noise (ch, n, 0.05f); }; + rig.run (0.5, signal); // warm-up + const auto t0 = std::chrono::steady_clock::now(); + rig.run (10.0, signal); + return std::chrono::duration (std::chrono::steady_clock::now() - t0).count(); + }; + + const double micOnly = timeFor (false); + const double withVib = timeFor (true); + const double overheadPct = (withVib - micOnly) / 10.0 * 100.0; // % of one core in real time + WARN ("10 s of audio: mic only " << micOnly * 1000.0 << " ms, mic + triax " + << withVib * 1000.0 << " ms → vibration overhead " << overheadPct << " % of one core"); + CHECK (overheadPct < 5.0); +} From c1472698e136ba33c0b9b63157a7bf669f2dc7f5 Mon Sep 17 00:00:00 2001 From: Philipp Paul Klose Date: Thu, 12 Nov 2026 19:44:33 +0100 Subject: [PATCH 11/30] Vibration step 5: Inputs & Sensors window + accelerometer calibration MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Settings → "Inputs & Sensors…" opens a window with a role per input, live level meters, calibrated level, cal value, calibration date/method, and the accelerometer group (quantity, high-pass, RMS tau, weightings, band limits, k-factors, sensor serial, usable range) - Channel buttons in Settings show the role tag (X/Y/Z/ACC/OFF) - Calibration dialog: handheld calibrator (measured on the live input, frequency ±5 % and stability ±0.2 dB checks) or datasheet sensitivity - vib::CalibratorMeasurement: band-pass, interpolated zero-crossing frequency, gain-corrected RMS; lock-free hand-over to the audio thread - Processor: per-input RMS/peak meters, sensor info and cal date persist - Tests: calibrator measurement (DSP), processor hand-over, meters, persistence; SPL regression still bit-identical Co-Authored-By: Claude Opus 5.5 --- Source/InputsComponent.h | 1131 ++++++++++++++++++++++ Source/PluginProcessor.cpp | 117 +++ Source/PluginProcessor.h | 47 + Source/SettingsComponent.h | 38 +- Source/Vibration/CalibratorMeasurement.h | 141 +++ Tests/VibrationDspTests.cpp | 83 ++ Tests/VibrationProcessorTests.cpp | 80 ++ docs/VIBRATION_SPEC.md | 17 +- 8 files changed, 1647 insertions(+), 7 deletions(-) create mode 100644 Source/InputsComponent.h create mode 100644 Source/Vibration/CalibratorMeasurement.h diff --git a/Source/InputsComponent.h b/Source/InputsComponent.h new file mode 100644 index 0000000..53c5054 --- /dev/null +++ b/Source/InputsComponent.h @@ -0,0 +1,1131 @@ +#pragma once +#include +#include "PluginProcessor.h" +#include + +//============================================================================== +// "Inputs & Sensors" window (vibration spec §7.1): a role per input, live level, +// accelerometer calibration, and the accelerometer sensor settings. +namespace InputsUi +{ +// Source literals are UTF-8; juce::String (const char*) would read them as ASCII +inline juce::String U (const char* utf8) { return juce::String::fromUTF8 (utf8); } + +struct Palette +{ + juce::Colour bg, card, border, text, subtext, field, accent, ok, warn, bad; + + static Palette get (bool light) + { + if (light) + return { juce::Colour (0xffe5e5ea), juce::Colour (0xfff5f5f7), juce::Colour (0xffc7c7cc), + juce::Colour (0xff1c1c1e), juce::Colour (0xff6c6c70), juce::Colour (0xffd1d1d6), + juce::Colour (0xff007aff), juce::Colour (0xff248a3d), juce::Colour (0xffc93400), + juce::Colour (0xffd70015) }; + return { juce::Colour (0xff2c2c2e), juce::Colour (0xff333335), juce::Colour (0xff48484a), + juce::Colours::white, juce::Colour (0xff8e8e93), juce::Colour (0xff3a3a3c), + juce::Colour (0xff5ac8fa), juce::Colour (0xff34c759), juce::Colour (0xffff9f0a), + juce::Colour (0xffff453a) }; + } + + void style (juce::ComboBox& c) const + { + c.setColour (juce::ComboBox::backgroundColourId, field); + c.setColour (juce::ComboBox::textColourId, text); + c.setColour (juce::ComboBox::outlineColourId, border); + c.setColour (juce::ComboBox::arrowColourId, subtext); + } +}; + +inline juce::String roleName (SensorRole r) +{ + switch (r) + { + case SensorRole::Mic: return "Mic"; + case SensorRole::AccelX: return "Accel X"; + case SensorRole::AccelY: return "Accel Y"; + case SensorRole::AccelZ: return "Accel Z"; + case SensorRole::AccelUniaxial: return "Accel (uniaxial)"; + case SensorRole::Off: return "Off"; + } + return {}; +} + +// Short tag shown on the channel buttons in Settings +inline juce::String roleTag (SensorRole r) +{ + switch (r) + { + case SensorRole::AccelX: return "X"; + case SensorRole::AccelY: return "Y"; + case SensorRole::AccelZ: return "Z"; + case SensorRole::AccelUniaxial: return "ACC"; + case SensorRole::Off: return "OFF"; + case SensorRole::Mic: break; + } + return {}; +} + +inline juce::String weightingName (vib::Weighting w) +{ + switch (w) + { + case vib::Weighting::None: return "Unweighted"; + case vib::Weighting::BandLimit: return "Band limit"; + case vib::Weighting::Wb: return "Wb vertical, rail (ISO 2631-4)"; + case vib::Weighting::Wc: return "Wc seat back (ISO 2631-1)"; + case vib::Weighting::Wd: return "Wd whole body x/y (ISO 2631-1)"; + case vib::Weighting::We: return "We rotational (ISO 2631-1)"; + case vib::Weighting::Wf: return "Wf motion sickness (ISO 2631-1)"; + case vib::Weighting::Wh: return "Wh hand-arm (ISO 5349-1)"; + case vib::Weighting::Wj: return "Wj head, recumbent (ISO 2631-1)"; + case vib::Weighting::Wk: return "Wk whole body z (ISO 2631-1)"; + case vib::Weighting::Wm: return "Wm buildings (ISO 2631-2)"; + case vib::Weighting::KB: return "KB DIN 4150-2 (velocity)"; + } + return {}; +} + +inline juce::String formatAccel (double ms2) +{ + if (ms2 <= 0.0) return U ("0 m/s²"); + if (ms2 >= 100.0) return juce::String (ms2, 0) + U (" m/s²"); + if (ms2 >= 1.0) return juce::String (ms2, 2) + U (" m/s²"); + if (ms2 >= 0.01) return juce::String (ms2 * 1000.0, 1) + U (" mm/s²"); + return juce::String (ms2 * 1.0e6, 0) + U (" µm/s²"); +} + +inline juce::String formatDbfs (double rms) +{ + return rms > 1.0e-6 ? juce::String (20.0 * std::log10 (rms), 1) + " dBFS" : juce::String (U ("−∞ dBFS")); +} + +//============================================================================== +// Click-to-edit number with range and unit +class NumberField : public juce::Label +{ +public: + std::function onValueChange; + + NumberField (double minV, double maxV, int decimals, juce::String unit = {}) + : min_ (minV), max_ (maxV), decimals_ (decimals), unit_ (std::move (unit)) + { + setEditable (true, true, false); + setJustificationType (juce::Justification::centred); + onTextChange = [this] + { + const auto t = getText().retainCharacters ("0123456789.,-eE").replaceCharacter (',', '.'); + const double v = t.isNotEmpty() ? t.getDoubleValue() : value_; + setValue (juce::jlimit (min_, max_, v), juce::sendNotification); + }; + } + + void setValue (double v, juce::NotificationType n = juce::dontSendNotification) + { + const bool changed = std::abs (v - value_) > 1.0e-12; + value_ = v; + setText (juce::String (v, decimals_) + (unit_.isNotEmpty() ? " " + unit_ : juce::String()), + juce::dontSendNotification); + if (changed && n != juce::dontSendNotification && onValueChange) + onValueChange (v); + } + double getValue() const noexcept { return value_; } + + void style (const Palette& p) + { + setColour (juce::Label::backgroundColourId, p.field); + setColour (juce::Label::textColourId, p.text); + setColour (juce::Label::textWhenEditingColourId, p.text); + setColour (juce::TextEditor::backgroundColourId, p.field); + setColour (juce::TextEditor::textColourId, p.text); + setColour (juce::TextEditor::highlightColourId, p.accent.withAlpha (0.4f)); + } + +protected: + juce::TextEditor* createEditorComponent() override + { + auto* ed = juce::Label::createEditorComponent(); + ed->setText (juce::String (value_, decimals_), false); + ed->setJustification (juce::Justification::centred); + return ed; + } + +private: + double min_, max_; + int decimals_; + juce::String unit_; + double value_ = std::numeric_limits::quiet_NaN(); +}; + +//============================================================================== +// Horizontal level bar: RMS bar + decaying peak tick, −80 … 0 dBFS +class LevelBar : public juce::Component +{ +public: + void setLevels (float rms, float peak) + { + rms_ = rms; + peak_ = std::max (peak, peak_ * 0.85f); + repaint(); + } + void setPalette (const Palette& p) { pal_ = p; repaint(); } + + void paint (juce::Graphics& g) override + { + const auto b = getLocalBounds().toFloat().reduced (0.0f, 6.0f); + g.setColour (pal_.field); + g.fillRoundedRectangle (b, 3.0f); + + auto toX = [&] (float lin) + { + const float db = lin > 1.0e-6f ? 20.0f * std::log10 (lin) : -120.0f; + return b.getX() + b.getWidth() * juce::jlimit (0.0f, 1.0f, (db + 80.0f) / 80.0f); + }; + const float xr = toX (rms_); + const auto col = peak_ >= 0.99f ? pal_.bad : (peak_ >= 0.5f ? pal_.warn : pal_.ok); + g.setColour (col.withAlpha (0.85f)); + g.fillRoundedRectangle (b.withRight (xr), 3.0f); + if (peak_ > 1.0e-6f) + { + g.setColour (col); + const float xp = toX (peak_); + g.fillRect (juce::Rectangle (xp - 1.0f, b.getY(), 2.0f, b.getHeight())); + } + } + +private: + float rms_ = 0.0f, peak_ = 0.0f; + Palette pal_ = Palette::get (false); +}; + +//============================================================================== +// Calibration dialog for one accelerometer input (spec §4) +class CalibrationComponent : public juce::Component, + private juce::Timer +{ +public: + CalibrationComponent (SPLMeterAudioProcessor& p, int channel, bool light) + : processor_ (p), ch_ (channel), pal_ (Palette::get (light)) + { + auto setupLabel = [this] (juce::Label& l, const juce::String& text, bool sub = false) + { + l.setText (text, juce::dontSendNotification); + l.setFont (juce::Font (juce::FontOptions().withHeight (sub ? 12.5f : 14.0f))); + l.setColour (juce::Label::textColourId, sub ? pal_.subtext : pal_.text); + addAndMakeVisible (l); + }; + auto setupButton = [this] (juce::TextButton& b) + { + b.setColour (juce::TextButton::buttonColourId, pal_.field); + b.setColour (juce::TextButton::buttonOnColourId, pal_.accent); + b.setColour (juce::TextButton::textColourOffId, pal_.text); + b.setColour (juce::TextButton::textColourOnId, juce::Colours::black); + addAndMakeVisible (b); + }; + + setupLabel (titleLabel_, processor_.getChannelName (ch_) + U (" · ") + + roleName (processor_.getChannelRole (ch_))); + titleLabel_.setFont (juce::Font (juce::FontOptions().withHeight (16.0f).withStyle ("Bold"))); + setupLabel (currentLabel_, {}, true); + setupLabel (levelLabel_, {}, true); + + for (auto* b : { &calibratorTab_, &datasheetTab_ }) + { + setupButton (*b); + b->setClickingTogglesState (true); + b->setRadioGroupId (4711); + b->onClick = [this] { updateMode(); }; + } + calibratorTab_.setToggleState (true, juce::dontSendNotification); + + // --- Calibrator --- + setupLabel (refLabel_, "Reference"); + refCombo_.addItem (U ("10 m/s² RMS at 159.2 Hz (140 dB)"), 1); + refCombo_.addItem ("1 g RMS at 159.2 Hz (139.8 dB)", 2); + refCombo_.addItem ("Custom", 3); + refCombo_.setSelectedId (1, juce::dontSendNotification); + refCombo_.onChange = [this] { updateMode(); }; + addAndMakeVisible (refCombo_); + setupLabel (customLevelLabel_, "Level"); + setupLabel (customFreqLabel_, "Frequency"); + customLevel_.setValue (10.0); + customFreq_.setValue (159.2); + for (auto* f : { &customLevel_, &customFreq_ }) { f->style (pal_); addAndMakeVisible (*f); } + setupButton (measureButton_); + measureButton_.onClick = [this] { toggleMeasurement(); }; + addAndMakeVisible (progress_); + progress_.setColour (juce::ProgressBar::foregroundColourId, pal_.accent); + progress_.setColour (juce::ProgressBar::backgroundColourId, pal_.field); + setupLabel (resultLabel_, "Mount the sensor on the calibrator, switch it on, then press Measure.", true); + resultLabel_.setJustificationType (juce::Justification::topLeft); + + // --- Datasheet --- + setupLabel (sensLabel_, "Sensitivity"); + sensField_.setValue (10.2); + sensUnit_.addItem (U ("mV/(m/s²)"), 1); + sensUnit_.addItem ("mV/g", 2); + sensUnit_.setSelectedId (1, juce::dontSendNotification); + setupLabel (fsLabel_, "Interface full scale"); + fsField_.setValue (1.0); + fsUnit_.addItem ("Vrms at 0 dBFS", 1); + fsUnit_.addItem ("dBu at 0 dBFS", 2); + fsUnit_.setSelectedId (1, juce::dontSendNotification); + for (auto* f : { &sensField_, &fsField_ }) + { + f->style (pal_); + f->onValueChange = [this] (double) { updateDatasheet(); }; + addAndMakeVisible (*f); + } + for (auto* c : { &refCombo_, &sensUnit_, &fsUnit_ }) + pal_.style (*c); + for (auto* c : { &sensUnit_, &fsUnit_ }) + { + c->onChange = [this] { updateDatasheet(); }; + addAndMakeVisible (*c); + } + setupLabel (datasheetResult_, {}, true); + datasheetResult_.setJustificationType (juce::Justification::topLeft); + + setupButton (applyButton_); + setupButton (closeButton_); + applyButton_.onClick = [this] { apply(); }; + closeButton_.onClick = [this] { closeDialog(); }; + + updateMode(); + updateDatasheet(); + timerCallback(); + startTimerHz (15); + setSize (560, 400); + } + + ~CalibrationComponent() override + { + stopTimer(); + if (measuring_) + processor_.cancelAccelCalibration(); + } + + void paint (juce::Graphics& g) override { g.fillAll (pal_.bg); } + + void resized() override + { + auto r = getLocalBounds().reduced (16); + titleLabel_.setBounds (r.removeFromTop (24)); + currentLabel_.setBounds (r.removeFromTop (20)); + levelLabel_.setBounds (r.removeFromTop (20)); + r.removeFromTop (8); + auto tabs = r.removeFromTop (28); + calibratorTab_.setBounds (tabs.removeFromLeft (tabs.getWidth() / 2).reduced (2, 0)); + datasheetTab_.setBounds (tabs.reduced (2, 0)); + r.removeFromTop (12); + + auto buttons = r.removeFromBottom (30); + closeButton_.setBounds (buttons.removeFromRight (100)); + buttons.removeFromRight (8); + applyButton_.setBounds (buttons.removeFromRight (160)); + r.removeFromBottom (8); + + // Calibrator + { + auto c = r; + auto row = c.removeFromTop (28); + refLabel_.setBounds (row.removeFromLeft (150)); + refCombo_.setBounds (row); + c.removeFromTop (6); + row = c.removeFromTop (28); + customLevelLabel_.setBounds (row.removeFromLeft (150)); + customLevel_.setBounds (row.removeFromLeft (110)); + row.removeFromLeft (16); + customFreqLabel_.setBounds (row.removeFromLeft (80)); + customFreq_.setBounds (row.removeFromLeft (110)); + c.removeFromTop (10); + row = c.removeFromTop (28); + measureButton_.setBounds (row.removeFromLeft (150)); + row.removeFromLeft (10); + progress_.setBounds (row.reduced (0, 4)); + c.removeFromTop (8); + resultLabel_.setBounds (c); + } + // Datasheet + { + auto c = r; + auto row = c.removeFromTop (28); + sensLabel_.setBounds (row.removeFromLeft (150)); + sensField_.setBounds (row.removeFromLeft (110)); + row.removeFromLeft (8); + sensUnit_.setBounds (row.removeFromLeft (130)); + c.removeFromTop (6); + row = c.removeFromTop (28); + fsLabel_.setBounds (row.removeFromLeft (150)); + fsField_.setBounds (row.removeFromLeft (110)); + row.removeFromLeft (8); + fsUnit_.setBounds (row.removeFromLeft (160)); + c.removeFromTop (10); + datasheetResult_.setBounds (c); + } + } + +private: + bool calibratorMode() const { return calibratorTab_.getToggleState(); } + + double referenceRms() const + { + switch (refCombo_.getSelectedId()) + { + case 2: return vib::calibration::kGravity; + case 3: return customLevel_.getValue(); + default: return vib::calibration::kCalibratorRms; + } + } + double referenceHz() const { return refCombo_.getSelectedId() == 3 ? customFreq_.getValue() : 159.2; } + + void updateMode() + { + const bool cal = calibratorMode(); + const bool custom = refCombo_.getSelectedId() == 3; + for (juce::Component* c : std::initializer_list { + &refLabel_, &refCombo_, &measureButton_, &progress_, &resultLabel_ }) + c->setVisible (cal); + for (juce::Component* c : std::initializer_list { + &customLevelLabel_, &customLevel_, &customFreqLabel_, &customFreq_ }) + c->setVisible (cal && custom); + for (juce::Component* c : std::initializer_list { + &sensLabel_, &sensField_, &sensUnit_, &fsLabel_, &fsField_, &fsUnit_, &datasheetResult_ }) + c->setVisible (! cal); + customLevel_.setEnabled (! measuring_); + customFreq_.setEnabled (! measuring_); + refCombo_.setEnabled (! measuring_); + updateApply(); + } + + void updateApply() + { + const bool ready = calibratorMode() ? measuredCalDb_.has_value() : datasheetCalDb_.has_value(); + applyButton_.setEnabled (ready && ! measuring_); + const auto v = calibratorMode() ? measuredCalDb_ : datasheetCalDb_; + applyButton_.setButtonText (v ? "Apply " + juce::String (*v, 2) + " dB" : juce::String ("Apply")); + } + + void updateDatasheet() + { + double S = sensField_.getValue(); + if (sensUnit_.getSelectedId() == 2) + S = vib::calibration::mVperMs2FromMVperG (S); + const double fs = fsField_.getValue(); + const double vrms = fsUnit_.getSelectedId() == 2 ? vib::calibration::dBuToVrms (fs) : fs; + + datasheetCalDb_.reset(); + if (S > 0.0 && vrms > 0.0) + { + const double cal = vib::calibration::calDbFromDatasheet (vrms, S); + if (cal >= vib::calibration::kMinCalDb && cal <= vib::calibration::kMaxCalDb) + { + datasheetCalDb_ = cal; + datasheetResult_.setText (U ("Cal = 120 + 20·log10(√2 · ") + juce::String (vrms * 1000.0, 1) + + " mV / " + juce::String (S, 3) + U (" mV/(m/s²)) = ") + + juce::String (cal, 2) + U (" dB re 1 µm/s²\n") + + "Full-scale sine = " + formatAccel (vib::calibration::scale (cal) / std::sqrt (2.0)) + + " RMS", + juce::dontSendNotification); + } + else + { + datasheetResult_.setText (U ("Result outside 60–220 dB — check the values."), juce::dontSendNotification); + } + } + else + { + datasheetResult_.setText ("Enter sensitivity and interface full scale.", juce::dontSendNotification); + } + updateApply(); + } + + void toggleMeasurement() + { + if (measuring_) + { + processor_.cancelAccelCalibration(); + measuring_ = false; + resultLabel_.setText ("Measurement cancelled.", juce::dontSendNotification); + } + else + { + measuredCalDb_.reset(); + if (! processor_.startAccelCalibration (ch_, referenceHz())) + { + resultLabel_.setText ("Cannot start: the input is not available or the frequency is out of range.", + juce::dontSendNotification); + return; + } + measuring_ = true; + progressValue_ = 0.0; + resultLabel_.setText (U ("Measuring…"), juce::dontSendNotification); + } + measureButton_.setButtonText (measuring_ ? "Cancel" : "Measure"); + updateMode(); + } + + void timerCallback() override + { + const double calDb = processor_.getAccelCalDb (ch_); + const auto info = processor_.getAccelCalInfo (ch_); + currentLabel_.setText ("Current calibration: " + juce::String (calDb, 2) + U (" dB re 1 µm/s²") + + (info.isNotEmpty() ? " (" + info + ")" : juce::String (" (not calibrated yet)")), + juce::dontSendNotification); + const double rms = processor_.getInputRms (ch_); + levelLabel_.setText ("Input: " + formatDbfs (rms) + U (" · ") + formatAccel (rms * vib::calibration::scale (calDb)) + + " RMS with the current calibration", + juce::dontSendNotification); + + if (! measuring_) + return; + progressValue_ = processor_.getAccelCalibrationProgress(); + vib::CalibratorMeasurement::Result r; + if (! processor_.takeAccelCalibrationResult (r)) + return; + + measuring_ = false; + measureButton_.setButtonText ("Measure"); + using S = vib::CalibratorMeasurement::Status; + const juce::String meas = "Measured " + formatDbfs (r.rmsFS) + " at " + juce::String (r.freqHz, 1) + + U (" Hz, stability ±") + juce::String (r.fluctuationDb, 2) + " dB.\n"; + switch (r.status) + { + case S::Ok: + { + const double cal = vib::calibration::calDbFromCalibrator (r.rmsFS, referenceRms()); + if (cal >= vib::calibration::kMinCalDb && cal <= vib::calibration::kMaxCalDb) + { + measuredCalDb_ = cal; + resultLabel_.setText (meas + "New calibration: " + juce::String (cal, 2) + U (" dB re 1 µm/s² (") + + juce::String (cal - calDb, 2) + " dB change).", + juce::dontSendNotification); + } + else + { + resultLabel_.setText (meas + U ("The result is outside 60–220 dB."), juce::dontSendNotification); + } + break; + } + case S::Clipped: resultLabel_.setText (meas + U ("The input clips — reduce the interface gain."), juce::dontSendNotification); break; + case S::TooLow: resultLabel_.setText (meas + U ("No calibrator signal — check the sensor and the input."), juce::dontSendNotification); break; + case S::FrequencyOff: resultLabel_.setText (meas + U ("The frequency deviates more than ±5 % from ") + + juce::String (referenceHz(), 1) + " Hz.", juce::dontSendNotification); break; + case S::Unstable: resultLabel_.setText (meas + U ("The level fluctuates more than ±0.2 dB — hold the calibrator steady."), juce::dontSendNotification); break; + case S::Running: break; + } + updateMode(); + } + + void apply() + { + const auto v = calibratorMode() ? measuredCalDb_ : datasheetCalDb_; + if (! v) return; + processor_.setAccelCalDb (ch_, *v); + processor_.setAccelCalInfo (ch_, calibratorMode() ? "calibrator" : "datasheet"); + closeDialog(); + } + + void closeDialog() + { + if (auto* dw = findParentComponentOfClass()) + dw->exitModalState (0); + } + + SPLMeterAudioProcessor& processor_; + const int ch_; + Palette pal_; + bool measuring_ = false; + double progressValue_ = 0.0; + std::optional measuredCalDb_, datasheetCalDb_; + + juce::Label titleLabel_, currentLabel_, levelLabel_; + juce::TextButton calibratorTab_ { "Handheld calibrator" }, datasheetTab_ { "Datasheet" }; + juce::Label refLabel_, customLevelLabel_, customFreqLabel_, resultLabel_; + juce::ComboBox refCombo_; + NumberField customLevel_ { 0.001, 1000.0, 3, U ("m/s²") }, customFreq_ { 1.0, 10000.0, 1, "Hz" }; + juce::TextButton measureButton_ { "Measure" }; + juce::ProgressBar progress_ { progressValue_ }; + juce::Label sensLabel_, fsLabel_, datasheetResult_; + NumberField sensField_ { 0.001, 100000.0, 3 }, fsField_ { -60.0, 100.0, 3 }; + juce::ComboBox sensUnit_, fsUnit_; + juce::TextButton applyButton_ { "Apply" }, closeButton_ { "Close" }; + + JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (CalibrationComponent) +}; + +//============================================================================== +// One row of the inputs table +class InputRow : public juce::Component +{ +public: + std::function onCalibrate; + + InputRow (SPLMeterAudioProcessor& p, int channel) : processor_ (p), ch_ (channel) + { + addAndMakeVisible (nameLabel_); + for (int r = 0; r <= (int) SensorRole::Off; ++r) + roleCombo_.addItem (roleName ((SensorRole) r), r + 1); + roleCombo_.onChange = [this] + { + processor_.setChannelRole (ch_, SensorConfig::fromInt (roleCombo_.getSelectedId() - 1)); + }; + addAndMakeVisible (roleCombo_); + addAndMakeVisible (level_); + addAndMakeVisible (levelText_); + levelText_.setJustificationType (juce::Justification::centredRight); + calField_.onValueChange = [this] (double v) + { + processor_.setAccelCalDb (ch_, v); + processor_.setAccelCalInfo (ch_, "manual"); + }; + addAndMakeVisible (calField_); + calButton_.onClick = [this] { if (onCalibrate) onCalibrate (ch_); }; + addAndMakeVisible (calButton_); + addAndMakeVisible (calInfo_); + for (auto* l : { &nameLabel_, &levelText_, &calInfo_ }) + l->setFont (juce::Font (juce::FontOptions().withHeight (13.0f))); + } + + void applyPalette (const Palette& p) + { + pal_ = p; + nameLabel_.setColour (juce::Label::textColourId, p.text); + levelText_.setColour (juce::Label::textColourId, p.subtext); + calInfo_.setColour (juce::Label::textColourId, p.subtext); + calField_.style (p); + p.style (roleCombo_); + level_.setPalette (p); + calButton_.setColour (juce::TextButton::buttonColourId, p.field); + calButton_.setColour (juce::TextButton::textColourOffId, p.text); + repaint(); + } + + // Columns are shared with the table header + static void columns (juce::Rectangle r, juce::Rectangle (&out)[6]) + { + out[0] = r.removeFromLeft (110); // channel + out[1] = r.removeFromLeft (150); // role + out[2] = r.removeFromLeft (190); // level bar + out[3] = r.removeFromLeft (110); // level text + out[4] = r.removeFromLeft (100); // cal (dB) + out[5] = r; // calibrate + info + } + + void resized() override + { + juce::Rectangle c[6]; + columns (getLocalBounds(), c); + nameLabel_.setBounds (c[0]); + roleCombo_.setBounds (c[1].reduced (2, 3)); + level_.setBounds (c[2].reduced (6, 0)); + levelText_.setBounds (c[3]); + calField_.setBounds (c[4].reduced (6, 4)); + auto last = c[5]; + calButton_.setBounds (last.removeFromLeft (100).reduced (2, 3)); + calInfo_.setBounds (last.withTrimmedLeft (6)); + } + + void paint (juce::Graphics& g) override + { + if (invalid_) + { + g.setColour (pal_.bad.withAlpha (0.18f)); + g.fillRoundedRectangle (getLocalBounds().toFloat(), 4.0f); + } + } + + // Called by the window's timer + void refresh (bool invalid) + { + const auto role = processor_.getChannelRole (ch_); + const bool accel = SensorConfig::isAccel (role); + nameLabel_.setText (processor_.getChannelName (ch_), juce::dontSendNotification); + if (! roleCombo_.isPopupActive()) + roleCombo_.setSelectedId ((int) role + 1, juce::dontSendNotification); + + const float rms = processor_.getInputRms (ch_); + const float peak = processor_.takeInputPeak (ch_); + level_.setLevels (rms, peak); + + calField_.setVisible (accel); + calButton_.setVisible (accel); + calInfo_.setVisible (accel); + if (accel) + { + const double calDb = processor_.getAccelCalDb (ch_); + if (! calField_.isBeingEdited()) + calField_.setValue (calDb); + levelText_.setText (formatAccel (rms * vib::calibration::scale (calDb)), juce::dontSendNotification); + const auto info = processor_.getAccelCalInfo (ch_); + calInfo_.setText (info.isNotEmpty() ? info : juce::String ("not calibrated"), juce::dontSendNotification); + } + else + { + levelText_.setText (role == SensorRole::Off ? juce::String() : formatDbfs (rms), juce::dontSendNotification); + } + level_.setAlpha (role == SensorRole::Off ? 0.4f : 1.0f); + + if (invalid != invalid_) { invalid_ = invalid; repaint(); } + } + +private: + SPLMeterAudioProcessor& processor_; + const int ch_; + Palette pal_ = Palette::get (false); + bool invalid_ = false; + + juce::Label nameLabel_, levelText_, calInfo_; + juce::ComboBox roleCombo_; + LevelBar level_; + NumberField calField_ { vib::calibration::kMinCalDb, vib::calibration::kMaxCalDb, 2, "dB" }; + juce::TextButton calButton_ { U ("Calibrate…") }; +}; + +//============================================================================== +class InputsComponent : public juce::Component, + private juce::Timer +{ +public: + InputsComponent (SPLMeterAudioProcessor& p, bool light) : processor_ (p) + { + auto setupLabel = [this] (juce::Label& l, const juce::String& text, float h = 13.0f, bool bold = false) + { + l.setText (text, juce::dontSendNotification); + auto f = juce::FontOptions().withHeight (h); + l.setFont (juce::Font (bold ? f.withStyle ("Bold") : f)); + l.setInterceptsMouseClicks (false, false); + addAndMakeVisible (l); + }; + + setupLabel (inputsTitle_, "INPUTS", 11.0f, true); + setupLabel (inputsDesc_, "Assign a role to each input. Only Mic inputs feed the SPL meter; " + "accelerometer inputs bypass the mix, bandpass and correction filter.", 11.5f); + setupLabel (statusLabel_, {}, 13.0f, true); + const juce::String headers[6] = { "Channel", "Role", "Level", "", U ("Cal (dB re 1 µm/s²)"), "Calibration" }; + for (int i = 0; i < 6; ++i) + setupLabel (headerLabels_[i], headers[i], 11.0f, true); + addAndMakeVisible (viewport_); + viewport_.setViewedComponent (&rowsHolder_, false); + viewport_.setScrollBarsShown (true, false); + + // --- Accelerometer group --- + setupLabel (accelTitle_, "ACCELEROMETER", 11.0f, true); + setupLabel (accelDesc_, "Applies to all axes of the sensor. Changes restart the vibration readings.", 11.5f); + setupLabel (quantityLabel_, "Quantity"); + quantityCombo_.addItem ("Acceleration", 1); + quantityCombo_.addItem ("Velocity", 2); + quantityCombo_.addItem ("Displacement", 3); + quantityCombo_.onChange = [this] { auto s = processor_.getVibrationSettings(); + s.quantity = (vib::Quantity) (quantityCombo_.getSelectedId() - 1); + processor_.setVibrationSettings (s); }; + addAndMakeVisible (quantityCombo_); + + setupLabel (highPassLabel_, "High-pass"); + highPass_.onValueChange = [this] (double v) { auto s = processor_.getVibrationSettings(); + s.highPassHz = v; processor_.setVibrationSettings (s); }; + addAndMakeVisible (highPass_); + + setupLabel (tauLabel_, U ("RMS τ")); + tauCombo_.setTooltip ("Time constant of the running RMS (ISO 2631-1 uses 1 s)"); + for (int i = 0; i < (int) kTaus.size(); ++i) + tauCombo_.addItem (juce::String (kTaus[(size_t) i], kTaus[(size_t) i] < 1.0 ? 3 : 0) + " s", i + 1); + tauCombo_.onChange = [this] { auto s = processor_.getVibrationSettings(); + s.tauSec = kTaus[(size_t) juce::jlimit (0, (int) kTaus.size() - 1, tauCombo_.getSelectedId() - 1)]; + processor_.setVibrationSettings (s); }; + addAndMakeVisible (tauCombo_); + + const char* axisNames[3] = { "Weighting X", "Weighting Y", "Weighting Z" }; + const char* kNames[3] = { "k x", "k y", "k z" }; + for (int a = 0; a < 3; ++a) + { + setupLabel (weightingLabels_[a], axisNames[a]); + for (int w = 0; w <= (int) vib::Weighting::KB; ++w) + weightingCombos_[a].addItem (weightingName ((vib::Weighting) w), w + 1); + weightingCombos_[a].onChange = [this, a] { auto s = processor_.getVibrationSettings(); + s.weighting[a] = (vib::Weighting) (weightingCombos_[a].getSelectedId() - 1); + processor_.setVibrationSettings (s); }; + addAndMakeVisible (weightingCombos_[a]); + + setupLabel (kLabels_[a], kNames[a]); + kFields_[a].onValueChange = [this, a] (double v) { auto s = processor_.getVibrationSettings(); + s.k[a] = v; processor_.setVibrationSettings (s); }; + addAndMakeVisible (kFields_[a]); + } + + setupLabel (bandLabel_, "Band limit"); + bandLow_.onValueChange = [this] (double v) { auto s = processor_.getVibrationSettings(); + s.bandLowHz = v; processor_.setVibrationSettings (s); }; + bandHigh_.onValueChange = [this] (double v) { auto s = processor_.getVibrationSettings(); + s.bandHighHz = v; processor_.setVibrationSettings (s); }; + addAndMakeVisible (bandLow_); + addAndMakeVisible (bandHigh_); + + setupLabel (serialLabel_, "Sensor serial"); + serialEditor_.onTextChange = [this] { auto i = processor_.getAccelSensorInfo(); + i.serial = serialEditor_.getText().trim(); + processor_.setAccelSensorInfo (i); }; + addAndMakeVisible (serialEditor_); + setupLabel (rangeLabel_, "Usable range"); + lowerLimit_.onValueChange = [this] (double v) { auto i = processor_.getAccelSensorInfo(); + i.lowerLimitHz = v; processor_.setAccelSensorInfo (i); }; + upperLimit_.onValueChange = [this] (double v) { auto i = processor_.getAccelSensorInfo(); + i.upperLimitHz = v; processor_.setAccelSensorInfo (i); }; + addAndMakeVisible (lowerLimit_); + addAndMakeVisible (upperLimit_); + + setLightMode (light); + loadAccelSettings(); + rebuildRows(); + timerCallback(); + startTimerHz (20); + } + + ~InputsComponent() override + { + stopTimer(); + closeCalibration(); // the dialog refers to the processor + } + + void setLightMode (bool light) + { + light_ = light; + pal_ = Palette::get (light); + for (auto* l : { &inputsTitle_, &accelTitle_ }) + l->setColour (juce::Label::textColourId, pal_.subtext); + for (auto* l : { &inputsDesc_, &accelDesc_ }) + l->setColour (juce::Label::textColourId, pal_.subtext.withAlpha (0.85f)); + for (auto& l : headerLabels_) + l.setColour (juce::Label::textColourId, pal_.subtext); + for (auto* l : { &quantityLabel_, &highPassLabel_, &tauLabel_, &bandLabel_, &serialLabel_, &rangeLabel_, + &weightingLabels_[0], &weightingLabels_[1], &weightingLabels_[2], + &kLabels_[0], &kLabels_[1], &kLabels_[2] }) + l->setColour (juce::Label::textColourId, pal_.text); + for (auto* f : { &highPass_, &bandLow_, &bandHigh_, &lowerLimit_, &upperLimit_, + &kFields_[0], &kFields_[1], &kFields_[2] }) + f->style (pal_); + for (auto* c : { &quantityCombo_, &tauCombo_, &weightingCombos_[0], &weightingCombos_[1], &weightingCombos_[2] }) + pal_.style (*c); + serialEditor_.setColour (juce::TextEditor::backgroundColourId, pal_.field); + serialEditor_.setColour (juce::TextEditor::textColourId, pal_.text); + serialEditor_.setColour (juce::TextEditor::outlineColourId, pal_.border); + for (auto& row : rows_) + row->applyPalette (pal_); + repaint(); + } + + void paint (juce::Graphics& g) override + { + g.fillAll (pal_.bg); + for (auto* b : { &inputsCard_, &accelCard_ }) + { + if (b->isEmpty()) continue; + g.setColour (pal_.card); + g.fillRoundedRectangle (b->toFloat(), 10.0f); + g.setColour (pal_.border); + g.drawRoundedRectangle (b->toFloat(), 10.0f, 1.0f); + } + } + + void resized() override + { + constexpr int margin = 16, pad = 14, rowH = 30; + auto page = getLocalBounds().reduced (margin); + + // Accelerometer card at the bottom (fixed height), inputs card fills the rest + accelCard_ = {}; + if (accelVisible_) + { + accelCard_ = page.removeFromBottom (pad * 2 + 16 + 3 + 16 + 10 + 4 * 28 + 3 * 6); + page.removeFromBottom (16); + auto c = accelCard_.reduced (pad); + accelTitle_.setBounds (c.removeFromTop (16)); + c.removeFromTop (3); + accelDesc_.setBounds (c.removeFromTop (16)); + c.removeFromTop (10); + + const int colW = c.getWidth() / 3; + auto cell = [&] (juce::Rectangle row, int col, juce::Label& label, juce::Component& comp, int labelW = 96) + { + auto r = row.withX (row.getX() + col * colW).withWidth (colW - 12); + label.setBounds (r.removeFromLeft (labelW)); + comp.setBounds (r.reduced (0, 2)); + }; + auto row = c.removeFromTop (28); + cell (row, 0, quantityLabel_, quantityCombo_); + cell (row, 1, highPassLabel_, highPass_); + cell (row, 2, tauLabel_, tauCombo_); + c.removeFromTop (6); + row = c.removeFromTop (28); + for (int a = 0; a < 3; ++a) + cell (row, a, weightingLabels_[a], weightingCombos_[a]); + c.removeFromTop (6); + row = c.removeFromTop (28); + for (int a = 0; a < 3; ++a) + cell (row, a, kLabels_[a], kFields_[a]); + c.removeFromTop (6); + row = c.removeFromTop (28); + cell (row, 0, serialLabel_, serialEditor_); + { + auto r = row.withX (row.getX() + colW).withWidth (colW - 12); + rangeLabel_.setBounds (r.removeFromLeft (96)); + upperLimit_.setBounds (r.removeFromRight ((r.getWidth() - 8) / 2).reduced (0, 2)); + r.removeFromRight (8); + lowerLimit_.setBounds (r.reduced (0, 2)); + } + { + auto r = row.withX (row.getX() + 2 * colW).withWidth (colW - 12); + bandLabel_.setBounds (r.removeFromLeft (96)); + bandHigh_.setBounds (r.removeFromRight ((r.getWidth() - 8) / 2).reduced (0, 2)); + r.removeFromRight (8); + bandLow_.setBounds (r.reduced (0, 2)); + } + } + + inputsCard_ = page; + auto c = page.reduced (pad); + inputsTitle_.setBounds (c.removeFromTop (16)); + c.removeFromTop (3); + inputsDesc_.setBounds (c.removeFromTop (16)); + c.removeFromTop (8); + statusLabel_.setBounds (c.removeFromTop (20)); + c.removeFromTop (8); + + juce::Rectangle cols[6]; + InputRow::columns (c.removeFromTop (18).withTrimmedRight (viewport_.getScrollBarThickness()), cols); + for (int i = 0; i < 6; ++i) + headerLabels_[i].setBounds (cols[i]); + c.removeFromTop (4); + viewport_.setBounds (c); + + const int w = c.getWidth() - viewport_.getScrollBarThickness(); + rowsHolder_.setSize (w, (int) rows_.size() * rowH); + for (size_t i = 0; i < rows_.size(); ++i) + rows_[i]->setBounds (0, (int) i * rowH, w, rowH - 2); + } + +private: + static constexpr std::array kTaus { 0.125, 0.5, 1.0, 2.0, 8.0 }; + + int numInputs() const { return juce::jmin (processor_.getTotalNumInputChannels(), SensorConfig::kMaxInputs); } + + void rebuildRows() + { + rows_.clear(); + for (int ch = 0; ch < numInputs(); ++ch) + { + auto row = std::make_unique (processor_, ch); + row->applyPalette (pal_); + row->onCalibrate = [this] (int c) { openCalibration (c); }; + rowsHolder_.addAndMakeVisible (*row); + rows_.push_back (std::move (row)); + } + resized(); + } + + void closeCalibration() + { + delete calDialog_.getComponent(); + } + + void openCalibration (int ch) + { + closeCalibration(); + juce::DialogWindow::LaunchOptions o; + o.content.setOwned (new CalibrationComponent (processor_, ch, light_)); + o.dialogTitle = "Calibrate " + processor_.getChannelName (ch); + o.dialogBackgroundColour = pal_.bg; + o.escapeKeyTriggersCloseButton = true; + o.useNativeTitleBar = false; + o.resizable = false; + o.componentToCentreAround = this; + calDialog_ = o.launchAsync(); + } + + // Reflects the stored settings in the controls (not while one is being edited) + void loadAccelSettings() + { + const auto s = processor_.getVibrationSettings(); + quantityCombo_.setSelectedId ((int) s.quantity + 1, juce::dontSendNotification); + if (! highPass_.isBeingEdited()) highPass_.setValue (s.highPassHz); + int tauIdx = 0; + for (int i = 0; i < (int) kTaus.size(); ++i) + if (std::abs (kTaus[(size_t) i] - s.tauSec) < std::abs (kTaus[(size_t) tauIdx] - s.tauSec)) tauIdx = i; + tauCombo_.setSelectedId (tauIdx + 1, juce::dontSendNotification); + bool anyBand = false; + for (int a = 0; a < 3; ++a) + { + if (! weightingCombos_[a].isPopupActive()) + weightingCombos_[a].setSelectedId ((int) s.weighting[a] + 1, juce::dontSendNotification); + if (! kFields_[a].isBeingEdited()) kFields_[a].setValue (s.k[a]); + anyBand = anyBand || s.weighting[a] == vib::Weighting::BandLimit; + } + if (! bandLow_.isBeingEdited()) bandLow_.setValue (s.bandLowHz); + if (! bandHigh_.isBeingEdited()) bandHigh_.setValue (s.bandHighHz); + bandLabel_.setAlpha (anyBand ? 1.0f : 0.4f); + bandLow_.setEnabled (anyBand); + bandHigh_.setEnabled (anyBand); + + const auto info = processor_.getAccelSensorInfo(); + if (! serialEditor_.hasKeyboardFocus (true)) + serialEditor_.setText (info.serial, false); + if (! lowerLimit_.isBeingEdited()) lowerLimit_.setValue (info.lowerLimitHz); + if (! upperLimit_.isBeingEdited()) upperLimit_.setValue (info.upperLimitHz); + } + + void timerCallback() override + { + if ((int) rows_.size() != numInputs()) + rebuildRows(); + + const auto roles = processor_.getChannelRoles(); + const auto validity = processor_.getSensorValidity(); + const bool valid = SensorConfig::isValid (validity); + + // Status line + juce::String text; + juce::Colour col = pal_.subtext; + auto axisList = [&] + { + juce::StringArray parts; + const char* names[3] = { "X", "Y", "Z" }; + for (int a = 0; a < 3; ++a) + for (int ch = 0; ch < numInputs(); ++ch) + if (roles[(size_t) ch] == (SensorRole) ((int) SensorRole::AccelX + a)) + parts.add (juce::String (names[a]) + " = " + processor_.getChannelName (ch)); + return parts.joinIntoString (", "); + }; + switch (validity) + { + case SensorConfig::Validity::NoAccelerometer: + text = "No accelerometer assigned."; break; + case SensorConfig::Validity::Triaxial: + text = "Triaxial accelerometer: " + axisList(); col = pal_.ok; break; + case SensorConfig::Validity::Biaxial: + case SensorConfig::Validity::SingleAxis: + text = "Accelerometer axes: " + axisList(); col = pal_.ok; break; + case SensorConfig::Validity::Uniaxial: + for (int ch = 0; ch < numInputs(); ++ch) + if (roles[(size_t) ch] == SensorRole::AccelUniaxial) + text = "Uniaxial accelerometer on " + processor_.getChannelName (ch); + col = pal_.ok; break; + case SensorConfig::Validity::DuplicateAxis: + text = U ("An axis is assigned to more than one input — accelerometer inactive."); col = pal_.bad; break; + case SensorConfig::Validity::MixedKinds: + text = U ("Use either X/Y/Z or one uniaxial input (one sensor per session) — accelerometer inactive."); + col = pal_.bad; break; + } + bool anyMic = false; + for (int ch = 0; ch < numInputs(); ++ch) + anyMic = anyMic || roles[(size_t) ch] == SensorRole::Mic; + if (! anyMic && numInputs() > 0) + { + text << U (" No Mic input — the SPL meter has no signal."); + if (valid) col = pal_.warn; + } + statusLabel_.setText (text, juce::dontSendNotification); + statusLabel_.setColour (juce::Label::textColourId, col); + + // Rows: with an invalid configuration, every accelerometer row is marked + for (int ch = 0; ch < (int) rows_.size(); ++ch) + rows_[(size_t) ch]->refresh (! valid && SensorConfig::isAccel (roles[(size_t) ch])); + + // Accelerometer group: shown when any input has an accelerometer role + bool anyAccel = false; + bool uniaxial = false; + for (int ch = 0; ch < numInputs(); ++ch) + { + anyAccel = anyAccel || SensorConfig::isAccel (roles[(size_t) ch]); + uniaxial = uniaxial || roles[(size_t) ch] == SensorRole::AccelUniaxial; + } + if (anyAccel != accelVisible_ || uniaxial != uniaxial_) + { + accelVisible_ = anyAccel; + uniaxial_ = uniaxial; + for (juce::Component* comp : accelComponents()) + comp->setVisible (anyAccel); + // Uniaxial: one weighting, no vector sum + weightingLabels_[0].setText (uniaxial ? "Weighting" : "Weighting X", juce::dontSendNotification); + for (int a = 1; a < 3; ++a) + { + weightingLabels_[a].setVisible (anyAccel && ! uniaxial); + weightingCombos_[a].setVisible (anyAccel && ! uniaxial); + } + for (int a = 0; a < 3; ++a) + { + kLabels_[a].setVisible (anyAccel && ! uniaxial); + kFields_[a].setVisible (anyAccel && ! uniaxial); + } + resized(); + repaint(); + } + if (anyAccel) + loadAccelSettings(); + } + + std::vector accelComponents() + { + std::vector v { &accelTitle_, &accelDesc_, &quantityLabel_, &quantityCombo_, + &highPassLabel_, &highPass_, &tauLabel_, &tauCombo_, + &bandLabel_, &bandLow_, &bandHigh_, &serialLabel_, &serialEditor_, + &rangeLabel_, &lowerLimit_, &upperLimit_ }; + for (int a = 0; a < 3; ++a) + { + v.push_back (&weightingLabels_[a]); v.push_back (&weightingCombos_[a]); + v.push_back (&kLabels_[a]); v.push_back (&kFields_[a]); + } + return v; + } + + SPLMeterAudioProcessor& processor_; + bool light_ = false; + Palette pal_ = Palette::get (false); + bool accelVisible_ = true, uniaxial_ = true; // forces the first update + juce::Rectangle inputsCard_, accelCard_; + juce::Component::SafePointer calDialog_; + + juce::Label inputsTitle_, inputsDesc_, statusLabel_; + juce::Label headerLabels_[6]; + juce::Viewport viewport_; + juce::Component rowsHolder_; + std::vector> rows_; + + juce::Label accelTitle_, accelDesc_; + juce::Label quantityLabel_, highPassLabel_, tauLabel_, bandLabel_, serialLabel_, rangeLabel_; + juce::ComboBox quantityCombo_, tauCombo_; + NumberField highPass_ { 0.1, 20.0, 2, "Hz" }; + juce::Label weightingLabels_[3], kLabels_[3]; + juce::ComboBox weightingCombos_[3]; + NumberField kFields_[3] { { 0.0, 2.0, 2 }, { 0.0, 2.0, 2 }, { 0.0, 2.0, 2 } }; + NumberField bandLow_ { 0.1, 1000.0, 1, "Hz" }, bandHigh_ { 1.0, 20000.0, 0, "Hz" }; + juce::TextEditor serialEditor_; + NumberField lowerLimit_ { 0.01, 1000.0, 2, "Hz" }, upperLimit_ { 1.0, 100000.0, 0, "Hz" }; + + JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (InputsComponent) +}; + +//============================================================================== +class InputsWindow : public juce::DocumentWindow +{ +public: + InputsWindow (SPLMeterAudioProcessor& p, bool light) + : juce::DocumentWindow ("Inputs & Sensors", juce::Colour (0xff1c1c1e), juce::DocumentWindow::closeButton) + { + setUsingNativeTitleBar (false); + content_ = new InputsComponent (p, light); + content_->setSize (960, 720); + setContentOwned (content_, true); + setResizable (true, false); + setResizeLimits (860, 420, 1600, 1400); + } + + void setLightMode (bool light) { content_->setLightMode (light); } + void closeButtonPressed() override { setVisible (false); } + +private: + InputsComponent* content_ = nullptr; // owned by the window + juce::TooltipWindow tooltipWindow_ { this, 500 }; + + JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (InputsWindow) +}; +} // namespace InputsUi diff --git a/Source/PluginProcessor.cpp b/Source/PluginProcessor.cpp index 24db6eb..25f7505 100644 --- a/Source/PluginProcessor.cpp +++ b/Source/PluginProcessor.cpp @@ -272,6 +272,11 @@ void SPLMeterAudioProcessor::prepareToPlay (double sampleRate, int samplesPerBlo vibWork_ = {}; vibSnapshot_.write (vibWork_); + // A running calibrator measurement was set up for the old rate: abandon it + calState_.store (CalIdle, std::memory_order_release); + calProgress_.store (0.0, std::memory_order_relaxed); + inputMs_.fill (0.0); + nonMicScratch_.setSize (juce::jmax (1, juce::jmin (getTotalNumInputChannels(), SensorConfig::kMaxInputs)), samplesPerBlock, false, true, false); } @@ -401,6 +406,43 @@ void SPLMeterAudioProcessor::processBlock (juce::AudioBuffer& buffer, if (vibActive_->process (axisIn, numSamples, ! skipMetering, vibWork_)) vibSnapshot_.write (vibWork_); } + + // --- Live input level per channel (Inputs table) --- + const int numLiveInputs = juce::jmin (getTotalNumInputChannels(), numChannels, SensorConfig::kMaxInputs); + if (numSamples > 0) + { + const double a = 1.0 - std::exp (-numSamples / (0.125 * currentSampleRate)); + for (int ch = 0; ch < numLiveInputs; ++ch) + { + const float* x = buffer.getReadPointer (ch); + double sumSq = 0.0; + float peak = 0.0f; + for (int s = 0; s < numSamples; ++s) + { + sumSq += (double) x[s] * x[s]; + peak = juce::jmax (peak, std::abs (x[s])); + } + auto& ms = inputMs_[(size_t) ch]; + ms += a * (sumSq / numSamples - ms); + inputRms_[(size_t) ch].store ((float) std::sqrt (ms), std::memory_order_relaxed); + if (peak > inputPeak_[(size_t) ch].load (std::memory_order_relaxed)) + inputPeak_[(size_t) ch].store (peak, std::memory_order_relaxed); + } + } + + // --- Calibrator measurement on one live input --- + { + const int cs = calState_.load (std::memory_order_acquire); + if (cs == CalCancel) + calState_.store (CalIdle, std::memory_order_release); + else if (cs == CalRunning && calChannel_ < numLiveInputs) + { + calMeas_.process (buffer.getReadPointer (calChannel_), numSamples); + calProgress_.store (calMeas_.progress(), std::memory_order_relaxed); + if (calMeas_.finished()) + calState_.store (CalDone, std::memory_order_release); + } + } if (fileMode) { fileReadBuffer.setSize (2, numSamples, false, true, true); @@ -1039,6 +1081,81 @@ void SPLMeterAudioProcessor::loadChannelRolesFromState() } } +SPLMeterAudioProcessor::AccelSensorInfo SPLMeterAudioProcessor::getAccelSensorInfo() const +{ + AccelSensorInfo info; + const auto node = apvts.state.getChildWithName ("UIState").getChildWithName (kAccelNode); + if (! node.isValid()) + return info; + info.serial = node.getProperty ("sensorSerial", juce::String()).toString(); + info.lowerLimitHz = juce::jlimit (0.01, 1000.0, (double) node.getProperty ("lowerLimitHz", info.lowerLimitHz)); + info.upperLimitHz = juce::jlimit (1.0, 100000.0, (double) node.getProperty ("upperLimitHz", info.upperLimitHz)); + return info; +} + +void SPLMeterAudioProcessor::setAccelSensorInfo (const AccelSensorInfo& info) +{ + auto node = getUiState().getOrCreateChildWithName (kAccelNode, nullptr); + node.setProperty ("sensorSerial", info.serial, nullptr); + node.setProperty ("lowerLimitHz", info.lowerLimitHz, nullptr); + node.setProperty ("upperLimitHz", info.upperLimitHz, nullptr); +} + +juce::String SPLMeterAudioProcessor::getAccelCalInfo (int ch) const +{ + const auto inputs = apvts.state.getChildWithName ("UIState").getChildWithName ("Inputs"); + if (! inputs.isValid()) + return {}; + const auto date = inputs.getProperty ("calDate" + juce::String (ch), juce::String()).toString(); + const auto method = inputs.getProperty ("calMethod" + juce::String (ch), juce::String()).toString(); + if (date.isEmpty()) + return {}; + return method.isNotEmpty() ? date + " · " + method : date; +} + +void SPLMeterAudioProcessor::setAccelCalInfo (int ch, const juce::String& method) +{ + if (ch < 0 || ch >= SensorConfig::kMaxInputs) + return; + auto inputs = getUiState().getOrCreateChildWithName ("Inputs", nullptr); + inputs.setProperty ("calDate" + juce::String (ch), juce::Time::getCurrentTime().formatted ("%Y-%m-%d"), nullptr); + inputs.setProperty ("calMethod" + juce::String (ch), method, nullptr); +} + +//============================================================================== +// Calibrator measurement (spec §4) +bool SPLMeterAudioProcessor::startAccelCalibration (int ch, double referenceHz) +{ + if (ch < 0 || ch >= juce::jmin (getTotalNumInputChannels(), SensorConfig::kMaxInputs) + || referenceHz <= 0.0 || referenceHz > 0.4 * currentSampleRate) + return false; + + // Only from Idle or Done: the audio thread does not touch calMeas_ then + int s = calState_.load (std::memory_order_acquire); + if (s != CalIdle && s != CalDone) + return false; + calChannel_ = ch; + calMeas_.prepare (currentSampleRate, referenceHz); + calProgress_.store (0.0, std::memory_order_relaxed); + return calState_.compare_exchange_strong (s, CalRunning, std::memory_order_acq_rel); +} + +void SPLMeterAudioProcessor::cancelAccelCalibration() noexcept +{ + int s = CalRunning; + if (! calState_.compare_exchange_strong (s, CalCancel, std::memory_order_acq_rel) && s == CalDone) + calState_.store (CalIdle, std::memory_order_release); +} + +bool SPLMeterAudioProcessor::takeAccelCalibrationResult (vib::CalibratorMeasurement::Result& result) noexcept +{ + if (calState_.load (std::memory_order_acquire) != CalDone) + return false; + result = calMeas_.result(); + calState_.store (CalIdle, std::memory_order_release); + return true; +} + //============================================================================== void SPLMeterAudioProcessor::loadFile (const juce::File& file) { diff --git a/Source/PluginProcessor.h b/Source/PluginProcessor.h index 508af45..391243f 100644 --- a/Source/PluginProcessor.h +++ b/Source/PluginProcessor.h @@ -10,6 +10,7 @@ #include "SoundDetective.h" #include "SensorConfig.h" #include "Vibration/VibrationEngine.h" +#include "Vibration/CalibratorMeasurement.h" #include #include #include @@ -318,6 +319,39 @@ class SPLMeterAudioProcessor : public juce::AudioProcessor } void resetVibrationStats() noexcept { vibResetRequest_.store (true, std::memory_order_release); } + // Sensor information for the report (UIState/Accel; no engine rebuild) + struct AccelSensorInfo + { + juce::String serial; + double lowerLimitHz = 0.5; // usable range from the datasheet (spec §3.2) + double upperLimitHz = 10000.0; + }; + AccelSensorInfo getAccelSensorInfo() const; + void setAccelSensorInfo (const AccelSensorInfo& info); + + // Calibration date/method per input (UIState/Inputs "calDate", "calMethod") + juce::String getAccelCalInfo (int ch) const; // e.g. "2026-11-12 · calibrator", empty if never + void setAccelCalInfo (int ch, const juce::String& method); // stamps today's date + + // Live input level per channel (raw, after mute), for the Inputs table. + // RMS is smoothed with τ = 125 ms; the peak is the maximum since the last read. + float getInputRms (int ch) const noexcept + { + return ch >= 0 && ch < SensorConfig::kMaxInputs ? inputRms_[(size_t) ch].load (std::memory_order_relaxed) : 0.0f; + } + float takeInputPeak (int ch) noexcept + { + return ch >= 0 && ch < SensorConfig::kMaxInputs ? inputPeak_[(size_t) ch].exchange (0.0f, std::memory_order_relaxed) : 0.0f; + } + + // Handheld-calibrator measurement on one input (spec §4). Message thread: + // start → poll getAccelCalibrationProgress() → takeAccelCalibrationResult(). + bool startAccelCalibration (int ch, double referenceHz); + void cancelAccelCalibration() noexcept; + double getAccelCalibrationProgress() const noexcept { return calProgress_.load (std::memory_order_relaxed); } + // Returns true (and fills result) once the measurement has finished + bool takeAccelCalibrationResult (vib::CalibratorMeasurement::Result& result) noexcept; + //========================================================================== juce::AudioProcessorValueTreeState apvts; @@ -346,6 +380,19 @@ class SPLMeterAudioProcessor : public juce::AudioProcessor vib::SeqLock vibSnapshot_; vib::VibrationSnapshot vibWork_; // audio thread + // Input level meters (audio thread writes) + std::array, SensorConfig::kMaxInputs> inputRms_ {}, inputPeak_ {}; + std::array inputMs_ {}; // audio thread + + // Calibrator measurement hand-over: the message thread configures calMeas_ + // only while calState_ is Idle, the audio thread uses it only while Running, + // and the message thread reads the result once it is Done. + enum CalState : int { CalIdle = 0, CalRunning, CalCancel, CalDone }; + std::atomic calState_ { CalIdle }; + std::atomic calProgress_ { 0.0 }; + int calChannel_ = -1; + vib::CalibratorMeasurement calMeas_; + // Accelerometer channels are restored from here after the correction // convolution, which processes all channels at once (allocated in prepareToPlay) juce::AudioBuffer nonMicScratch_; diff --git a/Source/SettingsComponent.h b/Source/SettingsComponent.h index 8e240cc..0961dd2 100644 --- a/Source/SettingsComponent.h +++ b/Source/SettingsComponent.h @@ -2,6 +2,7 @@ #include #include "PluginProcessor.h" #include "UserPrefs.h" +#include "InputsComponent.h" //============================================================================== // Custom channel mute button: shows label with red X + strikethrough when muted. @@ -11,6 +12,12 @@ class ChannelMuteButton : public juce::Button public: std::function onNameChanged; + // Sensor role shown in the top-right corner (empty for Mic) + void setRoleTag (const juce::String& tag) + { + if (tag != roleTag_) { roleTag_ = tag; repaint(); } + } + ChannelMuteButton() : juce::Button ("") { setClickingTogglesState (true); @@ -46,6 +53,13 @@ class ChannelMuteButton : public juce::Button g.setFont (font); g.drawText (displayText, b.toNearestInt(), juce::Justification::centred, false); + if (roleTag_.isNotEmpty()) + { + g.setColour (roleTag_ == "OFF" ? juce::Colour (0xff8e8e93) : juce::Colour (0xffff9f0a)); + g.setFont (juce::Font (juce::FontOptions().withHeight (9.5f).withStyle ("Bold"))); + g.drawText (roleTag_, b.reduced (4.0f, 1.0f).toNearestInt(), juce::Justification::topRight, false); + } + if (muted) { // Strikethrough across the label text @@ -97,6 +111,7 @@ class ChannelMuteButton : public juce::Button } juce::TextEditor editor_; + juce::String roleTag_; }; //============================================================================== @@ -817,6 +832,20 @@ class SettingsComponent : public juce::Component, addAndMakeVisible (channelMuteButtons[i]); } + // Inputs & Sensors window: sensor roles, accelerometer calibration (vibration spec §7.1) + inputsButton.setButtonText (InputsUi::U ("Inputs & Sensors…")); + inputsButton.setTooltip ("Assign microphone / accelerometer roles to the inputs and calibrate the accelerometer"); + inputsButton.onClick = [this] + { + if (inputsWindow_ == nullptr) + inputsWindow_ = std::make_unique (processor, lightMode_); + inputsWindow_->setVisible (true); + if (auto* top = getTopLevelComponent()) + inputsWindow_->setTopLeftPosition (top->getScreenPosition() + juce::Point (40, 40)); + inputsWindow_->toFront (true); + }; + addAndMakeVisible (inputsButton); + // Full Screen toggle fullscreenButton.setColour (juce::TextButton::buttonColourId, juce::Colour (0xff3a3a3c)); fullscreenButton.setColour (juce::TextButton::buttonOnColourId, juce::Colour (0xff5ac8fa)); @@ -865,7 +894,7 @@ class SettingsComponent : public juce::Component, setupDescLabel (descFftLabel, "Spectral engine behind the L_FFT timeline overlay: window, overlap, resolution."); setupDescLabel (descSpectroLabel, "Time-frequency display shown in the Spectrogram window."); setupDescLabel (descAnalysisLabel, "Reference lines, correction filters, and comparison overlays."); - setupDescLabel (descChannelsLabel, "Mute or rename individual input channels — right-click a channel to rename it."); + setupDescLabel (descChannelsLabel, InputsUi::U ("Mute or rename input channels (right-click to rename). Roles and accelerometer calibration: Inputs & Sensors.")); addAndMakeVisible (descGeneralLabel); addAndMakeVisible (descFftLabel); addAndMakeVisible (descSpectroLabel); @@ -1076,6 +1105,7 @@ class SettingsComponent : public juce::Component, if (i < 3) gapOf (c, 3); } }); + inputsButton.setBounds (channelsCardBounds.getRight() - cardPad - 180, channelsCardBounds.getY() + cardPad, 180, 28); } void mouseDown (const juce::MouseEvent& e) override @@ -1127,6 +1157,9 @@ class SettingsComponent : public juce::Component, }; styleBtn (fftEnableButton, juce::Colour (0xff34c759)); styleBtn (fullscreenButton, juce::Colour (0xff5ac8fa)); + styleBtn (inputsButton, juce::Colour (0xff5ac8fa)); + if (inputsWindow_ != nullptr) + inputsWindow_->setLightMode (light); styleBtn (calToInputButton, juce::Colour (0xff5ac8fa)); styleBtn (winHannButton, juce::Colour (0xffbf5af2)); styleBtn (winHammingButton, juce::Colour (0xffbf5af2)); @@ -1272,6 +1305,7 @@ class SettingsComponent : public juce::Component, { bool muted = processor.apvts.getRawParameterValue ("channelMute" + juce::String (i))->load() > 0.5f; channelMuteButtons[i].setToggleState (muted, juce::dontSendNotification); + channelMuteButtons[i].setRoleTag (InputsUi::roleTag (processor.getChannelRole (i))); } } @@ -1368,6 +1402,8 @@ class SettingsComponent : public juce::Component, juce::TextButton line94Button { "94 dB Line" }; juce::TextButton fullscreenButton { "Full Screen" }; juce::TextButton calToInputButton { "Cal to Input" }; + juce::TextButton inputsButton; + std::unique_ptr inputsWindow_; juce::Label taLaermLabel; juce::ComboBox taLaermCombo; std::unique_ptr taLaermAttachment; diff --git a/Source/Vibration/CalibratorMeasurement.h b/Source/Vibration/CalibratorMeasurement.h new file mode 100644 index 0000000..61f47f2 --- /dev/null +++ b/Source/Vibration/CalibratorMeasurement.h @@ -0,0 +1,141 @@ +#pragma once +#include "Biquad.h" +#include + +namespace vib +{ +//============================================================================== +// Handheld-calibrator measurement on one raw input (vibration spec §4, method 1). +// +// A band-pass (2nd-order Butterworth HP at f_ref/2 + LP at 2·f_ref) suppresses +// hum and sensor noise. After a settling time the RMS is measured over +// sub-blocks; the frequency comes from interpolated positive zero crossings. +// The RMS is corrected by the band-pass gain at the measured frequency, so a +// calibrator slightly off its nominal frequency still reads exactly. +// +// Real-time safe: no allocation; prepare() on any thread while nobody processes. +class CalibratorMeasurement +{ +public: + enum class Status : int { Running = 0, Ok, TooLow, Clipped, FrequencyOff, Unstable }; + + static constexpr double kSettleSec = 0.5; + static constexpr double kMeasureSec = 3.0; + static constexpr double kMaxFreqDeviation = 0.05; // ±5 % + static constexpr double kMaxFluctuationDb = 0.2; // ±0.2 dB + static constexpr double kMinRmsFS = 1.0e-4; // −80 dBFS + static constexpr double kClipFS = 0.99; + + struct Result + { + Status status = Status::Running; + double rmsFS = 0.0; // band-pass corrected RMS (full scale = 1.0 peak) + double freqHz = 0.0; + double fluctuationDb = 0.0; // ± half of the sub-block RMS spread + double peakFS = 0.0; + }; + + void prepare (double fs, double refHz) + { + fs_ = fs; + refHz_ = refHz; + const double Q = 1.0 / std::sqrt (2.0); + hp_ = Biquad::highPass (0.5 * refHz, Q, fs); + lp_ = Biquad::lowPass (std::min (2.0 * refHz, 0.45 * fs), Q, fs); + + // Sub-blocks span ≥ 20 periods, so partial periods move the RMS by < 0.01 dB + subBlockLen_ = (long long) std::ceil (std::max (0.25, 20.0 / refHz) * fs); + const double measureSec = std::max (kMeasureSec, 8.0 * (double) subBlockLen_ / fs); + settleLen_ = (long long) std::ceil (kSettleSec * fs); + measureLen_ = ((long long) std::ceil (measureSec * fs) / subBlockLen_) * subBlockLen_; + reset(); + } + + void reset() noexcept + { + hp_.reset(); lp_.reset(); + n_ = 0; + sumSq_ = subSumSq_ = 0.0; + subCount_ = 0; + subMin_ = 1.0e300; subMax_ = 0.0; + prevY_ = 0.0; + crossings_ = 0; + firstCross_ = lastCross_ = 0.0; + peak_ = 0.0; + result_ = {}; + } + + bool finished() const noexcept { return result_.status != Status::Running; } + double progress() const noexcept { return std::min (1.0, (double) n_ / (double) (settleLen_ + measureLen_)); } + const Result& result() const noexcept { return result_; } + double referenceHz() const noexcept { return refHz_; } + + void process (const float* x, int numSamples) noexcept + { + for (int i = 0; i < numSamples && ! finished(); ++i) + { + const double raw = x[i]; + const double y = lp_.process (hp_.process (raw)); + const long long k = n_++; + if (k < settleLen_) + { + prevY_ = y; + continue; + } + + peak_ = std::max (peak_, std::fabs (raw)); + sumSq_ += y * y; + subSumSq_ += y * y; + + if (prevY_ < 0.0 && y >= 0.0) + { + const double t = (double) (k - 1) + prevY_ / (prevY_ - y); // interpolated + if (crossings_++ == 0) firstCross_ = t; + lastCross_ = t; + } + prevY_ = y; + + if (++subCount_ == subBlockLen_) + { + const double ms = subSumSq_ / (double) subBlockLen_; + subMin_ = std::min (subMin_, ms); + subMax_ = std::max (subMax_, ms); + subSumSq_ = 0.0; + subCount_ = 0; + } + + if (k + 1 - settleLen_ >= measureLen_) + finish(); + } + } + +private: + void finish() noexcept + { + Result r; + r.peakFS = peak_; + r.freqHz = crossings_ >= 2 ? (double) (crossings_ - 1) * fs_ / (lastCross_ - firstCross_) : 0.0; + const double gain = r.freqHz > 0.0 + ? std::abs (hp_.response (r.freqHz, fs_) * lp_.response (r.freqHz, fs_)) + : 1.0; + r.rmsFS = std::sqrt (sumSq_ / (double) measureLen_) / std::max (gain, 1.0e-6); + r.fluctuationDb = subMax_ > 0.0 && subMin_ > 0.0 ? 5.0 * std::log10 (subMax_ / subMin_) : 0.0; + + if (r.peakFS >= kClipFS) r.status = Status::Clipped; + else if (r.rmsFS < kMinRmsFS) r.status = Status::TooLow; + else if (std::fabs (r.freqHz / refHz_ - 1.0) > kMaxFreqDeviation) r.status = Status::FrequencyOff; + else if (r.fluctuationDb > kMaxFluctuationDb) r.status = Status::Unstable; + else r.status = Status::Ok; + result_ = r; + } + + double fs_ = 48000.0, refHz_ = 159.2; + Biquad hp_, lp_; + long long settleLen_ = 0, measureLen_ = 1, subBlockLen_ = 1; + long long n_ = 0, subCount_ = 0; + double sumSq_ = 0.0, subSumSq_ = 0.0, subMin_ = 1.0e300, subMax_ = 0.0; + double prevY_ = 0.0, firstCross_ = 0.0, lastCross_ = 0.0, peak_ = 0.0; + int crossings_ = 0; + Result result_; +}; +} // namespace vib diff --git a/Tests/VibrationDspTests.cpp b/Tests/VibrationDspTests.cpp index 8196360..ca787b2 100644 --- a/Tests/VibrationDspTests.cpp +++ b/Tests/VibrationDspTests.cpp @@ -1,6 +1,7 @@ #include #include #include "Vibration/AccelChannel.h" +#include "Vibration/CalibratorMeasurement.h" #include #include @@ -289,3 +290,85 @@ TEST_CASE ("Vibration chain: calibrated, weighted acceleration end to end", "[vi CHECK (dB (rms / 10.0) == Approx (dB (analogMagnitude (Weighting::Wk, f))).margin (0.1)); } } + +//============================================================================== +namespace +{ +// Feeds a generated signal to a calibrator measurement in 480-sample blocks +template +CalibratorMeasurement::Result measureCalibrator (double fs, double refHz, Signal&& signal) +{ + CalibratorMeasurement m; + m.prepare (fs, refHz); + std::vector block (480); + long long n = 0; + for (int b = 0; b < 100000 && ! m.finished(); ++b) + { + for (auto& x : block) x = (float) signal (n++ / fs); + m.process (block.data(), (int) block.size()); + } + REQUIRE (m.finished()); + CHECK (m.progress() == Approx (1.0)); + return m.result(); +} +} // namespace + +TEST_CASE ("Vibration calibrator measurement: level, frequency and acceptance", "[vibration][calibration]") +{ + using Status = CalibratorMeasurement::Status; + const double twoPi = 2.0 * kPi; + + for (double fs : { 44100.0, 48000.0, 96000.0 }) + { + INFO ("fs = " << fs); + // −20 dBFS RMS at the nominal 159.2 Hz, with hum and noise-like interference + const double amp = std::sqrt (2.0) * 0.1; + auto r = measureCalibrator (fs, 159.2, [&] (double t) + { + return amp * std::sin (twoPi * 159.2 * t) + 0.002 * std::sin (twoPi * 50.0 * t) + + 0.001 * std::sin (twoPi * 3000.0 * t); + }); + CHECK (r.status == Status::Ok); + CHECK (r.freqHz == Approx (159.2).epsilon (1e-4)); + CHECK (20.0 * std::log10 (r.rmsFS) == Approx (-20.0).margin (0.01)); + CHECK (r.fluctuationDb < 0.02); + // The calibration derived from it reads the calibrator exactly + CHECK (calibration::calDbFromCalibrator (r.rmsFS) == Approx (160.0).margin (0.01)); + } + + SECTION ("calibrator 3 % off its nominal frequency still reads the right level") + { + auto r = measureCalibrator (48000.0, 159.2, [&] (double t) { return 0.5 * std::sin (twoPi * 164.0 * t); }); + CHECK (r.status == Status::Ok); + CHECK (r.freqHz == Approx (164.0).epsilon (1e-4)); + CHECK (r.rmsFS == Approx (0.5 / std::sqrt (2.0)).epsilon (0.001)); + } + SECTION ("custom low reference frequency") + { + auto r = measureCalibrator (48000.0, 16.0, [&] (double t) { return 0.3 * std::sin (twoPi * 16.0 * t); }); + CHECK (r.status == Status::Ok); + CHECK (r.rmsFS == Approx (0.3 / std::sqrt (2.0)).epsilon (0.002)); + } + SECTION ("wrong frequency is rejected") + { + auto r = measureCalibrator (48000.0, 159.2, [&] (double t) { return 0.3 * std::sin (twoPi * 80.0 * t); }); + CHECK (r.status == Status::FrequencyOff); + } + SECTION ("fluctuating level is rejected") + { + // ±0.5 dB slow amplitude modulation + auto r = measureCalibrator (48000.0, 159.2, [&] (double t) + { + return 0.3 * (1.0 + 0.06 * std::sin (twoPi * 0.4 * t)) * std::sin (twoPi * 159.2 * t); + }); + CHECK (r.status == Status::Unstable); + CHECK (r.fluctuationDb > 0.2); + } + SECTION ("too low and clipped signals are rejected") + { + CHECK (measureCalibrator (48000.0, 159.2, [&] (double t) { return 1.0e-5 * std::sin (twoPi * 159.2 * t); }) + .status == Status::TooLow); + CHECK (measureCalibrator (48000.0, 159.2, [&] (double t) { return std::sin (twoPi * 159.2 * t); }) + .status == Status::Clipped); + } +} diff --git a/Tests/VibrationProcessorTests.cpp b/Tests/VibrationProcessorTests.cpp index 5f842e0..551563f 100644 --- a/Tests/VibrationProcessorTests.cpp +++ b/Tests/VibrationProcessorTests.cpp @@ -284,6 +284,86 @@ TEST_CASE ("Vibration in processor: settings and calibration persist in the plug CHECK (restored->getChannelRole (2) == SensorRole::AccelZ); } +TEST_CASE ("Vibration in processor: sensor info and calibration date persist", "[vibration][processor][state]") +{ + juce::ScopedJuceInitialiser_GUI juceInit; + + auto proc = std::make_unique(); + CHECK (proc->getAccelCalInfo (1).isEmpty()); + proc->setAccelSensorInfo ({ "SN 4711", 0.3, 8000.0 }); + proc->setAccelCalInfo (1, "calibrator"); + + juce::MemoryBlock blob; + proc->getStateInformation (blob); + auto restored = std::make_unique(); + restored->setStateInformation (blob.getData(), (int) blob.getSize()); + + const auto info = restored->getAccelSensorInfo(); + CHECK (info.serial == "SN 4711"); + CHECK (info.lowerLimitHz == Approx (0.3)); + CHECK (info.upperLimitHz == Approx (8000.0)); + CHECK (restored->getAccelCalInfo (1) + == juce::Time::getCurrentTime().formatted ("%Y-%m-%d") + " · calibrator"); +} + +TEST_CASE ("Vibration in processor: input level meters", "[vibration][processor]") +{ + juce::ScopedJuceInitialiser_GUI juceInit; + + Rig rig (3); + rig.prepare(); + rig.run (1.0, [] (int ch, int n) { return ch == 2 ? sine (159.2, 0.5, n) : 0.0f; }); + CHECK (rig.proc->getInputRms (2) == Approx (0.5 * kRms).epsilon (0.01)); + CHECK (rig.proc->getInputRms (0) < 1.0e-9f); + CHECK (rig.proc->takeInputPeak (2) == Approx (0.5).epsilon (0.001)); + CHECK (rig.proc->takeInputPeak (2) < 1.0e-9f); // reset by the read +} + +TEST_CASE ("Vibration in processor: calibrator measurement on a live input", "[vibration][processor][calibration]") +{ + juce::ScopedJuceInitialiser_GUI juceInit; + + Rig rig (4); + rig.proc->setChannelRole (3, SensorRole::AccelUniaxial); + vib::VibrationSettings vs; + vs.tauSec = 0.125; + rig.proc->setVibrationSettings (vs); + rig.prepare(); + vib::CalibratorMeasurement::Result r; + + // Calibrator (10 m/s² RMS) reads −26 dBFS RMS on input 4 + const double amp = std::sqrt (2.0) * std::pow (10.0, -26.0 / 20.0); + auto signal = [amp] (int ch, int n) { return ch == 3 ? sine (159.2, (float) amp, n) : 0.0f; }; + + REQUIRE_FALSE (rig.proc->startAccelCalibration (7, 159.2)); // no such input + REQUIRE (rig.proc->startAccelCalibration (3, 159.2)); + CHECK_FALSE (rig.proc->startAccelCalibration (3, 159.2)); // already running + rig.run (1.0, signal); + CHECK_FALSE (rig.proc->takeAccelCalibrationResult (r)); + CHECK (rig.proc->getAccelCalibrationProgress() > 0.2); + rig.run (3.0, signal); + REQUIRE (rig.proc->takeAccelCalibrationResult (r)); + CHECK (r.status == vib::CalibratorMeasurement::Status::Ok); + const double calDb = vib::calibration::calDbFromCalibrator (r.rmsFS); + CHECK (calDb == Approx (166.0).margin (0.01)); + + // Applying it makes the engine read the calibrator level + rig.proc->setAccelCalDb (3, calDb); + rig.run (3.0, signal); + CHECK (rig.snap().axis[vib::AxisX].rms == Approx (10.0).epsilon (0.005)); + + SECTION ("cancel stops a running measurement") + { + REQUIRE (rig.proc->startAccelCalibration (3, 159.2)); + rig.run (0.5, signal); + rig.proc->cancelAccelCalibration(); + rig.run (0.1, signal); + rig.run (5.0, signal); + CHECK_FALSE (rig.proc->takeAccelCalibrationResult (r)); + CHECK (rig.proc->startAccelCalibration (3, 159.2)); // idle again + } +} + TEST_CASE ("Vibration in processor: CPU budget", "[vibration][processor][performance]") { juce::ScopedJuceInitialiser_GUI juceInit; diff --git a/docs/VIBRATION_SPEC.md b/docs/VIBRATION_SPEC.md index 45cc154..5de882f 100644 --- a/docs/VIBRATION_SPEC.md +++ b/docs/VIBRATION_SPEC.md @@ -71,7 +71,9 @@ Stored in `UIState/Accel`: | `upperLimitHz` | 100 … fs/2 | Sensor's upper usable frequency (mounting resonance) | | `displayUnit` | m/s², mm/s, µm, g, dB | dB = dB re 1 µm/s² / 1 nm/s / 1 pm (ISO 1683) | | `kx`, `ky`, `kz` | 0 … 2 | Axis multiplying factors for the vector sum; defaults from the profile | -| `calDate` | date | Last calibration, goes into the report | +| `sensorSerial` | text | Goes into the report | + +The calibration date is stored per input (`calDate`, `calMethod` in `UIState/Inputs`), since each axis is calibrated separately. ## 4. Calibration @@ -81,7 +83,7 @@ Calibration works like `calOffset`: a per-channel dB offset that maps dBFS to ** Two methods are available, per axis, in a calibration dialog: -1. **Handheld calibrator** (preferred): the user mounts the sensor on a calibrator and selects the reference (default **10 m/s² RMS at 159.2 Hz = 140 dB**; also 1 g = 9.80665 m/s² and a custom value). SPLMeter measures for 3 s with a narrow bandpass around the reference frequency and sets `calDb`. It rejects the measurement if the frequency deviates by more than ±5 % or the level fluctuates by more than ±0.2 dB. +1. **Handheld calibrator** (preferred): the user mounts the sensor on a calibrator and selects the reference (default **10 m/s² RMS at 159.2 Hz = 140 dB**; also 1 g = 9.80665 m/s² and a custom value). SPLMeter settles for 0.5 s, then measures for 3 s behind a bandpass around the reference frequency (2nd-order Butterworth HP at f/2 and LP at 2f; the RMS is corrected by the bandpass gain at the measured frequency), and sets `calDb`. It rejects the measurement if the frequency deviates by more than ±5 % or the level fluctuates by more than ±0.2 dB. 2. **Datasheet**: sensitivity *S* in mV/(m/s²) or mV/g, plus the interface's full-scale input voltage *V_FS* (Vrms of a full-scale sine, or dBu at 0 dBFS). `calDb = 120 + 20·log10(√2 · V_FS / S)` with *V_FS* in mV RMS and *S* in mV/(m/s²). The √2 is there because sample value 1.0 is the *peak* of a full-scale sine (implemented in `Source/Vibration/Calibration.h`). @@ -178,11 +180,14 @@ A profile sets the defaults for weighting, quantity, filters, detectors, k-facto ## 7. UI -### 7.1 Settings → new "Inputs" section +### 7.1 Settings → "Inputs & Sensors" window + +The Settings window has a fixed size and no free space, so the inputs table lives in its own resizable window, opened with **Inputs & Sensors…** in the INPUT CHANNELS card (`Source/InputsComponent.h`). The channel buttons in that card show the role as a small tag (X / Y / Z / ACC / OFF). -- A table of the device's input channels (up to 8 shown; scrolls for 32): **Channel · Role · Level meter · Cal (dB) · Calibrate…** -- Role combobox: Mic / Accel X / Accel Y / Accel Z / Accel (uniaxial) / Off. -- An "Accelerometer" group appears below when any channel has an accelerometer role: profile, high-pass, lower/upper limit, unit, k-factors, sensor serial, calibration date. +- A table of the device's input channels (scrolls for up to 32): **Channel · Role · Level meter · level (dBFS for Mic, calibrated m/s² for accelerometer) · Cal (dB) · Calibrate… · last calibration (date · method)**. +- Role combobox: Mic / Accel X / Accel Y / Accel Z / Accel (uniaxial) / Off. A status line shows the detected sensor ("Triaxial accelerometer: X = IN02, …") or, in red, why the configuration is invalid; invalid rows are tinted red. +- An "Accelerometer" group appears below when any channel has an accelerometer role: quantity, high-pass, RMS τ, weighting per axis (one for uniaxial), band limits (for "Band limit"), k-factors (not for uniaxial), sensor serial, usable range (lower/upper limit). Profile (step 9) and display unit (step 6) are added with those steps. +- Calibration dialog (per input): **Handheld calibrator** (10 m/s² or 1 g at 159.2 Hz, or custom level/frequency; Measure → 0.5 s settling + 3 s measurement, `vib::CalibratorMeasurement`; result with frequency and stability, Apply) or **Datasheet** (sensitivity in mV/(m/s²) or mV/g, interface full scale in Vrms or dBu at 0 dBFS; live result, Apply). The cal value can also be typed into the table. Each apply stores `calDate` and `calMethod` (calibrator / datasheet / manual) in `UIState/Inputs`; the report uses them. - Psychoacoustic metrics, dBA/dBC and the Sound Detective continue to use the mic mix only. If no channel is `Mic`, the SPL meter shows "No microphone input" instead of meaningless values. ### 7.2 Vibration panel (below the SPL meter) From c2ce55380c8e498b60821e2718d167fc14945e4e Mon Sep 17 00:00:00 2001 From: Philipp Paul Klose Date: Thu, 12 Nov 2026 19:56:12 +0100 Subject: [PATCH 12/30] Vibration step 6: Vibration panel below the SPL meter MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - VibrationPanel: X/Y/Z/Σ rows (or one uniaxial row) with log-scaled RMS bar, interval peak tick, max-since-reset marker, RMS / max / p-p readout - Header shows quantity, weightings, RMS tau, file-mode and missing-input notes; unit selector (linear, g, dB re ISO 1683) persists in UIState/Accel - Invalid roles show a red message; panel hidden without accelerometer roles - Basic mode grows the window by the panel; advanced mode takes the height from the timeline (extendedHeight unchanged) - SPL meter shows "No microphone input" when no input has the Mic role - vib::units conversion/format helpers with unit tests Co-Authored-By: Claude Opus 5.5 --- Source/MeterComponent.cpp | 10 ++ Source/MeterComponent.h | 7 + Source/PluginEditor.cpp | 108 ++++++++++++- Source/PluginEditor.h | 7 + Source/PluginProcessor.cpp | 12 ++ Source/PluginProcessor.h | 5 + Source/Vibration/Units.h | 117 ++++++++++++++ Source/VibrationPanel.h | 249 ++++++++++++++++++++++++++++++ Tests/VibrationDspTests.cpp | 26 ++++ Tests/VibrationProcessorTests.cpp | 3 + docs/VIBRATION_SPEC.md | 11 +- 11 files changed, 547 insertions(+), 8 deletions(-) create mode 100644 Source/Vibration/Units.h create mode 100644 Source/VibrationPanel.h diff --git a/Source/MeterComponent.cpp b/Source/MeterComponent.cpp index 2d55579..7768847 100644 --- a/Source/MeterComponent.cpp +++ b/Source/MeterComponent.cpp @@ -488,6 +488,16 @@ void MeterComponent::paint (juce::Graphics& g) drawCell (0, 3, "Annoyance", juce::String (psychoAnnoyance_, 2)); } + // No input has the Mic role (vibration spec §7.1): cover readout and bar + if (noMicInput_) + { + const auto cover = juce::Rectangle (barAreaX, peakReadoutY, barAreaW, peakY + barH - peakReadoutY); + g.setColour (bgMain.withAlpha (0.94f)); + g.fillRoundedRectangle (cover, 6.0f); + g.setColour (textSecond); + g.setFont (juce::Font (juce::FontOptions().withHeight (20.0f).withStyle ("Bold"))); + g.drawText ("No microphone input", cover, juce::Justification::centred, false); + } } //============================================================================== diff --git a/Source/MeterComponent.h b/Source/MeterComponent.h index 5aad1ce..2ff6dfc 100644 --- a/Source/MeterComponent.h +++ b/Source/MeterComponent.h @@ -85,6 +85,12 @@ class MeterComponent : public juce::Component, if (lightMode_ != light) { lightMode_ = light; repaint(); } } + // All inputs are accelerometers or off: the SPL readout has no signal + void setNoMicInput (bool v) noexcept + { + if (noMicInput_ != v) { noMicInput_ = v; repaint(); } + } + private: float peakSPL_ = 0.0f; float peakDBASPL_ = 0.0f; @@ -109,6 +115,7 @@ class MeterComponent : public juce::Component, juce::String taCategoryShort_ { "WA" }; bool lightMode_ = false; + bool noMicInput_ = false; bool psychoVisible_ = true; bool dinVisible_ = true; Band selectedBand_ = Band::SPL; diff --git a/Source/PluginEditor.cpp b/Source/PluginEditor.cpp index 4618223..4fb6ee6 100644 --- a/Source/PluginEditor.cpp +++ b/Source/PluginEditor.cpp @@ -58,6 +58,8 @@ SPLMeterAudioProcessorEditor::SPLMeterAudioProcessorEditor (SPLMeterAudioProcess { addAndMakeVisible (meter); addAndMakeVisible (log); + vibPanel.onUnitChange = [this] (vib::DisplayUnit u) { audioProcessor.setVibrationDisplayUnit (u); }; + addAndMakeVisible (vibPanel); resetButton.setColour (juce::TextButton::buttonColourId, juce::Colour (0xff3a3a3c)); resetButton.setColour (juce::TextButton::textColourOffId, juce::Colour (0xffff453a)); @@ -268,7 +270,7 @@ SPLMeterAudioProcessorEditor::SPLMeterAudioProcessorEditor (SPLMeterAudioProcess if (basicMode_) { extendedHeight_ = getHeight(); - const int basicH = 100 + 215 + 24; // title + meter + build strip + const int basicH = basicHeight(); setResizeLimits (480, basicH, 3840, 2160); setSize (getWidth(), basicH); } @@ -425,7 +427,8 @@ SPLMeterAudioProcessorEditor::SPLMeterAudioProcessorEditor (SPLMeterAudioProcess dawSyncToggle.setVisible (!basicMode_); meter.setPsychoVisible (!basicMode_); meter.setDinVisible (!basicMode_); - const int basicH = 100 + 215 + 24; + updateVibrationPanel(); + const int basicH = basicHeight(); if (basicMode_) { setResizeLimits (480, basicH, 3840, 2160); @@ -510,9 +513,11 @@ void SPLMeterAudioProcessorEditor::resized() monitorGainSlider.setBounds (monitorButton.getRight() + 4, 8, 60, 80); outputVUMeter.setBounds (monitorGainSlider.getRight() + 4, 4, 22, 84); - const int meterHeight = 270; + // Basic mode shows only the top 215 px of the meter (no psycho/DIN rows) + const int meterHeight = basicMode_ ? 215 : 270; auto meterArea = area.removeFromTop (meterHeight); meter.setBounds (meterArea); + vibPanel.setBounds (area.removeFromTop (vibPanel.preferredHeight())); // FAST/SLOW buttons right-aligned in the numeric readout row of the meter // MeterComponent: margin=20, peakReadoutY=20, readoutH=40 @@ -532,6 +537,92 @@ void SPLMeterAudioProcessorEditor::resized() } //============================================================================== +bool SPLMeterAudioProcessorEditor::updateVibrationPanel() +{ + using Kind = VibrationPanel::State::Kind; + const int heightBefore = vibPanel.preferredHeight(); + + const auto roles = audioProcessor.getChannelRoles(); + const int numInputs = juce::jmin (audioProcessor.getTotalNumInputChannels(), SensorConfig::kMaxInputs); + + // Accelerometer roles on inputs this device or bus does not have + juce::StringArray missing; + bool anyAccel = false, anyMic = false; + for (int ch = 0; ch < SensorConfig::kMaxInputs; ++ch) + { + const auto r = roles[(size_t) ch]; + if (ch < numInputs) + anyMic = anyMic || r == SensorRole::Mic; + if (! SensorConfig::isAccel (r)) + continue; + anyAccel = true; + if (ch >= numInputs) + { + const char* axis[] = { "", "X", "Y", "Z", "uniaxial" }; + missing.add (audioProcessor.getChannelName (ch) + " (" + axis[(int) r] + ")"); + } + } + meter.setNoMicInput (numInputs > 0 && ! anyMic); + + VibrationPanel::State st; + st.unit = audioProcessor.getVibrationDisplayUnit(); + const auto settings = audioProcessor.getVibrationSettings(); + st.tauSec = settings.tauSec; + const auto missingText = missing.isEmpty() ? juce::String() + : missing.joinIntoString (", ") + (missing.size() == 1 ? " is" : " are") + + " not available on this input"; + + const auto validity = audioProcessor.getSensorValidity(); + if (! anyAccel) + { + st.kind = Kind::Hidden; + } + else if (! SensorConfig::isValid (validity)) + { + st.kind = Kind::Message; + st.messageIsError = true; + st.message = "Accelerometer roles are invalid (an axis is assigned twice, or uniaxial is mixed with X/Y/Z)." + " Fix them in Settings > Inputs & Sensors."; + } + else if (validity == SensorConfig::Validity::NoAccelerometer) + { + st.kind = Kind::Message; + st.message = missingText + "."; + } + else + { + st.kind = Kind::Running; + st.snap = audioProcessor.getVibrationSnapshot(); + if (! st.snap.valid) + { + // Before the first readout: lay out the rows from the configuration + st.snap = {}; + st.snap.quantity = (int) settings.quantity; + for (int ch = 0; ch < numInputs; ++ch) + { + switch (roles[(size_t) ch]) + { + case SensorRole::AccelX: st.snap.axisMask |= 1; break; + case SensorRole::AccelY: st.snap.axisMask |= 2; break; + case SensorRole::AccelZ: st.snap.axisMask |= 4; break; + case SensorRole::AccelUniaxial: st.snap.axisMask |= 1; st.snap.uniaxial = true; break; + case SensorRole::Mic: + case SensorRole::Off: break; + } + } + for (int a = 0; a < 3; ++a) + st.snap.weighting[a] = (int) settings.weighting[a]; + } + if (audioProcessor.isFileModeActive()) + st.note = "live input only, paused during file playback"; + else if (missingText.isNotEmpty()) + st.note = missingText; + } + vibPanel.setState (st); + vibPanel.setVisible (st.kind != Kind::Hidden); + return vibPanel.preferredHeight() != heightBefore; +} + void SPLMeterAudioProcessorEditor::updateModeButtons() { realTimeButton.setToggleState (!fileMode, juce::dontSendNotification); @@ -586,6 +677,7 @@ void SPLMeterAudioProcessorEditor::applyTheme (bool light) meter.setLightMode (light); log.setLightMode (light); + vibPanel.setLightMode (light); #if SPLMETER_HAS_VISQOL || JUCE_MAC if (visqolWindow != nullptr) @@ -1083,6 +1175,16 @@ void SPLMeterAudioProcessorEditor::timerCallback() audioProcessor.getTonality()); meter.setPeak (audioProcessor.getPeakSPL()); + if (updateVibrationPanel()) + { + if (basicMode_) + { + setResizeLimits (480, basicHeight(), 3840, 2160); + setSize (getWidth(), basicHeight()); + } + resized(); + } + // Compute LAeq / LCeq from log entries (energy average over logDuration) // and DIN 15905-5 LAeq,30min (sliding 30-min window over the available log) { diff --git a/Source/PluginEditor.h b/Source/PluginEditor.h index 7082ef1..1b4fbce 100644 --- a/Source/PluginEditor.h +++ b/Source/PluginEditor.h @@ -3,6 +3,7 @@ #include "PluginProcessor.h" #include "UserPrefs.h" #include "MeterComponent.h" +#include "VibrationPanel.h" #include "LogComponent.h" #include "SettingsComponent.h" #include "SpectrogramComponent.h" @@ -285,6 +286,12 @@ class SPLMeterAudioProcessorEditor : public juce::AudioProcessorEditor, MeterComponent meter; LogComponent log; + VibrationPanel vibPanel; + + // Vibration panel (spec §7.2): state from roles + snapshot; returns true when + // the panel's height changed and the layout must follow + bool updateVibrationPanel(); + int basicHeight() const { return 100 + 215 + 24 + vibPanel.preferredHeight(); } // title + meter + panel + build strip juce::TooltipWindow tooltipWindow { this, 400 }; // 400 ms delay juce::TextButton settingsButton { "Settings..." }; diff --git a/Source/PluginProcessor.cpp b/Source/PluginProcessor.cpp index 25f7505..77e925d 100644 --- a/Source/PluginProcessor.cpp +++ b/Source/PluginProcessor.cpp @@ -1101,6 +1101,18 @@ void SPLMeterAudioProcessor::setAccelSensorInfo (const AccelSensorInfo& info) node.setProperty ("upperLimitHz", info.upperLimitHz, nullptr); } +vib::DisplayUnit SPLMeterAudioProcessor::getVibrationDisplayUnit() const +{ + const auto node = apvts.state.getChildWithName ("UIState").getChildWithName (kAccelNode); + return (vib::DisplayUnit) juce::jlimit (0, (int) vib::DisplayUnit::Db, + node.isValid() ? (int) node.getProperty ("displayUnit", 0) : 0); +} + +void SPLMeterAudioProcessor::setVibrationDisplayUnit (vib::DisplayUnit unit) +{ + getUiState().getOrCreateChildWithName (kAccelNode, nullptr).setProperty ("displayUnit", (int) unit, nullptr); +} + juce::String SPLMeterAudioProcessor::getAccelCalInfo (int ch) const { const auto inputs = apvts.state.getChildWithName ("UIState").getChildWithName ("Inputs"); diff --git a/Source/PluginProcessor.h b/Source/PluginProcessor.h index 391243f..ad106af 100644 --- a/Source/PluginProcessor.h +++ b/Source/PluginProcessor.h @@ -11,6 +11,7 @@ #include "SensorConfig.h" #include "Vibration/VibrationEngine.h" #include "Vibration/CalibratorMeasurement.h" +#include "Vibration/Units.h" #include #include #include @@ -329,6 +330,10 @@ class SPLMeterAudioProcessor : public juce::AudioProcessor AccelSensorInfo getAccelSensorInfo() const; void setAccelSensorInfo (const AccelSensorInfo& info); + // Display unit of the vibration readout (UIState/Accel "displayUnit") + vib::DisplayUnit getVibrationDisplayUnit() const; + void setVibrationDisplayUnit (vib::DisplayUnit unit); + // Calibration date/method per input (UIState/Inputs "calDate", "calMethod") juce::String getAccelCalInfo (int ch) const; // e.g. "2026-11-12 · calibrator", empty if never void setAccelCalInfo (int ch, const juce::String& method); // stamps today's date diff --git a/Source/Vibration/Units.h b/Source/Vibration/Units.h new file mode 100644 index 0000000..271fa9c --- /dev/null +++ b/Source/Vibration/Units.h @@ -0,0 +1,117 @@ +#pragma once +#include "AccelChannel.h" +#include +#include +#include +#include + +namespace vib +{ +//============================================================================== +// Display units of the vibration readout (vibration spec §3.2 displayUnit). +// Detector values are SI (m/s², m/s, m); the display converts them. +// Values are persisted in UIState/Accel — only append new entries. +enum class DisplayUnit : int +{ + Linear = 0, // acceleration m/s², velocity mm/s, displacement µm + G = 1, // acceleration in g (other quantities fall back to Linear) + Db = 2 // dB re 1 µm/s² / 1 nm/s / 1 pm (ISO 1683) +}; + +namespace units +{ + // ISO 1683 reference values + inline double dbReference (Quantity q) noexcept + { + switch (q) + { + case Quantity::Velocity: return 1.0e-9; + case Quantity::Displacement: return 1.0e-12; + case Quantity::Acceleration: break; + } + return 1.0e-6; + } + + inline double levelDb (double si, Quantity q) noexcept + { + return 20.0 * std::log10 (std::max (si, 1.0e-30) / dbReference (q)); + } + + // The unit actually used (G only applies to acceleration) + inline DisplayUnit effective (DisplayUnit u, Quantity q) noexcept + { + return (u == DisplayUnit::G && q != Quantity::Acceleration) ? DisplayUnit::Linear : u; + } + + // UTF-8 unit label + inline const char* label (DisplayUnit u, Quantity q) noexcept + { + switch (effective (u, q)) + { + case DisplayUnit::G: return "g"; + case DisplayUnit::Db: + switch (q) + { + case Quantity::Velocity: return "dB re 1 nm/s"; + case Quantity::Displacement: return "dB re 1 pm"; + case Quantity::Acceleration: break; + } + return "dB re 1 \xc2\xb5m/s\xc2\xb2"; + case DisplayUnit::Linear: break; + } + switch (q) + { + case Quantity::Velocity: return "mm/s"; + case Quantity::Displacement: return "\xc2\xb5m"; + case Quantity::Acceleration: break; + } + return "m/s\xc2\xb2"; + } + + // SI value → number in the display unit + inline double convert (double si, DisplayUnit u, Quantity q) noexcept + { + switch (effective (u, q)) + { + case DisplayUnit::G: return si / calibration::kGravity; + case DisplayUnit::Db: return levelDb (si, q); + case DisplayUnit::Linear: break; + } + switch (q) + { + case Quantity::Velocity: return si * 1.0e3; + case Quantity::Displacement: return si * 1.0e6; + case Quantity::Acceleration: break; + } + return si; + } + + // Number in the display unit, 3 significant digits (dB: one decimal) + inline std::string format (double si, DisplayUnit u, Quantity q) + { + const double v = convert (si, u, q); + char buf[32]; + if (effective (u, q) == DisplayUnit::Db) + { + std::snprintf (buf, sizeof (buf), "%.1f", v); + return buf; + } + const double a = std::fabs (v); + const int decimals = a >= 100.0 ? 0 : a >= 10.0 ? 1 : a >= 1.0 ? 2 : a >= 0.1 ? 3 : 4; + std::snprintf (buf, sizeof (buf), "%.*f", decimals, v); + return buf; + } + + // Bar range of the panel in dB re the ISO 1683 reference (100 dB span) + inline void barRangeDb (Quantity q, double& lo, double& hi) noexcept + { + switch (q) + { + case Quantity::Velocity: lo = 60.0; hi = 160.0; return; // 1 µm/s … 100 mm/s + case Quantity::Displacement: lo = 80.0; hi = 180.0; return; // 10 nm … 1 mm + case Quantity::Acceleration: break; + } + lo = 60.0; hi = 160.0; // 1 mm/s² … 100 m/s² + } +} +} // namespace vib diff --git a/Source/VibrationPanel.h b/Source/VibrationPanel.h new file mode 100644 index 0000000..52c331d --- /dev/null +++ b/Source/VibrationPanel.h @@ -0,0 +1,249 @@ +#pragma once +#include +#include "Vibration/Detectors.h" +#include "Vibration/Units.h" + +//============================================================================== +// Vibration readout below the SPL meter (vibration spec §7.2): one row per axis +// plus the vector sum Σ, each with a log-scaled RMS bar, the interval peak tick, +// the maximum since reset, and the readout in the selected display unit. +class VibrationPanel : public juce::Component +{ +public: + struct State + { + enum class Kind { Hidden, Message, Running }; + Kind kind = Kind::Hidden; + juce::String message; // Kind::Message: why there is no readout + bool messageIsError = false; + juce::String note; // shown in the header, e.g. file mode + vib::VibrationSnapshot snap; + vib::DisplayUnit unit = vib::DisplayUnit::Linear; + double tauSec = 1.0; + }; + + std::function onUnitChange; + + VibrationPanel() + { + unitCombo_.onChange = [this] + { + if (onUnitChange && unitCombo_.getSelectedId() > 0) + onUnitChange ((vib::DisplayUnit) (unitCombo_.getSelectedId() - 1)); + }; + unitCombo_.setTooltip ("Display unit of the vibration readout"); + addAndMakeVisible (unitCombo_); + } + + // Height the panel needs for the current state (0 when hidden) + int preferredHeight() const noexcept + { + switch (state_.kind) + { + case State::Kind::Hidden: return 0; + case State::Kind::Message: return kPad * 2 + kHeaderH + kRowH; + case State::Kind::Running: break; + } + return kPad * 2 + kHeaderH + numRows() * kRowH; + } + + void setState (const State& s) + { + const bool unitItemsChanged = s.snap.quantity != state_.snap.quantity || ! unitItemsBuilt_; + state_ = s; + if (unitItemsChanged) + rebuildUnitItems(); + if (! unitCombo_.isPopupActive()) + unitCombo_.setSelectedId ((int) vib::units::effective (s.unit, quantity()) + 1, juce::dontSendNotification); + unitCombo_.setVisible (s.kind == State::Kind::Running); + repaint(); + } + + void setLightMode (bool light) + { + light_ = light; + unitCombo_.setColour (juce::ComboBox::backgroundColourId, light ? juce::Colour (0xffd1d1d6) : juce::Colour (0xff3a3a3c)); + unitCombo_.setColour (juce::ComboBox::textColourId, light ? juce::Colour (0xff1c1c1e) : juce::Colours::white); + unitCombo_.setColour (juce::ComboBox::outlineColourId, juce::Colours::transparentBlack); + unitCombo_.setColour (juce::ComboBox::arrowColourId, light ? juce::Colour (0xff6c6c70) : juce::Colour (0xffaeaeb2)); + repaint(); + } + + void resized() override + { + auto header = getLocalBounds().reduced (kMargin, 0).withTrimmedTop (kPad).withHeight (kHeaderH); + unitCombo_.setBounds (header.removeFromRight (150).reduced (0, 2)); + } + + void paint (juce::Graphics& g) override + { + const juce::Colour bg = light_ ? juce::Colour (0xfff2f2f7) : juce::Colour (0xff1c1c1e); + const juce::Colour card = light_ ? juce::Colour (0xffe5e5ea) : juce::Colour (0xff2c2c2e); + const juce::Colour barBg = light_ ? juce::Colour (0xffcecece) : juce::Colour (0xff3a3a3c); + const juce::Colour textPri = light_ ? juce::Colour (0xff1c1c1e) : juce::Colours::white; + const juce::Colour textSec = light_ ? juce::Colour (0xff6c6c70) : juce::Colour (0xffaeaeb2); + const juce::Colour bad = juce::Colour (0xffff453a); + + g.fillAll (bg); + if (state_.kind == State::Kind::Hidden) + return; + + auto area = getLocalBounds().reduced (kMargin / 2, 2); + g.setColour (card); + g.fillRoundedRectangle (area.toFloat(), 8.0f); + + auto content = getLocalBounds().reduced (kMargin, 0).withTrimmedTop (kPad).withTrimmedBottom (kPad); + auto header = content.removeFromTop (kHeaderH); + if (unitCombo_.isVisible()) + header.removeFromRight (160); + + g.setColour (textSec); + g.setFont (juce::Font (juce::FontOptions().withHeight (12.0f).withStyle ("Bold"))); + g.drawText ("VIBRATION", header.removeFromLeft (90), juce::Justification::centredLeft, false); + g.setFont (juce::Font (juce::FontOptions().withHeight (13.0f))); + g.drawText (headerSummary(), header, juce::Justification::centredLeft, true); + + if (state_.kind == State::Kind::Message) + { + g.setColour (state_.messageIsError ? bad : textSec); + g.setFont (juce::Font (juce::FontOptions().withHeight (14.0f))); + g.drawText (state_.message, content, juce::Justification::centredLeft, true); + return; + } + + // Columns: label | bar | RMS readout | pk max | p-p + const auto q = quantity(); + double lo, hi; + vib::units::barRangeDb (q, lo, hi); + const bool wide = content.getWidth() > 900; + for (const auto& row : rows()) + { + auto r = content.removeFromTop (kRowH); + const auto& v = state_.snap.axis[row.slot]; + + g.setColour (row.colour); + g.setFont (juce::Font (juce::FontOptions().withHeight (16.0f).withStyle ("Bold"))); + g.drawText (row.label, r.removeFromLeft (36), juce::Justification::centredLeft, false); + + auto p2pCol = wide ? r.removeFromRight (170) : juce::Rectangle(); + auto pkCol = r.removeFromRight (wide ? 170 : 150); + auto rmsCol = r.removeFromRight (wide ? 230 : 190); + auto bar = r.reduced (0, 7).toFloat(); + + // Bar: log scale, RMS fill + interval peak tick + max-since-reset marker + g.setColour (barBg); + g.fillRoundedRectangle (bar, 3.0f); + auto toX = [&] (float si) + { + const double db = vib::units::levelDb (si, q); + return bar.getX() + bar.getWidth() * (float) juce::jlimit (0.0, 1.0, (db - lo) / (hi - lo)); + }; + if (state_.snap.valid) + { + g.setColour (row.colour.withAlpha (0.85f)); + g.fillRoundedRectangle (bar.withRight (toX (v.rms)), 3.0f); + g.setColour (row.colour); + if (v.peak > 0.0f) + g.fillRect (juce::Rectangle (toX (v.peak) - 1.0f, bar.getY(), 2.0f, bar.getHeight())); + if (v.peakMax > 0.0f) + { + const float x = toX (v.peakMax); + juce::Path tri; + tri.addTriangle (x - 4.0f, bar.getY() - 1.0f, x + 4.0f, bar.getY() - 1.0f, x, bar.getY() + 5.0f); + g.setColour (textPri); + g.fillPath (tri); + } + } + + const auto unit = juce::String::fromUTF8 (vib::units::label (state_.unit, q)); + auto fmt = [&] (float si) { return state_.snap.valid ? juce::String (vib::units::format (si, state_.unit, q)) + : juce::String ("--"); }; + g.setColour (textPri); + g.setFont (juce::Font (juce::FontOptions().withHeight (20.0f).withStyle ("Bold"))); + g.drawText (fmt (v.rms), rmsCol.removeFromLeft (rmsCol.getWidth() - (wide ? 110 : 90)), + juce::Justification::centredRight, false); + g.setColour (textSec); + g.setFont (juce::Font (juce::FontOptions().withHeight (13.0f))); + g.drawText (" " + unit, rmsCol, juce::Justification::centredLeft, true); + + g.drawText ("max " + fmt (v.peakMax), pkCol.withTrimmedLeft (12), juce::Justification::centredLeft, true); + if (wide && row.slot != vib::AxisSum) + g.drawText ("p-p " + fmt (v.p2p), p2pCol, juce::Justification::centredLeft, true); + } + } + +private: + static constexpr int kMargin = 20, kPad = 8, kHeaderH = 24, kRowH = 28; + + struct Row { int slot; juce::String label; juce::Colour colour; }; + + vib::Quantity quantity() const noexcept { return (vib::Quantity) state_.snap.quantity; } + + // Axis colours as in the timeline (spec §7.3): X orange, Y cyan, Z violet, Σ neutral + std::vector rows() const + { + std::vector r; + const auto& s = state_.snap; + if (s.uniaxial) + { + const char* sym[3] = { "a", "v", "d" }; + r.push_back ({ vib::AxisX, sym[juce::jlimit (0, 2, s.quantity)], juce::Colour (0xffff9f0a) }); + return r; + } + const juce::Colour cols[3] = { juce::Colour (0xffff9f0a), juce::Colour (0xff5ac8fa), juce::Colour (0xffbf5af2) }; + const char* names[3] = { "X", "Y", "Z" }; + int axes = 0; + for (int a = 0; a < 3; ++a) + if (s.axisMask & (1 << a)) { r.push_back ({ a, names[a], cols[a] }); ++axes; } + if (axes > 1) + r.push_back ({ vib::AxisSum, juce::String::fromUTF8 ("\xce\xa3"), + light_ ? juce::Colour (0xff1c1c1e) : juce::Colours::white }); + return r; + } + + int numRows() const { return juce::jmax (1, (int) rows().size()); } + + juce::String headerSummary() const + { + if (state_.kind != State::Kind::Running) + return state_.note; + const auto& s = state_.snap; + const char* qNames[3] = { "Acceleration", "Velocity", "Displacement" }; + juce::String text = qNames[juce::jlimit (0, 2, s.quantity)]; + + juce::StringArray w; + for (int a = 0; a < 3; ++a) + if (s.axisMask & (1 << a)) + w.add (weightingShort (s.weighting[a])); + w.removeDuplicates (false); + text << juce::String::fromUTF8 (" \xc2\xb7 ") << w.joinIntoString (" / ") + << juce::String::fromUTF8 (" \xc2\xb7 RMS \xcf\x84 ") << juce::String (state_.tauSec, state_.tauSec < 1.0 ? 3 : 0) << " s"; + if (state_.note.isNotEmpty()) + text << juce::String::fromUTF8 (" \xc2\xb7 ") << state_.note; + return text; + } + + static juce::String weightingShort (int w) + { + const char* names[] = { "unweighted", "band limit", "Wb", "Wc", "Wd", "We", "Wf", "Wh", "Wj", "Wk", "Wm", "KB" }; + return (w >= 0 && w < (int) std::size (names)) ? juce::String (names[w]) : juce::String(); + } + + void rebuildUnitItems() + { + unitItemsBuilt_ = true; + const auto q = quantity(); + unitCombo_.clear (juce::dontSendNotification); + unitCombo_.addItem (juce::String::fromUTF8 (vib::units::label (vib::DisplayUnit::Linear, q)), (int) vib::DisplayUnit::Linear + 1); + if (q == vib::Quantity::Acceleration) + unitCombo_.addItem ("g", (int) vib::DisplayUnit::G + 1); + unitCombo_.addItem (juce::String::fromUTF8 (vib::units::label (vib::DisplayUnit::Db, q)), (int) vib::DisplayUnit::Db + 1); + } + + State state_; + bool light_ = false; + bool unitItemsBuilt_ = false; + juce::ComboBox unitCombo_; + + JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (VibrationPanel) +}; diff --git a/Tests/VibrationDspTests.cpp b/Tests/VibrationDspTests.cpp index ca787b2..ac6245f 100644 --- a/Tests/VibrationDspTests.cpp +++ b/Tests/VibrationDspTests.cpp @@ -2,6 +2,7 @@ #include #include "Vibration/AccelChannel.h" #include "Vibration/CalibratorMeasurement.h" +#include "Vibration/Units.h" #include #include @@ -372,3 +373,28 @@ TEST_CASE ("Vibration calibrator measurement: level, frequency and acceptance", .status == Status::Clipped); } } + +//============================================================================== +TEST_CASE ("Vibration display units: conversion, ISO 1683 levels and labels", "[vibration][units]") +{ + using namespace units; + // Linear: m/s², mm/s, µm + CHECK (convert (2.5, DisplayUnit::Linear, Quantity::Acceleration) == Approx (2.5)); + CHECK (convert (0.004, DisplayUnit::Linear, Quantity::Velocity) == Approx (4.0)); + CHECK (convert (3.0e-6, DisplayUnit::Linear, Quantity::Displacement) == Approx (3.0)); + // g only for acceleration + CHECK (convert (calibration::kGravity, DisplayUnit::G, Quantity::Acceleration) == Approx (1.0)); + CHECK (effective (DisplayUnit::G, Quantity::Velocity) == DisplayUnit::Linear); + CHECK (std::string (label (DisplayUnit::G, Quantity::Velocity)) == "mm/s"); + // dB re 1 µm/s², 1 nm/s, 1 pm + CHECK (convert (10.0, DisplayUnit::Db, Quantity::Acceleration) == Approx (140.0)); + CHECK (convert (1.0e-3, DisplayUnit::Db, Quantity::Velocity) == Approx (120.0)); + CHECK (convert (1.0e-6, DisplayUnit::Db, Quantity::Displacement) == Approx (120.0)); + CHECK (std::string (label (DisplayUnit::Db, Quantity::Displacement)) == "dB re 1 pm"); + CHECK (std::string (label (DisplayUnit::Linear, Quantity::Acceleration)) == "m/s\xc2\xb2"); + // Three significant digits + CHECK (format (0.12345, DisplayUnit::Linear, Quantity::Acceleration) == "0.123"); + CHECK (format (12.345, DisplayUnit::Linear, Quantity::Acceleration) == "12.3"); + CHECK (format (0.0012345, DisplayUnit::Linear, Quantity::Velocity) == "1.23"); + CHECK (format (10.0, DisplayUnit::Db, Quantity::Acceleration) == "140.0"); +} diff --git a/Tests/VibrationProcessorTests.cpp b/Tests/VibrationProcessorTests.cpp index 551563f..7630636 100644 --- a/Tests/VibrationProcessorTests.cpp +++ b/Tests/VibrationProcessorTests.cpp @@ -292,6 +292,8 @@ TEST_CASE ("Vibration in processor: sensor info and calibration date persist", " CHECK (proc->getAccelCalInfo (1).isEmpty()); proc->setAccelSensorInfo ({ "SN 4711", 0.3, 8000.0 }); proc->setAccelCalInfo (1, "calibrator"); + CHECK (proc->getVibrationDisplayUnit() == vib::DisplayUnit::Linear); + proc->setVibrationDisplayUnit (vib::DisplayUnit::Db); juce::MemoryBlock blob; proc->getStateInformation (blob); @@ -302,6 +304,7 @@ TEST_CASE ("Vibration in processor: sensor info and calibration date persist", " CHECK (info.serial == "SN 4711"); CHECK (info.lowerLimitHz == Approx (0.3)); CHECK (info.upperLimitHz == Approx (8000.0)); + CHECK (restored->getVibrationDisplayUnit() == vib::DisplayUnit::Db); CHECK (restored->getAccelCalInfo (1) == juce::Time::getCurrentTime().formatted ("%Y-%m-%d") + " · calibrator"); } diff --git a/docs/VIBRATION_SPEC.md b/docs/VIBRATION_SPEC.md index 5de882f..e512a94 100644 --- a/docs/VIBRATION_SPEC.md +++ b/docs/VIBRATION_SPEC.md @@ -188,7 +188,7 @@ The Settings window has a fixed size and no free space, so the inputs table live - Role combobox: Mic / Accel X / Accel Y / Accel Z / Accel (uniaxial) / Off. A status line shows the detected sensor ("Triaxial accelerometer: X = IN02, …") or, in red, why the configuration is invalid; invalid rows are tinted red. - An "Accelerometer" group appears below when any channel has an accelerometer role: quantity, high-pass, RMS τ, weighting per axis (one for uniaxial), band limits (for "Band limit"), k-factors (not for uniaxial), sensor serial, usable range (lower/upper limit). Profile (step 9) and display unit (step 6) are added with those steps. - Calibration dialog (per input): **Handheld calibrator** (10 m/s² or 1 g at 159.2 Hz, or custom level/frequency; Measure → 0.5 s settling + 3 s measurement, `vib::CalibratorMeasurement`; result with frequency and stability, Apply) or **Datasheet** (sensitivity in mV/(m/s²) or mV/g, interface full scale in Vrms or dBu at 0 dBFS; live result, Apply). The cal value can also be typed into the table. Each apply stores `calDate` and `calMethod` (calibrator / datasheet / manual) in `UIState/Inputs`; the report uses them. -- Psychoacoustic metrics, dBA/dBC and the Sound Detective continue to use the mic mix only. If no channel is `Mic`, the SPL meter shows "No microphone input" instead of meaningless values. +- Psychoacoustic metrics, dBA/dBC and the Sound Detective continue to use the mic mix only. If no channel is `Mic`, the SPL meter shows "No microphone input" over its readout and bar (step 6). ### 7.2 Vibration panel (below the SPL meter) @@ -200,10 +200,11 @@ The Settings window has a fixed size and no free space, so the inputs table live │ Σ ███████░░░░░░░ 0.35 m/s² VDV 1.8 A(8) 0.29 ● │ ``` -- Shown only when an accelerometer is configured; the editor grows by the panel's height (respecting the persisted `extendedHeight` logic). -- Bars use a log scale (dB) internally; the readout is in `displayUnit`. -- Bars are tinted when frequency content below `lowerLimitHz` dominates (unreliable reading). -- Status dot: green / amber / red against the profile's assessment (action value, zone, guideline line). +- Shown whenever an input has an accelerometer role (`Source/VibrationPanel.h`). Basic mode: the window grows by the panel's height. Advanced mode: the panel takes its height from the timeline, so the persisted `extendedHeight` is not affected. +- Per row: RMS bar on a log scale (100 dB span: 1 mm/s² … 100 m/s², 1 µm/s … 100 mm/s, 10 nm … 1 mm), the interval peak as a tick, the maximum since reset as a marker, then RMS, max and peak-to-peak (p-p only when the panel is wide) in `displayUnit`. Uniaxial sensors show one row labelled a / v / d. +- Header: quantity · weightings · RMS τ, plus notes ("live input only, paused during file playback", inputs the device lacks), and the unit selector: linear (m/s², mm/s, µm), g (acceleration only), dB re ISO 1683 reference (`vib::units`, persisted as `displayUnit` in `UIState/Accel`). +- Invalid roles show a red one-line message instead of the readout. +- Later steps: tint when content below `lowerLimitHz` dominates (needs the spectrum, with step 7/9), status dot against the profile's assessment (step 11), VDV and A(8) on the Σ row (step 10). - Light/dark mode and the iOS title-bar scaling follow existing conventions. ### 7.3 Timeline (LogComponent) From 214b85e8754afae6b6fd3d4f0287940521a0744e Mon Sep 17 00:00:00 2001 From: Philipp Paul Klose Date: Thu, 12 Nov 2026 20:28:24 +0100 Subject: [PATCH 13/30] Vibration step 7: timeline traces, CSV columns, JSON settings MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - LogEntry carries a VibrationLog block (RMS + interval peak per X/Y/Z/Σ) for live accelerometer readings - Timeline: Vib X/Y/Z/Σ toggles (persisted), traces on the right axis with automatic range in the display unit; psychoacoustic metric keeps its scale - CSV: vibration columns appended after Marker, empty without readings, so existing column positions are unchanged - JSON settings: "inputs" (roles + calibration) and "accel" blocks; files without them leave the input setup unchanged - Tests: log entries, CSV columns, JSON round trip Co-Authored-By: Claude Opus 5.5 --- Source/LogComponent.cpp | 168 +++++++++++++++++++++++++++--- Source/LogComponent.h | 7 ++ Source/PluginEditor.cpp | 27 +++-- Source/PluginEditor.h | 2 +- Source/PluginProcessor.cpp | 87 ++++++++++++++++ Source/PluginProcessor.h | 20 ++++ Source/VibrationCsv.h | 49 +++++++++ Tests/VibrationProcessorTests.cpp | 100 ++++++++++++++++++ docs/VIBRATION_SPEC.md | 10 +- 9 files changed, 443 insertions(+), 27 deletions(-) create mode 100644 Source/VibrationCsv.h diff --git a/Source/LogComponent.cpp b/Source/LogComponent.cpp index 33a15f5..c886091 100644 --- a/Source/LogComponent.cpp +++ b/Source/LogComponent.cpp @@ -24,6 +24,22 @@ const juce::Colour LogComponent::colTonality { 0xff30d158 }; // lime gree const juce::Colour LogComponent::colBassComfort { 0xff7d5fff }; // indigo const juce::Colour LogComponent::colFftIn1 { 0xff34c759 }; // green const juce::Colour LogComponent::colFftIn2 { 0xffff453a }; // red +const juce::Colour LogComponent::colVib[3] { juce::Colour (0xffff9f0a), // X orange + juce::Colour (0xff5ac8fa), // Y cyan + juce::Colour (0xffbf5af2) }; // Z violet + +namespace +{ + // Smallest 1 / 2 / 5 × 10^n ≥ v + float niceCeil (float v) + { + if (v <= 0.0f) return 1.0f; + const float p = std::pow (10.0f, std::floor (std::log10 (v))); + for (float m : { 1.0f, 2.0f, 5.0f, 10.0f }) + if (m * p >= v * 0.9999f) return m * p; + return 10.0f * p; + } +} //============================================================================== LogComponent::LogComponent (SPLMeterAudioProcessor& p) @@ -86,6 +102,20 @@ LogComponent::LogComponent (SPLMeterAudioProcessor& p) setupPsychoBtn (tonalityVisButton, colTonality, PsychoMetric::Tonality); setupPsychoBtn (bassComfortVisButton, colBassComfort, PsychoMetric::BassComfort); + // Vibration toggles: Σ and Z on by default + { + const char* names[4] = { "Vib X", "Vib Y", "Vib Z", "Vib \xce\xa3" }; + const char* keys[4] = { "logShowVibX", "logShowVibY", "logShowVibZ", "logShowVibSum" }; + for (int i = 0; i < 4; ++i) + { + auto& b = vibVisButtons_[i]; + b.setButtonText (juce::String::fromUTF8 (names[i])); + setupVisBtn (b, i < 3 ? colVib[i] : juce::Colours::white, i >= 2); + b.setVisible (false); + UserPrefs::bind (processor, b, keys[i]); + } + } + // Restore the user's last series selection and record future changes UserPrefs::bind (processor, splVisButton, "logShowSPL"); UserPrefs::bind (processor, dbaVisButton, "logShowDBA"); @@ -181,8 +211,10 @@ void LogComponent::setLightMode (bool light) noexcept &roughnessVisButton, &fluctuationVisButton, &sharpnessVisButton, &loudnessVisButton, &annoyanceVisButton, &impulsivenessVisButton, - &tonalityVisButton, &bassComfortVisButton }) + &tonalityVisButton, &bassComfortVisButton, + &vibVisButtons_[0], &vibVisButtons_[1], &vibVisButtons_[2], &vibVisButtons_[3] }) b->setColour (juce::ToggleButton::textColourId, textPrimary); + vibVisButtons_[3].setColour (juce::ToggleButton::tickColourId, textPrimary); repaint(); } @@ -206,6 +238,9 @@ void LogComponent::resized() splVisButton.setBounds (juce::Rectangle (plotX, btnY, colW, btnH).toNearestInt()); dbaVisButton.setBounds (juce::Rectangle (plotX + colW, btnY, colW, btnH).toNearestInt()); dbcVisButton.setBounds (juce::Rectangle (plotX + colW*2, btnY, colW, btnH).toNearestInt()); + for (int i = 0; i < 4; ++i) // 4th column: vibration traces + vibVisButtons_[i].setBounds (juce::Rectangle (plotX + colW * 3 + colW / 4.0f * i, btnY, + colW / 4.0f, btnH).toNearestInt()); // Row 2 — psychoacoustic (4 columns) const float row2Y = btnY + btnH + rowGap; @@ -256,6 +291,20 @@ void LogComponent::timerCallback() if (fftEnabled_) computeFftBands(); rows = processor.copyLog(); + + const auto validity = processor.getSensorValidity(); + const bool vibAvailable = SensorConfig::isValid (validity) + && validity != SensorConfig::Validity::NoAccelerometer; + const bool uniaxial = validity == SensorConfig::Validity::Uniaxial; + if (vibAvailable != vibAvailable_ || uniaxial != vibUniaxial_) + { + vibAvailable_ = vibAvailable; + vibUniaxial_ = uniaxial; + // Uniaxial: one trace, shown by the X toggle + vibVisButtons_[0].setButtonText (uniaxial ? "Vib" : "Vib X"); + for (int i = 0; i < 4; ++i) + vibVisButtons_[i].setVisible (vibAvailable && (i == 0 || ! uniaxial)); + } repaint(); } @@ -336,6 +385,71 @@ void LogComponent::paint (juce::Graphics& g) return plot.getBottom() - t * plot.getHeight(); }; + // ---- Vibration traces take the right axis (spec §7.3); a psychoacoustic + // metric shown at the same time keeps its own (unlabelled) scale ---- + const juce::Colour textPrimary = lightMode_ ? juce::Colour (0xff1c1c1e) : juce::Colours::white; + const auto vibUnit = processor.getVibrationDisplayUnit(); + bool vibOn[4]; + bool anyVibOn = false; + for (int i = 0; i < 4; ++i) + { + vibOn[i] = vibVisButtons_[i].isVisible() && vibVisButtons_[i].getToggleState(); + anyVibOn = anyVibOn || vibOn[i]; + } + int vibQuantity = -1; + for (auto it = rows.rbegin(); it != rows.rend() && anyVibOn; ++it) + if (it->vib.valid) { vibQuantity = it->vib.quantity; break; } + const bool vibDb = vib::units::effective (vibUnit, (vib::Quantity) juce::jmax (0, vibQuantity)) == vib::DisplayUnit::Db; + auto vibSlotShown = [&] (const VibrationLog& v, int slot) + { + if (! v.valid || v.quantity != vibQuantity || ! vibOn[slot]) return false; + if (slot == vib::AxisSum) + { + const int axes = (v.axisMask & 1) + ((v.axisMask >> 1) & 1) + ((v.axisMask >> 2) & 1); + return ! v.uniaxial && axes > 1; + } + return ((v.axisMask >> slot) & 1) != 0; + }; + auto vibValue = [&] (float si) { return (float) vib::units::convert (si, vibUnit, (vib::Quantity) vibQuantity); }; + float vibMin = 0.0f, vibMax = 0.0f; + bool vibAxis = false; + if (vibQuantity >= 0) + { + float lo = 1.0e30f, hi = -1.0e30f; + for (const auto& e : rows) + for (int slot = 0; slot < 4; ++slot) + if (vibSlotShown (e.vib, slot)) + { + const float v = vibValue (e.vib.rms[slot]); + lo = juce::jmin (lo, v); + hi = juce::jmax (hi, v); + } + if (hi >= lo) + { + vibAxis = true; + if (vibDb) + { + vibMax = std::ceil (hi / 10.0f) * 10.0f; + vibMin = juce::jmin (std::floor (lo / 10.0f) * 10.0f, vibMax - 20.0f); + } + else + { + vibMin = 0.0f; + vibMax = niceCeil (hi * 1.05f); + } + } + } + auto vibToY = [&] (float v) -> float { + float t = (v - vibMin) / (vibMax - vibMin); + t = juce::jlimit (0.0f, 1.0f, t); + return plot.getBottom() - t * plot.getHeight(); + }; + const float axisMin = vibAxis ? vibMin : rightMin; + const float axisMax = vibAxis ? vibMax : rightMax; + const auto axisColour = vibAxis ? textPrimary : psychoColour; + const auto axisUnit = vibAxis ? juce::String::fromUTF8 (vib::units::label (vibUnit, (vib::Quantity) vibQuantity)) + : rightUnit; + // ---- Left Y-axis grid + labels ---- g.setFont (juce::Font (juce::FontOptions().withHeight (20.0f))); { @@ -387,15 +501,18 @@ void LogComponent::paint (juce::Graphics& g) const int numTicks = 4; for (int i = 0; i <= numTicks; ++i) { - float val = rightMin + (rightMax - rightMin) * i / numTicks; - float y = rightToY (val); + float val = axisMin + (axisMax - axisMin) * i / numTicks; + float y = plot.getBottom() - plot.getHeight() * (float) i / numTicks; g.setColour (gridColour); g.drawHorizontalLine (static_cast(y), plot.getX(), plot.getRight()); - g.setColour (psychoColour.withAlpha (0.8f)); - const float range = rightMax - rightMin; - juce::String label = (range < 10.0f) - ? juce::String (val, 1) - : juce::String (static_cast(val + 0.5f)); + g.setColour (axisColour.withAlpha (0.8f)); + const float range = axisMax - axisMin; + juce::String label; + if (vibAxis && ! vibDb) + label = juce::String (val, range < 0.1f ? 4 : range < 1.0f ? 3 : range < 10.0f ? 2 : range < 100.0f ? 1 : 0); + else + label = (range < 10.0f) ? juce::String (val, 1) + : juce::String (static_cast(val + 0.5f)); g.drawText (label, static_cast(plot.getRight()) + 4, static_cast(y) - 14, static_cast(marginR) - 8, 28, @@ -406,14 +523,16 @@ void LogComponent::paint (juce::Graphics& g) { juce::Graphics::ScopedSaveState ss (g); g.setFont (juce::Font (juce::FontOptions().withHeight (18.0f).withStyle ("Bold"))); - g.setColour (psychoColour); + g.setColour (axisColour); float rx = plot.getRight() + marginR - 18.0f; + // Long vibration units sit above the zoom button + const float cy = plot.getCentreY() - (vibAxis ? 70.0f : 0.0f); g.addTransform (juce::AffineTransform::rotation ( - juce::MathConstants::halfPi, rx, plot.getCentreY())); - g.drawText (rightUnit, - static_cast(rx - 40.0f), - static_cast(plot.getCentreY()) - 10, - 80, 20, juce::Justification::centred, false); + juce::MathConstants::halfPi, rx, cy)); + g.drawText (axisUnit, + static_cast(rx - 100.0f), + static_cast(cy) - 10, + 200, 20, juce::Justification::centred, false); } } @@ -555,6 +674,27 @@ void LogComponent::paint (juce::Graphics& g) g.strokePath (path, juce::PathStrokeType (2.5f)); } + // ---- Vibration traces (right axis); gaps where there are no live readings ---- + if (vibAxis) + { + for (int slot = 0; slot < 4; ++slot) + { + if (! vibOn[slot]) continue; + juce::Path path; + bool started = false; + for (const auto& e : rows) + { + if (! vibSlotShown (e.vib, slot)) { started = false; continue; } + const float x = timeToX (e.timestampMs); + const float y = vibToY (vibValue (e.vib.rms[slot])); + if (! started) { path.startNewSubPath (x, y); started = true; } + else { path.lineTo (x, y); } + } + g.setColour (slot < 3 ? colVib[slot] : textPrimary); + g.strokePath (path, juce::PathStrokeType (slot == vib::AxisSum ? 3.0f : 2.0f)); + } + } + // ---- Sound event markers ---- { const juce::Colour flagBg (0xccff453a); diff --git a/Source/LogComponent.h b/Source/LogComponent.h index ee172e4..e506bbc 100644 --- a/Source/LogComponent.h +++ b/Source/LogComponent.h @@ -61,6 +61,13 @@ class LogComponent : public juce::Component, juce::ToggleButton tonalityVisButton { "Tonality" }; juce::ToggleButton bassComfortVisButton { "Bass LCeq-LAeq" }; + // Vibration traces X / Y / Z / Σ (vibration spec §7.3), shown when an + // accelerometer is configured; they take over the right axis + juce::ToggleButton vibVisButtons_[4]; + bool vibAvailable_ = false; + bool vibUniaxial_ = false; + static const juce::Colour colVib[3]; // X orange, Y cyan, Z violet (Σ: text colour) + // FFT static constexpr int kMaxFftOrder = 19; // 2^19 = 524288, matches PluginProcessor::kFftCircBufSize static constexpr int kMaxFftBands = 256; // enough for 1/24-Oct (~240 bands) diff --git a/Source/PluginEditor.cpp b/Source/PluginEditor.cpp index 4fb6ee6..27901fb 100644 --- a/Source/PluginEditor.cpp +++ b/Source/PluginEditor.cpp @@ -1,4 +1,5 @@ #include "PluginEditor.h" +#include "VibrationCsv.h" #include static juce::File splmeterLastFolder() { return UserPrefs::lastUsedFolder(); } @@ -693,13 +694,15 @@ void SPLMeterAudioProcessorEditor::applyTheme (bool light) //============================================================================== void SPLMeterAudioProcessorEditor::writeCsvRows (juce::OutputStream& stream, const std::vector& rows, - const std::vector& markers) + const std::vector& markers, + vib::DisplayUnit vibUnit) { stream.writeText ("Timestamp,Peak dB SPL,Peak dBA SPL,Peak dBC SPL," "RMS dB SPL,RMS dBA SPL,RMS dBC SPL," "LAeq,LCeq," "Roughness (%),Fluctuation (%),Sharpness (acum)," - "Specific Loudness (sone),Psychoacoustic Annoyance,Marker\n", + "Specific Loudness (sone),Psychoacoustic Annoyance,Marker" + + VibrationCsv::header() + "\n", false, false, nullptr); // Build a lookup: for each marker, find the closest log entry timestamp @@ -752,7 +755,8 @@ void SPLMeterAudioProcessorEditor::writeCsvRows (juce::OutputStream& stream, + juce::String (e.sharpness, 3) + "," + juce::String (e.loudnessSone, 3) + "," + juce::String (e.psychoAnnoyance, 3) + "," - + markerText + "\n"; + + markerText + + VibrationCsv::columns (e.vib, vibUnit) + "\n"; stream.writeText (line, false, false, nullptr); } } @@ -766,9 +770,10 @@ void SPLMeterAudioProcessorEditor::doSaveCsv() splmeterLastFolder().getChildFile ("SPLMeter.csv"), "*.csv"); auto markers = markerEvents_; // snapshot for async lambda + const auto vibUnit = audioProcessor.getVibrationDisplayUnit(); fileChooser->launchAsync ( juce::FileBrowserComponent::saveMode | juce::FileBrowserComponent::canSelectFiles, - [rows, markers] (const juce::FileChooser& fc) + [rows, markers, vibUnit] (const juce::FileChooser& fc) { auto file = fc.getResult(); if (file == juce::File{}) return; @@ -776,7 +781,7 @@ void SPLMeterAudioProcessorEditor::doSaveCsv() juce::FileOutputStream stream (file); if (!stream.openedOk()) return; stream.setPosition (0); stream.truncate(); - writeCsvRows (stream, rows, markers); + writeCsvRows (stream, rows, markers, vibUnit); }); } @@ -825,11 +830,12 @@ void SPLMeterAudioProcessorEditor::doSaveAll() auto rows = audioProcessor.copyLog(); auto markers = markerEvents_; auto snapshot = createComponentSnapshot (getLocalBounds()); + const auto vibUnit = audioProcessor.getVibrationDisplayUnit(); fileChooser = std::make_unique ( "Choose destination folder", splmeterLastFolder()); fileChooser->launchAsync ( juce::FileBrowserComponent::openMode | juce::FileBrowserComponent::canSelectDirectories, - [this, rows, markers, snapshot] (const juce::FileChooser& fc) + [this, rows, markers, snapshot, vibUnit] (const juce::FileChooser& fc) { auto folder = fc.getResult(); if (folder == juce::File{} || !folder.isDirectory()) return; @@ -842,7 +848,7 @@ void SPLMeterAudioProcessorEditor::doSaveAll() if (!rows.empty()) { juce::FileOutputStream csv (base.withFileExtension ("csv")); - if (csv.openedOk()) { csv.setPosition (0); csv.truncate(); writeCsvRows (csv, rows, markers); } + if (csv.openedOk()) { csv.setPosition (0); csv.truncate(); writeCsvRows (csv, rows, markers, vibUnit); } } // WAV @@ -945,6 +951,10 @@ void SPLMeterAudioProcessorEditor::doSaveSettingsJson() audioProcessor.getMidiCC (i)); r->setProperty ("midiCC", midi); + // Sensor roles, accelerometer calibration and settings (vibration spec §8) + r->setProperty ("inputs", audioProcessor.getInputsJson()); + r->setProperty ("accel", audioProcessor.getAccelJson()); + splmeterSaveLastFolder (file); file.replaceWithText (juce::JSON::toString (root, true)); }); @@ -1042,6 +1052,9 @@ void SPLMeterAudioProcessorEditor::doLoadSettingsJson() audioProcessor.setMidiCC (i, (int) midi->getProperty (id)); } + // Sensor roles + accelerometer (absent in files from ≤ 3.5.2: unchanged) + audioProcessor.setInputsAndAccelFromJson (parsed["inputs"], parsed["accel"]); + // Refresh settings window channel names if open if (settingsWindow != nullptr) if (auto* sc = dynamic_cast ( diff --git a/Source/PluginEditor.h b/Source/PluginEditor.h index 1b4fbce..69dae79 100644 --- a/Source/PluginEditor.h +++ b/Source/PluginEditor.h @@ -278,7 +278,7 @@ class SPLMeterAudioProcessorEditor : public juce::AudioProcessorEditor, void doSaveSettingsJson(); void doLoadSettingsJson(); static void writeCsvRows (juce::OutputStream&, const std::vector&, - const std::vector&); + const std::vector&, vib::DisplayUnit); SPLMeterAudioProcessor& audioProcessor; // Must stay above the child components so they are built from the restored state diff --git a/Source/PluginProcessor.cpp b/Source/PluginProcessor.cpp index 77e925d..ec99ed3 100644 --- a/Source/PluginProcessor.cpp +++ b/Source/PluginProcessor.cpp @@ -406,6 +406,7 @@ void SPLMeterAudioProcessor::processBlock (juce::AudioBuffer& buffer, if (vibActive_->process (axisIn, numSamples, ! skipMetering, vibWork_)) vibSnapshot_.write (vibWork_); } + vibLogLive_ = vibActive_ != nullptr && vibActive_->hasAxes() && ! fileMode && vibWork_.valid; // --- Live input level per channel (Inputs table) --- const int numLiveInputs = juce::jmin (getTotalNumInputChannels(), numChannels, SensorConfig::kMaxInputs); @@ -775,6 +776,19 @@ void SPLMeterAudioProcessor::pushLogEntry (float rawPk, float aPk, float cPk, e.impulsiveness = impulsiveness; e.tonality = tonality; + if (vibLogLive_) + { + e.vib.valid = true; + e.vib.quantity = vibWork_.quantity; + e.vib.axisMask = vibWork_.axisMask; + e.vib.uniaxial = vibWork_.uniaxial; + for (int a = 0; a < vib::kNumAxisSlots; ++a) + { + e.vib.rms[a] = vibWork_.axis[a].rms; + e.vib.peak[a] = vibWork_.axis[a].peak; + } + } + { const float N = loudnessSone; const float R = roughness / 100.0f; @@ -1113,6 +1127,79 @@ void SPLMeterAudioProcessor::setVibrationDisplayUnit (vib::DisplayUnit unit) getUiState().getOrCreateChildWithName (kAccelNode, nullptr).setProperty ("displayUnit", (int) unit, nullptr); } +namespace +{ + // Keys of UIState/Accel exchanged with JSON settings files + const char* const kAccelJsonKeys[] = { "highPassHz", "quantity", "weightingX", "weightingY", "weightingZ", + "kx", "ky", "kz", "bandLowHz", "bandHighHz", "tauSec", + "sensorSerial", "lowerLimitHz", "upperLimitHz", "displayUnit" }; +} + +juce::var SPLMeterAudioProcessor::getInputsJson() const +{ + juce::Array list; + const auto inputs = apvts.state.getChildWithName ("UIState").getChildWithName ("Inputs"); + for (int ch = 0; ch < SensorConfig::kMaxInputs; ++ch) + { + const auto chs = juce::String (ch); + if (getChannelRole (ch) == SensorRole::Mic && ! inputs.hasProperty ("cal" + chs)) + continue; // defaults are not written + auto* o = new juce::DynamicObject(); + o->setProperty ("channel", ch); + o->setProperty ("role", (int) getChannelRole (ch)); + o->setProperty ("calDb", getAccelCalDb (ch)); + o->setProperty ("calDate", inputs.getProperty ("calDate" + chs, juce::String())); + o->setProperty ("calMethod", inputs.getProperty ("calMethod" + chs, juce::String())); + list.add (juce::var (o)); + } + return list; +} + +juce::var SPLMeterAudioProcessor::getAccelJson() const +{ + auto* o = new juce::DynamicObject(); + const auto node = apvts.state.getChildWithName ("UIState").getChildWithName (kAccelNode); + if (node.isValid()) + for (auto* key : kAccelJsonKeys) + if (node.hasProperty (key)) + o->setProperty (key, node.getProperty (key)); + return juce::var (o); +} + +void SPLMeterAudioProcessor::setInputsAndAccelFromJson (const juce::var& inputs, const juce::var& accel) +{ + if (auto* list = inputs.getArray()) + { + auto node = getUiState().getOrCreateChildWithName ("Inputs", nullptr); + node.removeAllProperties (nullptr); // the file describes the complete input setup + for (const auto& v : *list) + { + const int ch = v.getProperty ("channel", -1); + if (ch < 0 || ch >= SensorConfig::kMaxInputs) + continue; + const auto chs = juce::String (ch); + const auto role = SensorConfig::fromInt (v.getProperty ("role", 0)); + if (role != SensorRole::Mic) + node.setProperty ("role" + chs, (int) role, nullptr); + if (v.hasProperty ("calDb")) + node.setProperty ("cal" + chs, juce::jlimit (vib::calibration::kMinCalDb, vib::calibration::kMaxCalDb, + (double) v.getProperty ("calDb", 140.0)), nullptr); + for (auto* key : { "calDate", "calMethod" }) + if (v.getProperty (key, juce::String()).toString().isNotEmpty()) + node.setProperty (key + chs, v.getProperty (key, {}), nullptr); + } + loadChannelRolesFromState(); + } + if (auto* obj = accel.getDynamicObject()) + { + auto node = getUiState().getOrCreateChildWithName (kAccelNode, nullptr); + for (auto* key : kAccelJsonKeys) + if (obj->hasProperty (key)) + node.setProperty (key, obj->getProperty (key), nullptr); + } + rebuildVibrationEngine(); // getters clamp every value +} + juce::String SPLMeterAudioProcessor::getAccelCalInfo (int ch) const { const auto inputs = apvts.state.getChildWithName ("UIState").getChildWithName ("Inputs"); diff --git a/Source/PluginProcessor.h b/Source/PluginProcessor.h index ad106af..b750840 100644 --- a/Source/PluginProcessor.h +++ b/Source/PluginProcessor.h @@ -17,6 +17,18 @@ #include //============================================================================== +// Accelerometer values of one log entry (vibration spec §7.3), SI units of the +// quantity (m/s², m/s, m). Slots X, Y, Z, Σ as vib::Axis. +struct VibrationLog +{ + bool valid = false; // live accelerometer readings in this entry + int quantity = 0; // vib::Quantity + int axisMask = 0; // present X/Y/Z + bool uniaxial = false; + float rms[4] {}; + float peak[4] {}; // max |x| in the last snapshot interval +}; + struct LogEntry { juce::int64 timestampMs; @@ -34,6 +46,7 @@ struct LogEntry float psychoAnnoyance = 0.0f; float impulsiveness = 0.0f; float tonality = 0.0f; + VibrationLog vib; }; //============================================================================== @@ -334,6 +347,12 @@ class SPLMeterAudioProcessor : public juce::AudioProcessor vib::DisplayUnit getVibrationDisplayUnit() const; void setVibrationDisplayUnit (vib::DisplayUnit unit); + // JSON settings export/import (spec §8): "inputs" (role + calibration per input) + // and "accel" (sensor settings). Import ignores absent blocks (older files). + juce::var getInputsJson() const; + juce::var getAccelJson() const; + void setInputsAndAccelFromJson (const juce::var& inputs, const juce::var& accel); + // Calibration date/method per input (UIState/Inputs "calDate", "calMethod") juce::String getAccelCalInfo (int ch) const; // e.g. "2026-11-12 · calibrator", empty if never void setAccelCalInfo (int ch, const juce::String& method); // stamps today's date @@ -384,6 +403,7 @@ class SPLMeterAudioProcessor : public juce::AudioProcessor std::atomic vibResetRequest_ { false }; vib::SeqLock vibSnapshot_; vib::VibrationSnapshot vibWork_; // audio thread + bool vibLogLive_ = false; // audio thread: vibWork_ is current // Input level meters (audio thread writes) std::array, SensorConfig::kMaxInputs> inputRms_ {}, inputPeak_ {}; diff --git a/Source/VibrationCsv.h b/Source/VibrationCsv.h new file mode 100644 index 0000000..d20d70d --- /dev/null +++ b/Source/VibrationCsv.h @@ -0,0 +1,49 @@ +#pragma once +#include +#include "PluginProcessor.h" + +//============================================================================== +// Vibration columns of the CSV log export (vibration spec §8). They are appended +// after the existing columns and left empty without accelerometer readings, so +// existing column positions never move. Values are in the display unit. +namespace VibrationCsv +{ + inline juce::String header() + { + return ",vibX_rms,vibY_rms,vibZ_rms,vibSum_rms,vibX_pk,vibY_pk,vibZ_pk,vibSum_pk,vib_main,vib_unit,vib_profile"; + } + + inline juce::String columns (const VibrationLog& v, vib::DisplayUnit unit) + { + if (! v.valid) + return ",,,,,,,,,,,"; + + const auto q = (vib::Quantity) v.quantity; + int axes = 0; + for (int a = 0; a < 3; ++a) + axes += (v.axisMask >> a) & 1; + const bool hasSum = ! v.uniaxial && axes > 1; + auto present = [&] (int slot) { return slot == vib::AxisSum ? hasSum : ((v.axisMask >> slot) & 1) != 0; }; + auto num = [&] (float si) + { + char buf[32]; + std::snprintf (buf, sizeof (buf), "%.6g", vib::units::convert (si, unit, q)); + return juce::String (buf); + }; + + juce::String s; + for (const float* values : { v.rms, v.peak }) + for (int slot = 0; slot < vib::kNumAxisSlots; ++slot) + s << ',' << (present (slot) ? num (values[slot]) : juce::String()); + + // Main value: Σ when there is a vector sum, otherwise the single axis + int mainSlot = vib::AxisSum; + if (! hasSum) + for (int a = 2; a >= 0; --a) + if (present (a)) mainSlot = a; + s << ',' << num (v.rms[mainSlot]); + s << ',' << juce::String::fromUTF8 (vib::units::label (unit, q)); + s << ','; // profile: phase 1b + return s; + } +} diff --git a/Tests/VibrationProcessorTests.cpp b/Tests/VibrationProcessorTests.cpp index 7630636..ba281ed 100644 --- a/Tests/VibrationProcessorTests.cpp +++ b/Tests/VibrationProcessorTests.cpp @@ -1,6 +1,7 @@ #include #include #include "ProcessorTestHelpers.h" +#include "VibrationCsv.h" #include @@ -367,6 +368,105 @@ TEST_CASE ("Vibration in processor: calibrator measurement on a live input", "[v } } +TEST_CASE ("Vibration in processor: log entries carry the vibration readings", "[vibration][processor][log]") +{ + juce::ScopedJuceInitialiser_GUI juceInit; + + Rig rig (4); + configureTriax (*rig.proc, 1); + rig.prepare(); + rig.run (2.0, [] (int ch, int n) { return ch == 0 ? sine (1000.0, 0.1, n) : sine (80.0, 0.5 * ch, n); }); + + const auto log = rig.proc->copyLog(); + REQUIRE (log.size() > 10); + const auto& v = log.back().vib; + REQUIRE (v.valid); + CHECK (v.axisMask == 0b111); + CHECK (v.quantity == (int) vib::Quantity::Acceleration); + for (int a = 0; a < 3; ++a) + CHECK (v.rms[a] == Approx (0.5 * (a + 1) * kRms).epsilon (0.01)); + CHECK (v.peak[vib::AxisZ] == Approx (1.5).epsilon (0.01)); + + // Without accelerometer roles the block stays invalid + Rig mic (2); + mic.prepare(); + mic.run (1.0, [] (int, int n) { return sine (1000.0, 0.1, n); }); + CHECK_FALSE (mic.proc->copyLog().back().vib.valid); +} + +TEST_CASE ("Vibration CSV columns", "[vibration][csv]") +{ + // Empty columns keep the positions when there is no accelerometer + const auto header = VibrationCsv::header(); + CHECK (header.startsWith (",vibX_rms,")); + const int numColumns = juce::StringArray::fromTokens (header, ",", "").size() - 1; + CHECK (VibrationCsv::columns ({}, vib::DisplayUnit::Linear) == juce::String::repeatedString (",", numColumns)); + + VibrationLog v; + v.valid = true; + v.quantity = (int) vib::Quantity::Acceleration; + v.axisMask = 0b101; // X and Z + v.rms[0] = 0.5f; v.rms[2] = 2.0f; v.rms[3] = 2.5f; + v.peak[0] = 1.0f; v.peak[2] = 4.0f; v.peak[3] = 4.5f; + auto cols = juce::StringArray::fromTokens (VibrationCsv::columns (v, vib::DisplayUnit::Linear).substring (1), ",", ""); + REQUIRE (cols.size() == numColumns); + CHECK (cols[0] == "0.5"); // X rms + CHECK (cols[1].isEmpty()); // Y absent + CHECK (cols[2] == "2"); // Z rms + CHECK (cols[3] == "2.5"); // Σ + CHECK (cols[7] == "4.5"); // Σ peak + CHECK (cols[8] == "2.5"); // main = Σ + CHECK (cols[9] == juce::String::fromUTF8 ("m/s\xc2\xb2")); + + // dB, uniaxial: main value is the single axis, no Σ + v.uniaxial = true; v.axisMask = 1; + cols = juce::StringArray::fromTokens (VibrationCsv::columns (v, vib::DisplayUnit::Db).substring (1), ",", ""); + CHECK (cols[3].isEmpty()); + CHECK (cols[8].getDoubleValue() == Approx (20.0 * std::log10 (0.5 / 1.0e-6)).margin (0.001)); +} + +TEST_CASE ("Vibration settings JSON export/import", "[vibration][processor][state]") +{ + juce::ScopedJuceInitialiser_GUI juceInit; + + auto src = std::make_unique(); + src->setChannelRole (1, SensorRole::AccelX); + src->setChannelRole (2, SensorRole::AccelY); + src->setChannelRole (4, SensorRole::Off); + src->setAccelCalDb (1, 151.5); + src->setAccelCalInfo (1, "datasheet"); + vib::VibrationSettings s; + s.weighting[0] = vib::Weighting::Wd; + s.tauSec = 0.5; + src->setVibrationSettings (s); + src->setAccelSensorInfo ({ "SN 1", 1.0, 5000.0 }); + src->setVibrationDisplayUnit (vib::DisplayUnit::G); + + // Through JSON text, as in the settings file + juce::var root (new juce::DynamicObject()); + root.getDynamicObject()->setProperty ("inputs", src->getInputsJson()); + root.getDynamicObject()->setProperty ("accel", src->getAccelJson()); + const auto parsed = juce::JSON::parse (juce::JSON::toString (root)); + + auto dst = std::make_unique(); + dst->setChannelRole (7, SensorRole::AccelZ); // replaced by the file's input setup + dst->setInputsAndAccelFromJson (parsed["inputs"], parsed["accel"]); + CHECK (dst->getChannelRole (1) == SensorRole::AccelX); + CHECK (dst->getChannelRole (2) == SensorRole::AccelY); + CHECK (dst->getChannelRole (4) == SensorRole::Off); + CHECK (dst->getChannelRole (7) == SensorRole::Mic); + CHECK (dst->getAccelCalDb (1) == Approx (151.5)); + CHECK (dst->getAccelCalInfo (1).endsWith ("datasheet")); + CHECK (dst->getVibrationSettings().weighting[0] == vib::Weighting::Wd); + CHECK (dst->getVibrationSettings().tauSec == Approx (0.5)); + CHECK (dst->getAccelSensorInfo().serial == "SN 1"); + CHECK (dst->getVibrationDisplayUnit() == vib::DisplayUnit::G); + + // Files from ≤ 3.5.2 have neither block: nothing changes + dst->setInputsAndAccelFromJson (juce::var(), juce::var()); + CHECK (dst->getChannelRole (1) == SensorRole::AccelX); +} + TEST_CASE ("Vibration in processor: CPU budget", "[vibration][processor][performance]") { juce::ScopedJuceInitialiser_GUI juceInit; diff --git a/docs/VIBRATION_SPEC.md b/docs/VIBRATION_SPEC.md index e512a94..3cb2db6 100644 --- a/docs/VIBRATION_SPEC.md +++ b/docs/VIBRATION_SPEC.md @@ -209,9 +209,9 @@ The Settings window has a fixed size and no free space, so the inputs table live ### 7.3 Timeline (LogComponent) -- `LogEntry` gets an optional `VibrationLog` block: per axis running RMS and peak, plus Σ and the profile's main value. -- New toggles next to dB SPL / dBA / dBC: **Vib X · Y · Z · Σ**. -- Vibration traces use the **right y-axis** (already used for psychoacoustic metrics) with its own range in `displayUnit`. If a psychoacoustic metric is shown at the same time, the vibration trace takes precedence on the right axis and the metric falls back to its normalized scale. +- `LogEntry` has a `VibrationLog` block: per slot (X, Y, Z, Σ) running RMS and interval peak in SI units, plus quantity, axis mask and uniaxial flag; `valid` only for live accelerometer readings (not in file mode). The profile's main value follows with step 9. +- New toggles in the 4th column of the "Left axis" row: **Vib X · Y · Z · Σ** (persisted as `logShowVib*`; Z and Σ on by default; uniaxial shows a single "Vib" toggle). They appear only with a valid accelerometer configuration. +- Vibration traces use the **right y-axis** with an automatic range in `displayUnit` (linear: 0 … 1/2/5·10ⁿ above the maximum; dB: 10 dB steps, ≥ 20 dB span). If a psychoacoustic metric is shown at the same time, the vibration trace takes the right-axis labels and the metric keeps its own unlabelled scale. Traces have gaps where an entry has no live reading. - Colours: X orange, Y cyan, Z violet, Σ white/black (colourblind-safe against the mic's green/red Dual FFT colours). ### 7.4 FFT and spectrogram @@ -230,8 +230,8 @@ Extend recording to **all non-Off channels** (up to 8), and write channel roles ## 8. Persistence and export - All settings in §3 live in `UIState`, so they persist across launches and are part of the plugin state (DAW sessions). -- JSON settings export/import: new `inputs` array and `accel` object. -- CSV log export: added columns `vibX_rms, vibY_rms, vibZ_rms, vibSum_rms, vibX_pk, …, vib_main, vib_unit, vib_profile`. These are empty when no accelerometer is configured, so existing column positions stay the same. +- JSON settings export/import: new `inputs` array (`channel, role, calDb, calDate, calMethod` for every non-default input) and `accel` object (the `UIState/Accel` keys). Import replaces the input setup; files without these blocks (≤ 3.5.2) leave it unchanged. +- CSV log export: columns `vibX_rms, vibY_rms, vibZ_rms, vibSum_rms, vibX_pk, vibY_pk, vibZ_pk, vibSum_pk, vib_main, vib_unit, vib_profile` appended after `Marker`, in the display unit (`%.6g`). Absent axes and entries without readings are empty, so column positions never move. `vib_main` is Σ (or the single axis) until profiles define it; `vib_profile` is empty until step 9 (`Source/VibrationCsv.h`). ## 9. Vibration report From 364de645efb19137e15a7607812c795f3d8edaf9 Mon Sep 17 00:00:00 2001 From: Philipp Paul Klose Date: Thu, 12 Nov 2026 20:43:19 +0100 Subject: [PATCH 14/30] Vibration step 8: multichannel WAV with roles + calibration, role-aware playback - With an accelerometer, the WAV recorder records every non-Off input (up to 8, 24-bit) and stores track input/name/role/calibration as JSON in the iXML (ASWG userData) chunk; without one it stays the 3.5.2 stereo file - Recorder rebuilt via lock-free hand-over (RtHandover) on layout changes - File playback reads the metadata: Mic tracks feed the SPL mix, accelerometer tracks feed a separate vibration engine with the recorded calibration; panel and timeline show the readings during playback - Transport passes up to 8 channels - Tests: recording layout, WAV round trip with metadata, playback analysis incl. Mic-only mix, layout switching Co-Authored-By: Claude Opus 5.5 --- Source/LogComponent.cpp | 9 +- Source/PluginEditor.cpp | 32 ++++- Source/PluginProcessor.cpp | 230 +++++++++++++++++++++--------- Source/PluginProcessor.h | 28 +++- Source/RtHandover.h | 67 +++++++++ Source/WavRecording.h | 147 +++++++++++++++++++ Tests/VibrationProcessorTests.cpp | 117 +++++++++++++++ docs/VIBRATION_SPEC.md | 4 +- 8 files changed, 556 insertions(+), 78 deletions(-) create mode 100644 Source/RtHandover.h create mode 100644 Source/WavRecording.h diff --git a/Source/LogComponent.cpp b/Source/LogComponent.cpp index c886091..2fbf75a 100644 --- a/Source/LogComponent.cpp +++ b/Source/LogComponent.cpp @@ -292,10 +292,11 @@ void LogComponent::timerCallback() computeFftBands(); rows = processor.copyLog(); - const auto validity = processor.getSensorValidity(); - const bool vibAvailable = SensorConfig::isValid (validity) - && validity != SensorConfig::Validity::NoAccelerometer; - const bool uniaxial = validity == SensorConfig::Validity::Uniaxial; + // Live accelerometer, or playback of a recording with one + const bool vibAvailable = processor.isVibrationAvailable(); + const auto snap = processor.getVibrationSnapshot(); + const bool uniaxial = snap.valid ? snap.uniaxial + : processor.getSensorValidity() == SensorConfig::Validity::Uniaxial; if (vibAvailable != vibAvailable_ || uniaxial != vibUniaxial_) { vibAvailable_ = vibAvailable; diff --git a/Source/PluginEditor.cpp b/Source/PluginEditor.cpp index 27901fb..02e66ee 100644 --- a/Source/PluginEditor.cpp +++ b/Source/PluginEditor.cpp @@ -574,7 +574,35 @@ bool SPLMeterAudioProcessorEditor::updateVibrationPanel() + " not available on this input"; const auto validity = audioProcessor.getSensorValidity(); - if (! anyAccel) + const bool fileVib = audioProcessor.isFileModeActive() && audioProcessor.fileHasAccelerometer(); + if (fileVib) + { + // Playback of an accelerometer recording: its own roles and calibration + st.kind = Kind::Running; + st.snap = audioProcessor.getVibrationSnapshot(); + if (! st.snap.valid) + { + st.snap = {}; + st.snap.quantity = (int) settings.quantity; + const auto tracks = audioProcessor.getFileTracks(); + for (const auto& t : tracks) + { + switch (t.role) + { + case SensorRole::AccelX: st.snap.axisMask |= 1; break; + case SensorRole::AccelY: st.snap.axisMask |= 2; break; + case SensorRole::AccelZ: st.snap.axisMask |= 4; break; + case SensorRole::AccelUniaxial: st.snap.axisMask |= 1; st.snap.uniaxial = true; break; + case SensorRole::Mic: + case SensorRole::Off: break; + } + } + for (int a = 0; a < 3; ++a) + st.snap.weighting[a] = (int) settings.weighting[a]; + } + st.note = "file playback with recorded roles and calibration"; + } + else if (! anyAccel) { st.kind = Kind::Hidden; } @@ -615,7 +643,7 @@ bool SPLMeterAudioProcessorEditor::updateVibrationPanel() st.snap.weighting[a] = (int) settings.weighting[a]; } if (audioProcessor.isFileModeActive()) - st.note = "live input only, paused during file playback"; + st.note = "the played file has no accelerometer tracks"; else if (missingText.isNotEmpty()) st.note = missingText; } diff --git a/Source/PluginProcessor.cpp b/Source/PluginProcessor.cpp index ec99ed3..9d559a1 100644 --- a/Source/PluginProcessor.cpp +++ b/Source/PluginProcessor.cpp @@ -217,14 +217,7 @@ void SPLMeterAudioProcessor::prepareToPlay (double sampleRate, int samplesPerBlo logIntervalSamples = static_cast (0.125 * sampleRate); logSampleCounter = 0; - // WAV circular buffer: sized to current logDuration - { - const float logDurS = apvts.getRawParameterValue ("logDuration")->load(); - wavBufSize_ = static_cast (logDurS * sampleRate); - wavCircBuf_[0].assign (wavBufSize_, 0.0f); - wavCircBuf_[1].assign (wavBufSize_, 0.0f); - wavWritePos_.store (0, std::memory_order_relaxed); - } + // WAV recorder: sized to the current logDuration (built after currentSampleRate is set) // 20-20k bandpass: 8th-order Butterworth Q values for each biquad stage static const double bpQ[kBpStages] = { 0.5098, 0.6013, 0.8999, 2.5629 }; @@ -250,7 +243,7 @@ void SPLMeterAudioProcessor::prepareToPlay (double sampleRate, int samplesPerBlo rebuildCorrectionFIR(); transportSource.prepareToPlay (samplesPerBlock, sampleRate); - fileReadBuffer.setSize (2, samplesPerBlock, false, true, false); + fileReadBuffer.setSize (WavRecording::kMaxTracks, samplesPerBlock, false, true, false); // capacity for 8-track files // Per-input FFT buffers: grow only (never freed while the GUI may read them). // Inputs 1 + 2 always exist so Dual FFT works on mono devices too. @@ -271,6 +264,9 @@ void SPLMeterAudioProcessor::prepareToPlay (double sampleRate, int samplesPerBlo vibActive_ = buildVibrationEngine().release(); vibWork_ = {}; vibSnapshot_.write (vibWork_); + vibFile_.replaceNow (buildFileVibrationEngine()); + vibSource_ = 0; + rebuildWavRecorder (true); // A running calibrator measurement was set up for the old rate: abandon it calState_.store (CalIdle, std::memory_order_release); @@ -393,6 +389,20 @@ void SPLMeterAudioProcessor::processBlock (juce::AudioBuffer& buffer, vibSnapshot_.write (vibWork_); // invalid until the new engine publishes } } + // File playback has its own engine (recorded roles + calibration) + if (vibFile_.acquire() && fileMode) + { + vibWork_ = {}; + vibSnapshot_.write (vibWork_); + } + auto* vibEngine = fileMode ? vibFile_.active() : vibActive_; + if (vibSource_ != (fileMode ? 1 : 0)) + { + vibSource_ = fileMode ? 1 : 0; // live ↔ file: start the readings afresh + vibWork_ = {}; + vibSnapshot_.write (vibWork_); + if (vibEngine != nullptr) vibEngine->requestReset(); + } if (vibActive_ != nullptr && vibActive_->hasAxes() && ! fileMode) { if (vibResetRequest_.exchange (false, std::memory_order_acq_rel)) @@ -406,7 +416,6 @@ void SPLMeterAudioProcessor::processBlock (juce::AudioBuffer& buffer, if (vibActive_->process (axisIn, numSamples, ! skipMetering, vibWork_)) vibSnapshot_.write (vibWork_); } - vibLogLive_ = vibActive_ != nullptr && vibActive_->hasAxes() && ! fileMode && vibWork_.valid; // --- Live input level per channel (Inputs table) --- const int numLiveInputs = juce::jmin (getTotalNumInputChannels(), numChannels, SensorConfig::kMaxInputs); @@ -446,7 +455,7 @@ void SPLMeterAudioProcessor::processBlock (juce::AudioBuffer& buffer, } if (fileMode) { - fileReadBuffer.setSize (2, numSamples, false, true, true); + fileReadBuffer.setSize (fileNumChannels_.load (std::memory_order_relaxed), numSamples, false, true, true); juce::AudioSourceChannelInfo info (&fileReadBuffer, 0, numSamples); transportSource.getNextAudioBlock (info); @@ -459,22 +468,26 @@ void SPLMeterAudioProcessor::processBlock (juce::AudioBuffer& buffer, } } - // Push Ch0 + Ch1 to WAV circular buffer (before bandpass/correction) - if (wavBufSize_ > 0) + // Accelerometer tracks of a recording (before bandpass/correction) + if (fileMode && vibEngine != nullptr && vibEngine->hasAxes()) { - const juce::AudioBuffer& wavSrc = fileMode ? fileReadBuffer : buffer; - const int nSrc = wavSrc.getNumChannels(); - const float* ch0 = nSrc > 0 ? wavSrc.getReadPointer (0) : nullptr; - const float* ch1 = nSrc > 1 ? wavSrc.getReadPointer (1) : ch0; - int pos = wavWritePos_.load (std::memory_order_relaxed); - for (int s = 0; s < numSamples; ++s) + if (vibResetRequest_.exchange (false, std::memory_order_acq_rel)) + vibEngine->requestReset(); + const float* axisIn[3]; + for (int a = 0; a < 3; ++a) { - wavCircBuf_[0][pos] = ch0 ? ch0[s] : 0.0f; - wavCircBuf_[1][pos] = ch1 ? ch1[s] : 0.0f; - if (++pos >= wavBufSize_) pos = 0; + const int ch = vibEngine->inputChannel (a); + axisIn[a] = (ch >= 0 && ch < fileReadBuffer.getNumChannels()) ? fileReadBuffer.getReadPointer (ch) : nullptr; } - wavWritePos_.store (pos, std::memory_order_release); + if (vibEngine->process (axisIn, numSamples, ! skipMetering, vibWork_)) + vibSnapshot_.write (vibWork_); } + vibLogLive_ = vibEngine != nullptr && vibEngine->hasAxes() && vibWork_.valid; + + // WAV recorder (before bandpass/correction) + wavRec_.acquire(); + if (auto* rec = wavRec_.active()) + rec->push (fileMode ? fileReadBuffer : buffer, numSamples); // 20Hz-20kHz bandpass (48dB/oct) applied per channel before mono mix if (apvts.getRawParameterValue ("bandpassEnabled")->load() > 0.5f) @@ -563,16 +576,23 @@ void SPLMeterAudioProcessor::processBlock (juce::AudioBuffer& buffer, chOut[ch] = fftChBuf_[(size_t) ch].load (std::memory_order_acquire); } + // File playback mixes its Mic tracks (all tracks for files without SPLMeter metadata) + const float* fileMicIn[WavRecording::kMaxTracks]; + int fileMicCount = 0; + if (fileMode) + for (int ch = 0; ch < juce::jmin (fileReadBuffer.getNumChannels(), WavRecording::kMaxTracks); ++ch) + if (fileRoles_[(size_t) ch].load (std::memory_order_relaxed) == (int) SensorRole::Mic) + fileMicIn[fileMicCount++] = fileReadBuffer.getReadPointer (ch); + const float fileScl = 1.0f / static_cast (juce::jmax (1, fileMicCount)); + for (int s = 0; s < numSamples; ++s) { // Mix source channels to mono float raw = 0.0f; if (fileMode) { - const int fileCh = fileReadBuffer.getNumChannels(); - const float fileScl = fileCh > 0 ? 1.0f / static_cast (fileCh) : 1.0f; - for (int ch = 0; ch < fileCh; ++ch) - raw += fileReadBuffer.getReadPointer (ch)[s]; + for (int ch = 0; ch < fileMicCount; ++ch) + raw += fileMicIn[ch][s]; raw *= fileScl; } else @@ -1042,39 +1062,62 @@ void SPLMeterAudioProcessor::setAccelCalDb (int ch, double calDb) rebuildVibrationEngine(); } -std::unique_ptr SPLMeterAudioProcessor::buildVibrationEngine() const +namespace { - vib::AxisInput axes[3]; - bool uniaxial = false; - const auto roles = getChannelRoles(); - const int numInputs = juce::jmin (getTotalNumInputChannels(), SensorConfig::kMaxInputs); - - if (SensorConfig::isValid (SensorConfig::validate (roles, numInputs))) + // Engine for the given channel roles; calOf(ch) gives the calibration of a channel + template + std::unique_ptr makeVibrationEngine (double fs, const vib::VibrationSettings& settings, + const SensorConfig::Roles& roles, int numInputs, + CalOf&& calOf) { - for (int ch = 0; ch < numInputs; ++ch) + vib::AxisInput axes[3]; + bool uniaxial = false; + if (SensorConfig::isValid (SensorConfig::validate (roles, numInputs))) { - int axis = -1; - switch (roles[(size_t) ch]) + for (int ch = 0; ch < numInputs; ++ch) { - case SensorRole::AccelX: axis = vib::AxisX; break; - case SensorRole::AccelY: axis = vib::AxisY; break; - case SensorRole::AccelZ: axis = vib::AxisZ; break; - case SensorRole::AccelUniaxial: axis = vib::AxisX; uniaxial = true; break; - case SensorRole::Mic: - case SensorRole::Off: break; + int axis = -1; + switch (roles[(size_t) ch]) + { + case SensorRole::AccelX: axis = vib::AxisX; break; + case SensorRole::AccelY: axis = vib::AxisY; break; + case SensorRole::AccelZ: axis = vib::AxisZ; break; + case SensorRole::AccelUniaxial: axis = vib::AxisX; uniaxial = true; break; + case SensorRole::Mic: + case SensorRole::Off: break; + } + if (axis >= 0) + axes[axis] = { ch, calOf (ch) }; } - if (axis >= 0) - axes[axis] = { ch, getAccelCalDb (ch) }; } + // Without a (valid) accelerometer this is an empty engine: hasAxes() == false + return std::make_unique (fs, settings, axes, uniaxial); } - // Without a (valid) accelerometer this is an empty engine: hasAxes() == false - return std::make_unique (currentSampleRate, getVibrationSettings(), axes, uniaxial); +} + +std::unique_ptr SPLMeterAudioProcessor::buildFileVibrationEngine() const +{ + auto roles = SensorConfig::defaultRoles(); + const int n = juce::jmin ((int) fileTracks_.size(), WavRecording::kMaxTracks); + for (int t = 0; t < n; ++t) + roles[(size_t) t] = fileTracks_[(size_t) t].role; + return makeVibrationEngine (currentSampleRate, getVibrationSettings(), roles, n, + [this] (int t) { return fileTracks_[(size_t) t].calDb; }); +} + +std::unique_ptr SPLMeterAudioProcessor::buildVibrationEngine() const +{ + return makeVibrationEngine (currentSampleRate, getVibrationSettings(), getChannelRoles(), + juce::jmin (getTotalNumInputChannels(), SensorConfig::kMaxInputs), + [this] (int ch) { return getAccelCalDb (ch); }); } void SPLMeterAudioProcessor::rebuildVibrationEngine() { delete vibRetired_.exchange (nullptr, std::memory_order_acq_rel); // no longer used by the audio thread delete vibPending_.exchange (buildVibrationEngine().release(), std::memory_order_acq_rel); + vibFile_.publish (buildFileVibrationEngine()); // follows settings changes + rebuildWavRecorder (false); // follows role changes } SensorConfig::Roles SPLMeterAudioProcessor::getChannelRoles() const noexcept @@ -1261,8 +1304,28 @@ void SPLMeterAudioProcessor::loadFile (const juce::File& file) auto* reader = formatManager.createReaderFor (file); if (reader == nullptr) return; + // Track roles + calibration of an SPLMeter recording (spec §7.5); other + // files: every channel is a microphone channel, as before + std::vector tracks; + if (! WavRecording::fromJson (reader->metadataValues.getValue (juce::WavAudioFormat::aswgUserData, {}), tracks)) + tracks.clear(); + const int fileChannels = (int) reader->numChannels; + tracks.resize ((size_t) juce::jmin (fileChannels, WavRecording::kMaxTracks)); // missing entries: Mic + fileTracks_ = tracks; + bool anyAccel = false; + for (int t = 0; t < WavRecording::kMaxTracks; ++t) + { + const auto role = t < (int) tracks.size() ? tracks[(size_t) t].role : SensorRole::Mic; + fileRoles_[(size_t) t].store ((int) role, std::memory_order_relaxed); + anyAccel = anyAccel || SensorConfig::isAccel (role); + } + fileHasAccel_.store (anyAccel); + fileNumChannels_.store (juce::jlimit (2, WavRecording::kMaxTracks, fileChannels)); + vibFile_.publish (buildFileVibrationEngine()); + auto newSource = std::make_unique (reader, true); - transportSource.setSource (newSource.get(), 0, nullptr, reader->sampleRate); + // Up to 8 tracks (the transport passes only 2 channels by default) + transportSource.setSource (newSource.get(), 0, nullptr, reader->sampleRate, WavRecording::kMaxTracks); readerSource = std::move (newSource); transportSource.setPosition (0.0); @@ -1549,40 +1612,73 @@ void SPLMeterAudioProcessor::clearGraphOverlay2() //============================================================================== bool SPLMeterAudioProcessor::saveWavToFile (const juce::File& destFile) { - if (wavBufSize_ <= 0 || currentSampleRate < 1.0) return false; + const auto* rec = wavRec_.current(); + if (rec == nullptr || currentSampleRate < 1.0) return false; - const float logDurS = apvts.getRawParameterValue ("logDuration")->load(); - const int numSamplesToSave = juce::jmin (wavBufSize_, - static_cast (logDurS * currentSampleRate)); + const float logDurS = apvts.getRawParameterValue ("logDuration")->load(); + const int numSamplesToSave = juce::jmin (rec->size(), static_cast (logDurS * currentSampleRate)); if (numSamplesToSave <= 0) return false; - // Snapshot: copy the most recent numSamplesToSave samples from the circular buffer. - // Reading across the audio-thread write is a benign race for audio data. - const int writePos = wavWritePos_.load (std::memory_order_acquire); + const auto snapBuf = rec->snapshot (numSamplesToSave); - juce::AudioBuffer snapBuf (2, numSamplesToSave); - float* out0 = snapBuf.getWritePointer (0); - float* out1 = snapBuf.getWritePointer (1); - - for (int s = 0; s < numSamplesToSave; ++s) + // Track roles + calibration (only for accelerometer recordings: the default + // stereo recording stays as in 3.5.2) + juce::StringPairArray metadata; + std::vector tracks; + bool anyAccel = false; + for (int input : rec->inputs()) { - const int readPos = (writePos - numSamplesToSave + s + wavBufSize_) % wavBufSize_; - out0[s] = wavCircBuf_[0][readPos]; - out1[s] = wavCircBuf_[1][readPos]; + WavRecording::Track t; + t.input = input; + t.role = getChannelRole (input); + t.calDb = getAccelCalDb (input); + t.name = getChannelName (input); + anyAccel = anyAccel || SensorConfig::isAccel (t.role); + tracks.push_back (t); } + if (anyAccel) + metadata.set (juce::WavAudioFormat::aswgUserData, WavRecording::toJson (tracks)); - // Write stereo 24-bit WAV juce::WavAudioFormat wavFmt; auto stream = std::make_unique (destFile); if (!stream->openedOk()) return false; stream->setPosition (0); stream->truncate(); - auto* writer = wavFmt.createWriterFor (stream.release(), currentSampleRate, 2, 24, {}, 0); + std::unique_ptr writer ( + wavFmt.createWriterFor (stream.get(), currentSampleRate, (unsigned int) snapBuf.getNumChannels(), + 24, metadata, 0)); if (writer == nullptr) return false; + stream.release(); // owned by the writer now + return writer->writeFromAudioSampleBuffer (snapBuf, 0, numSamplesToSave); +} + +std::vector SPLMeterAudioProcessor::getRecordedInputs() const +{ + if (const auto* rec = wavRec_.current()) + return rec->inputs(); + return {}; +} - std::unique_ptr writerOwner (writer); - return writerOwner->writeFromAudioSampleBuffer (snapBuf, 0, numSamplesToSave); +void SPLMeterAudioProcessor::rebuildWavRecorder (bool audioStopped) +{ + auto layout = WavRecording::layoutFor (getChannelRoles(), getTotalNumInputChannels()); + if (! audioStopped && layout == wavLayout_ && wavRec_.current() != nullptr) + return; // same tracks: keep the recorded history + wavLayout_ = layout; + const float logDurS = apvts.getRawParameterValue ("logDuration")->load(); + auto rec = std::make_unique (std::move (layout), + static_cast (logDurS * currentSampleRate)); + if (audioStopped) wavRec_.replaceNow (std::move (rec)); + else wavRec_.publish (std::move (rec)); +} + +bool SPLMeterAudioProcessor::isVibrationAvailable() const +{ + if (isFileModeActive()) + return fileHasAccelerometer(); + const auto v = getSensorValidity(); + return SensorConfig::isValid (v) && v != SensorConfig::Validity::NoAccelerometer; } //============================================================================== diff --git a/Source/PluginProcessor.h b/Source/PluginProcessor.h index b750840..acf2ce7 100644 --- a/Source/PluginProcessor.h +++ b/Source/PluginProcessor.h @@ -12,6 +12,8 @@ #include "Vibration/VibrationEngine.h" #include "Vibration/CalibratorMeasurement.h" #include "Vibration/Units.h" +#include "RtHandover.h" +#include "WavRecording.h" #include #include #include @@ -256,8 +258,17 @@ class SPLMeterAudioProcessor : public juce::AudioProcessor const std::vector>& getGraphOverlay2Points() const { return graphOverlay2Points_; } //========================================================================== - // WAV recorder + // WAV recorder: inputs 1 + 2, or every non-Off input (≤ 8) with an + // accelerometer, with track roles + calibration in the iXML chunk (spec §7.5) bool saveWavToFile (const juce::File& destFile); + std::vector getRecordedInputs() const; + + // File playback of an SPLMeter recording: the recorded track roles and + // calibration drive the mix and the vibration analysis + std::vector getFileTracks() const { return fileTracks_; } + bool fileHasAccelerometer() const noexcept { return fileHasAccel_.load(); } + // Vibration readings exist: live accelerometer, or playback of a recording with one + bool isVibrationAvailable() const; //========================================================================== // Impulse Fidelity @@ -534,9 +545,18 @@ class SPLMeterAudioProcessor : public juce::AudioProcessor juce::String channelNames_[32]; // WAV circular buffer: stereo (Ch0 + Ch1), sized to logDuration at prepareToPlay - std::vector wavCircBuf_[2]; - std::atomic wavWritePos_ { 0 }; - int wavBufSize_ { 0 }; + RtHandover wavRec_; + std::vector wavLayout_; // message thread: inputs of the published recorder + void rebuildWavRecorder (bool audioStopped); + + // File playback (roles per file channel; Mic for files without SPLMeter metadata) + std::array, WavRecording::kMaxTracks> fileRoles_ {}; + std::atomic fileNumChannels_ { 2 }; + std::atomic fileHasAccel_ { false }; + std::vector fileTracks_; // message thread + RtHandover vibFile_; // engine for file playback + std::unique_ptr buildFileVibrationEngine() const; + int vibSource_ = 0; // audio thread: 0 live, 1 file // Impulse Fidelity test signal generator + capture juce::AudioBuffer impFidTestSignal_; diff --git a/Source/RtHandover.h b/Source/RtHandover.h new file mode 100644 index 0000000..2c44751 --- /dev/null +++ b/Source/RtHandover.h @@ -0,0 +1,67 @@ +#pragma once +#include +#include + +//============================================================================== +// Real-time safe hand-over of an object built on the message thread. +// +// The message thread publishes a complete object; the audio thread takes it over +// at the start of a block (acquire) and parks the previous one, which the message +// thread deletes on its next publish (or in the destructor). The audio thread only +// swaps when nothing is parked, so it never allocates or frees. +// +// current() may be read on the message thread: the object it returns is only +// deleted by a later publish() on that same thread. +template +class RtHandover +{ +public: + RtHandover() = default; + ~RtHandover() + { + delete pending_.exchange (nullptr); + delete retired_.exchange (nullptr); + delete active_; + } + + // Message thread + void publish (std::unique_ptr next) + { + delete retired_.exchange (nullptr, std::memory_order_acq_rel); // no longer used by the audio thread + delete pending_.exchange (next.release(), std::memory_order_acq_rel); + } + + // Message thread while the audio thread is stopped (prepareToPlay) + void replaceNow (std::unique_ptr next) + { + delete pending_.exchange (nullptr); + delete retired_.exchange (nullptr); + delete active_; + active_ = next.release(); + current_.store (active_, std::memory_order_release); + } + + T* current() const noexcept { return current_.load (std::memory_order_acquire); } + + // Audio thread: takes over a pending object. Returns true when it swapped. + bool acquire() noexcept + { + if (pending_.load (std::memory_order_acquire) == nullptr + || retired_.load (std::memory_order_acquire) != nullptr) + return false; + auto* next = pending_.exchange (nullptr, std::memory_order_acq_rel); + if (next == nullptr) + return false; + auto* old = active_; + active_ = next; + current_.store (next, std::memory_order_release); + retired_.store (old, std::memory_order_release); + return true; + } + + T* active() const noexcept { return active_; } // audio thread + +private: + std::atomic pending_ { nullptr }, retired_ { nullptr }, current_ { nullptr }; + T* active_ = nullptr; +}; diff --git a/Source/WavRecording.h b/Source/WavRecording.h new file mode 100644 index 0000000..f60b3db --- /dev/null +++ b/Source/WavRecording.h @@ -0,0 +1,147 @@ +#pragma once +#include +#include "SensorConfig.h" + +//============================================================================== +// WAV recording (vibration spec §7.5). +// +// Without accelerometer roles the recording is unchanged from 3.5.2: inputs 1 + 2 +// (input 1 twice on mono devices). With an accelerometer it records every input +// that is not Off, up to 8. Each track's role and calibration go into the WAV as +// JSON in the iXML/ASWG "userData" field, so file playback can re-analyse the +// recording with the right roles and calibration. +namespace WavRecording +{ + static constexpr int kMaxTracks = 8; + + struct Track + { + int input = 0; // source channel (live input or file channel) + SensorRole role = SensorRole::Mic; + double calDb = 140.0; // accelerometer roles only + juce::String name; + }; + + // Inputs to record for the given roles + inline std::vector layoutFor (const SensorConfig::Roles& roles, int numInputs) + { + numInputs = juce::jmin (numInputs, SensorConfig::kMaxInputs); + bool anyAccel = false; + for (int ch = 0; ch < numInputs; ++ch) + anyAccel = anyAccel || SensorConfig::isAccel (roles[(size_t) ch]); + if (! anyAccel) + return { 0, 1 }; + + std::vector inputs; + for (int ch = 0; ch < numInputs && (int) inputs.size() < kMaxTracks; ++ch) + if (roles[(size_t) ch] != SensorRole::Off) + inputs.push_back (ch); + return inputs; + } + + //========================================================================== + // Circular buffer of the recorded tracks. Built on the message thread, + // written by the audio thread; the message thread reads a snapshot + // (reading across the write is a benign race for audio data). + class Recorder + { + public: + Recorder (std::vector inputs, int numSamples) + : inputs_ (std::move (inputs)), size_ (juce::jmax (1, numSamples)) + { + data_.resize (inputs_.size()); + for (auto& d : data_) + d.assign ((size_t) size_, 0.0f); + } + + const std::vector& inputs() const noexcept { return inputs_; } + int size() const noexcept { return size_; } + + // Audio thread. A missing source channel records input 1 for the + // second default track (mono device), silence otherwise. + void push (const juce::AudioBuffer& src, int numSamples) noexcept + { + const int nSrc = src.getNumChannels(); + const float* in[kMaxTracks] {}; + for (size_t t = 0; t < inputs_.size(); ++t) + { + const int ch = inputs_[t]; + in[t] = ch < nSrc ? src.getReadPointer (ch) + : (t == 1 && inputs_.size() == 2 && nSrc > 0 ? src.getReadPointer (0) : nullptr); + } + int pos = writePos_.load (std::memory_order_relaxed); + for (int s = 0; s < numSamples; ++s) + { + for (size_t t = 0; t < inputs_.size(); ++t) + data_[t][(size_t) pos] = in[t] != nullptr ? in[t][s] : 0.0f; + if (++pos >= size_) pos = 0; + } + writePos_.store (pos, std::memory_order_release); + } + + // Message thread: the most recent numSamples (≤ size) as a buffer + juce::AudioBuffer snapshot (int numSamples) const + { + numSamples = juce::jlimit (0, size_, numSamples); + juce::AudioBuffer out ((int) inputs_.size(), numSamples); + const int writePos = writePos_.load (std::memory_order_acquire); + for (size_t t = 0; t < inputs_.size(); ++t) + { + auto* dst = out.getWritePointer ((int) t); + for (int s = 0; s < numSamples; ++s) + dst[s] = data_[t][(size_t) ((writePos - numSamples + s + size_) % size_)]; + } + return out; + } + + private: + std::vector inputs_; + std::vector> data_; + int size_; + std::atomic writePos_ { 0 }; + }; + + //========================================================================== + // Track metadata ↔ JSON (stored in WavAudioFormat::aswgUserData) + inline juce::String toJson (const std::vector& tracks) + { + juce::Array list; + for (const auto& t : tracks) + { + auto* o = new juce::DynamicObject(); + o->setProperty ("input", t.input); + o->setProperty ("name", t.name); + o->setProperty ("role", (int) t.role); + if (SensorConfig::isAccel (t.role)) + o->setProperty ("calDb", t.calDb); + list.add (juce::var (o)); + } + auto* root = new juce::DynamicObject(); + root->setProperty ("app", "SPLMeter"); + root->setProperty ("format", 1); + root->setProperty ("tracks", list); + return juce::JSON::toString (juce::var (root), true); + } + + // Returns false when the text is not SPLMeter track metadata + inline bool fromJson (const juce::String& text, std::vector& tracks) + { + const auto root = juce::JSON::parse (text); + if (root.getProperty ("app", {}).toString() != "SPLMeter") + return false; + auto* list = root.getProperty ("tracks", {}).getArray(); + if (list == nullptr) + return false; + tracks.clear(); + for (const auto& v : *list) + { + Track t; + t.input = v.getProperty ("input", 0); + t.name = v.getProperty ("name", {}).toString(); + t.role = SensorConfig::fromInt (v.getProperty ("role", 0)); + t.calDb = v.getProperty ("calDb", 140.0); + tracks.push_back (t); + } + return true; + } +} diff --git a/Tests/VibrationProcessorTests.cpp b/Tests/VibrationProcessorTests.cpp index ba281ed..368998e 100644 --- a/Tests/VibrationProcessorTests.cpp +++ b/Tests/VibrationProcessorTests.cpp @@ -467,6 +467,123 @@ TEST_CASE ("Vibration settings JSON export/import", "[vibration][processor][stat CHECK (dst->getChannelRole (1) == SensorRole::AccelX); } +TEST_CASE ("Vibration WAV recording: tracks, metadata and file playback", "[vibration][processor][wav]") +{ + juce::ScopedJuceInitialiser_GUI juceInit; + const auto tmp = juce::File::createTempFile (".wav"); + + // Recording: mic on input 1, triax on 2–4 (cal 120 dB → 1 FS = 1 m/s²), input 5 off + { + Rig rig (5); + setParam (*rig.proc, "logDuration", 5.0f); + configureTriax (*rig.proc, 1); + rig.proc->setChannelRole (4, SensorRole::Off); + rig.prepare(); + CHECK (rig.proc->getRecordedInputs() == std::vector { 0, 1, 2, 3 }); + rig.run (5.0, [] (int ch, int n) + { + switch (ch) + { + case 0: return sine (1000.0, 0.1, n); + case 1: return sine (80.0, 0.2, n); + case 2: return sine (80.0, 0.4, n); + case 3: return sine (80.0, 0.6, n); + default: return 0.5f; + } + }); + REQUIRE (rig.proc->saveWavToFile (tmp)); + } + + // The file: 4 tracks, roles + calibration in the iXML chunk + { + juce::WavAudioFormat fmt; + std::unique_ptr reader (fmt.createReaderFor (tmp.createInputStream().release(), true)); + REQUIRE (reader != nullptr); + CHECK (reader->numChannels == 4); + CHECK (reader->bitsPerSample == 24); + std::vector tracks; + REQUIRE (WavRecording::fromJson (reader->metadataValues[juce::WavAudioFormat::aswgUserData], tracks)); + REQUIRE (tracks.size() == 4); + CHECK (tracks[0].role == SensorRole::Mic); + CHECK (tracks[1].role == SensorRole::AccelX); + CHECK (tracks[3].role == SensorRole::AccelZ); + CHECK (tracks[3].input == 3); + CHECK (tracks[2].calDb == Approx (120.0)); + + juce::AudioBuffer buf (4, (int) reader->lengthInSamples); + reader->read (&buf, 0, buf.getNumSamples(), 0, true, true); + CHECK (buf.getMagnitude (3, buf.getNumSamples() / 2, 48000) == Approx (0.6).epsilon (0.001)); + CHECK (buf.getMagnitude (0, buf.getNumSamples() / 2, 48000) == Approx (0.1).epsilon (0.001)); + } + + // Playback on a mic-only setup: recorded roles + calibration drive the analysis, + // the SPL mix uses the Mic track only + { + Rig rig (2); + rig.prepare(); + rig.proc->loadFile (tmp); + CHECK (rig.proc->fileHasAccelerometer()); + CHECK (rig.proc->isVibrationAvailable()); + rig.run (4.0, [] (int, int) { return 0.0f; }); + + const auto snap = rig.snap(); + REQUIRE (snap.valid); + CHECK (snap.axisMask == 0b111); + CHECK (snap.axis[vib::AxisX].rms == Approx (0.2 * kRms).epsilon (0.01)); + CHECK (snap.axis[vib::AxisZ].rms == Approx (0.6 * kRms).epsilon (0.01)); + CHECK (rig.proc->copyLog().back().vib.valid); + + const float calOffset = rig.proc->apvts.getRawParameterValue ("calOffset")->load(); + const float expected = 20.0f * std::log10 (0.1f * (float) kRms) + calOffset; // mic track alone + CHECK (rig.proc->copyLog().back().rmsSPL == Approx (expected).margin (0.2)); + } + tmp.deleteFile(); +} + +TEST_CASE ("Vibration WAV recording: without accelerometer it stays the 3.5.2 stereo file", "[vibration][processor][wav]") +{ + juce::ScopedJuceInitialiser_GUI juceInit; + const auto tmp = juce::File::createTempFile (".wav"); + + Rig rig (4); + setParam (*rig.proc, "logDuration", 2.0f); + rig.prepare(); + CHECK (rig.proc->getRecordedInputs() == std::vector { 0, 1 }); + rig.run (2.0, [] (int ch, int n) { return sine (440.0, 0.1 * (ch + 1), n); }); + REQUIRE (rig.proc->saveWavToFile (tmp)); + + juce::WavAudioFormat fmt; + std::unique_ptr reader (fmt.createReaderFor (tmp.createInputStream().release(), true)); + REQUIRE (reader != nullptr); + CHECK (reader->numChannels == 2); + CHECK (reader->metadataValues[juce::WavAudioFormat::aswgUserData].isEmpty()); + + // Playing it back: no accelerometer, both tracks mixed as before + Rig player (2); + player.prepare(); + player.proc->loadFile (tmp); + CHECK_FALSE (player.proc->fileHasAccelerometer()); + CHECK_FALSE (player.proc->isVibrationAvailable()); + reader.reset(); + tmp.deleteFile(); +} + +TEST_CASE ("Vibration WAV recording: role changes switch the recorded tracks", "[vibration][processor][wav]") +{ + juce::ScopedJuceInitialiser_GUI juceInit; + + Rig rig (6); + setParam (*rig.proc, "logDuration", 1.0f); + rig.prepare(); + rig.run (0.1, [] (int, int) { return 0.0f; }); + CHECK (rig.proc->getRecordedInputs() == std::vector { 0, 1 }); + + rig.proc->setChannelRole (5, SensorRole::AccelUniaxial); + rig.proc->setChannelRole (2, SensorRole::Off); + rig.run (0.1, [] (int, int) { return 0.0f; }); // audio thread takes the new recorder + CHECK (rig.proc->getRecordedInputs() == std::vector { 0, 1, 3, 4, 5 }); +} + TEST_CASE ("Vibration in processor: CPU budget", "[vibration][processor][performance]") { juce::ScopedJuceInitialiser_GUI juceInit; diff --git a/docs/VIBRATION_SPEC.md b/docs/VIBRATION_SPEC.md index 3cb2db6..7a03712 100644 --- a/docs/VIBRATION_SPEC.md +++ b/docs/VIBRATION_SPEC.md @@ -225,7 +225,9 @@ The Settings window has a fixed size and no free space, so the inputs table live ### 7.5 WAV recording -Extend recording to **all non-Off channels** (up to 8), and write channel roles and calibration as a `iXML` chunk (or a sidecar `.json`). This makes file-mode playback able to re-analyse a vibration recording with correct roles and calibration. +Without accelerometer roles the recording is unchanged from v3.5.2 (inputs 1 + 2, input 1 twice on mono devices, no metadata). With an accelerometer it records **every non-Off input** (up to 8, 24-bit) and writes each track's input, name, role and calibration as JSON into the iXML chunk's ASWG `userData` field (JUCE writes only ASWG keys into iXML; `Source/WavRecording.h`). The recorder is rebuilt (lock-free hand-over, `Source/RtHandover.h`) when the recorded inputs change; its history then starts afresh. + +File playback reads that metadata: Mic tracks feed the SPL mix (all tracks for files without metadata, as before), accelerometer tracks feed a separate vibration engine with the recorded calibration and the current accelerometer settings, so the Vibration panel, timeline and CSV work during playback. The transport passes up to 8 channels. ## 8. Persistence and export From 4ec51b05926c5b9240904c72f2ab41908d8bab7e Mon Sep 17 00:00:00 2001 From: Philipp Paul Klose Date: Thu, 12 Nov 2026 20:57:32 +0100 Subject: [PATCH 15/30] Inputs and Sensors: list all active inputs; standalone takes up to 32 inputs - Standalone accepted only 1-8 inputs; a device opening more made JUCE fall back to the first channel config {1, 1}, so only input 1 reached the app. Standalone now accepts up to 32 inputs (plugins keep 1-8) - The table lists every unmuted input, plus muted inputs with a sensor role - Rename "Inputs & Sensors" to "Inputs and Sensors" - Test: bus layout limits per wrapper type, roles on input 13 of 16 Co-Authored-By: Claude Opus 5.5 --- Source/InputsComponent.h | 34 ++++++++++++++++++++++++------- Source/PluginEditor.cpp | 2 +- Source/PluginProcessor.h | 6 +++++- Source/SettingsComponent.h | 6 +++--- Tests/VibrationProcessorTests.cpp | 31 ++++++++++++++++++++++++++++ docs/VIBRATION_SPEC.md | 6 ++++-- 6 files changed, 71 insertions(+), 14 deletions(-) diff --git a/Source/InputsComponent.h b/Source/InputsComponent.h index 53c5054..9e11967 100644 --- a/Source/InputsComponent.h +++ b/Source/InputsComponent.h @@ -4,7 +4,7 @@ #include //============================================================================== -// "Inputs & Sensors" window (vibration spec §7.1): a role per input, live level, +// "Inputs and Sensors" window (vibration spec §7.1): a role per input, live level, // accelerometer calibration, and the accelerometer sensor settings. namespace InputsUi { @@ -587,6 +587,8 @@ class InputRow : public juce::Component l->setFont (juce::Font (juce::FontOptions().withHeight (13.0f))); } + int channel() const noexcept { return ch_; } + void applyPalette (const Palette& p) { pal_ = p; @@ -699,7 +701,7 @@ class InputsComponent : public juce::Component, }; setupLabel (inputsTitle_, "INPUTS", 11.0f, true); - setupLabel (inputsDesc_, "Assign a role to each input. Only Mic inputs feed the SPL meter; " + setupLabel (inputsDesc_, "Assign a role to each active (not muted) input. Only Mic inputs feed the SPL meter; " "accelerometer inputs bypass the mix, bandpass and correction filter.", 11.5f); setupLabel (statusLabel_, {}, 13.0f, true); const juce::String headers[6] = { "Channel", "Role", "Level", "", U ("Cal (dB re 1 µm/s²)"), "Calibration" }; @@ -909,10 +911,25 @@ class InputsComponent : public juce::Component, int numInputs() const { return juce::jmin (processor_.getTotalNumInputChannels(), SensorConfig::kMaxInputs); } + // Inputs listed in the table: every active (not muted) input, plus muted ones + // that still have a sensor role, so a configured input never disappears + std::vector listedChannels() const + { + std::vector list; + for (int ch = 0; ch < numInputs(); ++ch) + { + const bool muted = processor_.apvts.getRawParameterValue ("channelMute" + juce::String (ch))->load() > 0.5f; + if (! muted || processor_.getChannelRole (ch) != SensorRole::Mic) + list.push_back (ch); + } + return list; + } + void rebuildRows() { rows_.clear(); - for (int ch = 0; ch < numInputs(); ++ch) + listed_ = listedChannels(); + for (int ch : listed_) { auto row = std::make_unique (processor_, ch); row->applyPalette (pal_); @@ -975,7 +992,7 @@ class InputsComponent : public juce::Component, void timerCallback() override { - if ((int) rows_.size() != numInputs()) + if (listedChannels() != listed_) rebuildRows(); const auto roles = processor_.getChannelRoles(); @@ -1023,12 +1040,14 @@ class InputsComponent : public juce::Component, text << U (" No Mic input — the SPL meter has no signal."); if (valid) col = pal_.warn; } + if (listed_.empty()) + text = "All inputs are muted. Unmute inputs in Settings to assign roles."; statusLabel_.setText (text, juce::dontSendNotification); statusLabel_.setColour (juce::Label::textColourId, col); // Rows: with an invalid configuration, every accelerometer row is marked - for (int ch = 0; ch < (int) rows_.size(); ++ch) - rows_[(size_t) ch]->refresh (! valid && SensorConfig::isAccel (roles[(size_t) ch])); + for (auto& row : rows_) + row->refresh (! valid && SensorConfig::isAccel (roles[(size_t) row->channel()])); // Accelerometer group: shown when any input has an accelerometer role bool anyAccel = false; @@ -1089,6 +1108,7 @@ class InputsComponent : public juce::Component, juce::Viewport viewport_; juce::Component rowsHolder_; std::vector> rows_; + std::vector listed_; juce::Label accelTitle_, accelDesc_; juce::Label quantityLabel_, highPassLabel_, tauLabel_, bandLabel_, serialLabel_, rangeLabel_; @@ -1109,7 +1129,7 @@ class InputsWindow : public juce::DocumentWindow { public: InputsWindow (SPLMeterAudioProcessor& p, bool light) - : juce::DocumentWindow ("Inputs & Sensors", juce::Colour (0xff1c1c1e), juce::DocumentWindow::closeButton) + : juce::DocumentWindow ("Inputs and Sensors", juce::Colour (0xff1c1c1e), juce::DocumentWindow::closeButton) { setUsingNativeTitleBar (false); content_ = new InputsComponent (p, light); diff --git a/Source/PluginEditor.cpp b/Source/PluginEditor.cpp index 02e66ee..3e36c18 100644 --- a/Source/PluginEditor.cpp +++ b/Source/PluginEditor.cpp @@ -611,7 +611,7 @@ bool SPLMeterAudioProcessorEditor::updateVibrationPanel() st.kind = Kind::Message; st.messageIsError = true; st.message = "Accelerometer roles are invalid (an axis is assigned twice, or uniaxial is mixed with X/Y/Z)." - " Fix them in Settings > Inputs & Sensors."; + " Fix them in Settings > Inputs and Sensors."; } else if (validity == SensorConfig::Validity::NoAccelerometer) { diff --git a/Source/PluginProcessor.h b/Source/PluginProcessor.h index acf2ce7..a9d0d4f 100644 --- a/Source/PluginProcessor.h +++ b/Source/PluginProcessor.h @@ -69,8 +69,12 @@ class SPLMeterAudioProcessor : public juce::AudioProcessor bool isBusesLayoutSupported (const BusesLayout& layouts) const override { + // The standalone app takes every input the device opens (up to the 32 + // mute/role slots); plugins keep 1–8 (vibration spec §10). Rejecting a + // device with more inputs would make JUCE fall back to a single input. + const int maxIns = wrapperType == wrapperType_Standalone ? SensorConfig::kMaxInputs : 8; int n = layouts.getMainInputChannels(); - return n >= 1 && n <= 8; + return n >= 1 && n <= maxIns; } //========================================================================== diff --git a/Source/SettingsComponent.h b/Source/SettingsComponent.h index 0961dd2..d789ffc 100644 --- a/Source/SettingsComponent.h +++ b/Source/SettingsComponent.h @@ -832,8 +832,8 @@ class SettingsComponent : public juce::Component, addAndMakeVisible (channelMuteButtons[i]); } - // Inputs & Sensors window: sensor roles, accelerometer calibration (vibration spec §7.1) - inputsButton.setButtonText (InputsUi::U ("Inputs & Sensors…")); + // Inputs and Sensors window: sensor roles, accelerometer calibration (vibration spec §7.1) + inputsButton.setButtonText (InputsUi::U ("Inputs and Sensors…")); inputsButton.setTooltip ("Assign microphone / accelerometer roles to the inputs and calibrate the accelerometer"); inputsButton.onClick = [this] { @@ -894,7 +894,7 @@ class SettingsComponent : public juce::Component, setupDescLabel (descFftLabel, "Spectral engine behind the L_FFT timeline overlay: window, overlap, resolution."); setupDescLabel (descSpectroLabel, "Time-frequency display shown in the Spectrogram window."); setupDescLabel (descAnalysisLabel, "Reference lines, correction filters, and comparison overlays."); - setupDescLabel (descChannelsLabel, InputsUi::U ("Mute or rename input channels (right-click to rename). Roles and accelerometer calibration: Inputs & Sensors.")); + setupDescLabel (descChannelsLabel, InputsUi::U ("Mute or rename input channels (right-click to rename). Roles and accelerometer calibration: Inputs and Sensors.")); addAndMakeVisible (descGeneralLabel); addAndMakeVisible (descFftLabel); addAndMakeVisible (descSpectroLabel); diff --git a/Tests/VibrationProcessorTests.cpp b/Tests/VibrationProcessorTests.cpp index 368998e..3be626f 100644 --- a/Tests/VibrationProcessorTests.cpp +++ b/Tests/VibrationProcessorTests.cpp @@ -614,3 +614,34 @@ TEST_CASE ("Vibration in processor: CPU budget", "[vibration][processor][perform << withVib * 1000.0 << " ms → vibration overhead " << overheadPct << " % of one core"); CHECK (overheadPct < 5.0); } + +TEST_CASE ("Input bus: standalone takes up to 32 inputs, plugins 1-8", "[vibration][processor][bus]") +{ + juce::ScopedJuceInitialiser_GUI juceInit; + + auto layoutWith = [] (SPLMeterAudioProcessor& p, int inputs) + { + auto layout = p.getBusesLayout(); + layout.inputBuses.getReference (0) = juce::AudioChannelSet::discreteChannels (inputs); + return p.checkBusesLayoutSupported (layout); + }; + + juce::AudioProcessor::setTypeOfNextNewPlugin (juce::AudioProcessor::wrapperType_Standalone); + auto standalone = std::make_unique(); + juce::AudioProcessor::setTypeOfNextNewPlugin (juce::AudioProcessor::wrapperType_Undefined); + CHECK (layoutWith (*standalone, 1)); + CHECK (layoutWith (*standalone, 18)); + CHECK (layoutWith (*standalone, 32)); + CHECK_FALSE (layoutWith (*standalone, 33)); + + auto plugin = std::make_unique(); + CHECK (layoutWith (*plugin, 8)); + CHECK_FALSE (layoutWith (*plugin, 18)); + + // A 16-input standalone device: roles on input 12+ work end to end + REQUIRE (standalone->setBusesLayout ([&] { auto l = standalone->getBusesLayout(); + l.inputBuses.getReference (0) = juce::AudioChannelSet::discreteChannels (16); + return l; }())); + standalone->setChannelRole (12, SensorRole::AccelUniaxial); + CHECK (standalone->getSensorValidity() == SensorConfig::Validity::Uniaxial); +} diff --git a/docs/VIBRATION_SPEC.md b/docs/VIBRATION_SPEC.md index 7a03712..1149e4d 100644 --- a/docs/VIBRATION_SPEC.md +++ b/docs/VIBRATION_SPEC.md @@ -180,9 +180,9 @@ A profile sets the defaults for weighting, quantity, filters, detectors, k-facto ## 7. UI -### 7.1 Settings → "Inputs & Sensors" window +### 7.1 Settings → "Inputs and Sensors" window -The Settings window has a fixed size and no free space, so the inputs table lives in its own resizable window, opened with **Inputs & Sensors…** in the INPUT CHANNELS card (`Source/InputsComponent.h`). The channel buttons in that card show the role as a small tag (X / Y / Z / ACC / OFF). +The Settings window has a fixed size and no free space, so the inputs table lives in its own resizable window, opened with **Inputs and Sensors…** in the INPUT CHANNELS card (`Source/InputsComponent.h`). The channel buttons in that card show the role as a small tag (X / Y / Z / ACC / OFF). - A table of the device's input channels (scrolls for up to 32): **Channel · Role · Level meter · level (dBFS for Mic, calibrated m/s² for accelerometer) · Cal (dB) · Calibrate… · last calibration (date · method)**. - Role combobox: Mic / Accel X / Accel Y / Accel Z / Accel (uniaxial) / Off. A status line shows the detected sensor ("Triaxial accelerometer: X = IN02, …") or, in red, why the configuration is invalid; invalid rows are tinted red. @@ -295,6 +295,8 @@ All limit values ship as **editable defaults** in Settings; the report lists the ## 10. Plugin specifics - Input bus: keep 1–8 channels for VST3/AU. Accelerometer roles only make sense when the host provides more than 2 channels. With a stereo track, the Inputs table shows only channels 1–2. +- Standalone: 1–32 inputs (all the device opens, up to the 32 mute/role slots). Before 3.6, devices with more than 8 open inputs fell back to a single input, because JUCE's player uses the first channel configuration `{1, 1}` when the device layout is rejected. +- The Inputs and Sensors table lists every active (not muted) input, plus muted inputs that still have a sensor role. - DAW sync and pause behaviour apply to vibration detectors as they do to SPL. - Vibration values are not exposed as automatable output parameters in this version. From 2141ed9724196bee6431a53a46ea18fdf300a325 Mon Sep 17 00:00:00 2001 From: Philipp Paul Klose Date: Thu, 12 Nov 2026 21:07:18 +0100 Subject: [PATCH 16/30] Vibration step 9: measurement profiles MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Profiles.h: the eight spec §6 profiles (structure-borne, machinery ISO 20816 + low speed, whole-body health/comfort, hand-arm, building perception/structural) with quantity, weighting, band, high-pass, k, RMS tau, main value and display unit - Base profile persists; edits show "Custom (based on ...)" - Main value (max axis RMS, max k*axis RMS, sum RMS, max peak since reset) computed into every snapshot and log entry; shown in the panel header, written to CSV vib_main, profile key in vib_profile - Inputs and Sensors: profile and main value selectors - Tests: profile definitions, custom detection, main values, processor apply/persist/CSV Co-Authored-By: Claude Opus 5.5 --- Source/InputsComponent.h | 54 ++++++++++- Source/PluginEditor.cpp | 23 +++-- Source/PluginEditor.h | 3 +- Source/PluginProcessor.cpp | 43 ++++++++- Source/PluginProcessor.h | 11 +++ Source/Vibration/Detectors.h | 2 + Source/Vibration/Profiles.h | 145 +++++++++++++++++++++++++++++ Source/Vibration/VibrationEngine.h | 37 ++++++++ Source/VibrationCsv.h | 24 +++-- Source/VibrationPanel.h | 29 +++++- Tests/VibrationDspTests.cpp | 85 +++++++++++++++++ Tests/VibrationProcessorTests.cpp | 47 ++++++++++ docs/VIBRATION_SPEC.md | 2 + 13 files changed, 482 insertions(+), 23 deletions(-) create mode 100644 Source/Vibration/Profiles.h diff --git a/Source/InputsComponent.h b/Source/InputsComponent.h index 9e11967..d28d6e6 100644 --- a/Source/InputsComponent.h +++ b/Source/InputsComponent.h @@ -714,6 +714,29 @@ class InputsComponent : public juce::Component, // --- Accelerometer group --- setupLabel (accelTitle_, "ACCELEROMETER", 11.0f, true); setupLabel (accelDesc_, "Applies to all axes of the sensor. Changes restart the vibration readings.", 11.5f); + // Profile (spec §6): applying one sets everything below; edits make it custom + setupLabel (profileLabel_, "Profile"); + for (int p = 0; p < (int) vib::Profile::NumProfiles; ++p) + profileCombo_.addItem (juce::String::fromUTF8 (vib::profileDefinition ((vib::Profile) p).name), p + 1); + profileCombo_.setTooltip ("Sets quantity, weighting, filters, k-factors, time constant, main value and unit"); + profileCombo_.onChange = [this] + { + if (profileCombo_.getSelectedId() > 0) + processor_.applyVibrationProfile ((vib::Profile) (profileCombo_.getSelectedId() - 1)); + }; + addAndMakeVisible (profileCombo_); + + setupLabel (mainLabel_, "Main value"); + mainCombo_.addItem (U ("\xe2\x80\x94"), 1); + mainCombo_.addItem ("Max axis RMS", 2); + mainCombo_.addItem (U ("Max k\xc2\xb7" "axis RMS"), 3); + mainCombo_.addItem (U ("\xce\xa3 RMS (vector sum)"), 4); + mainCombo_.addItem ("Max axis peak since reset", 5); + mainCombo_.onChange = [this] { auto s = processor_.getVibrationSettings(); + s.main = (vib::MainValue) (mainCombo_.getSelectedId() - 1); + processor_.setVibrationSettings (s); }; + addAndMakeVisible (mainCombo_); + setupLabel (quantityLabel_, "Quantity"); quantityCombo_.addItem ("Acceleration", 1); quantityCombo_.addItem ("Velocity", 2); @@ -799,14 +822,16 @@ class InputsComponent : public juce::Component, l->setColour (juce::Label::textColourId, pal_.subtext.withAlpha (0.85f)); for (auto& l : headerLabels_) l.setColour (juce::Label::textColourId, pal_.subtext); - for (auto* l : { &quantityLabel_, &highPassLabel_, &tauLabel_, &bandLabel_, &serialLabel_, &rangeLabel_, + for (auto* l : { &profileLabel_, &mainLabel_, + &quantityLabel_, &highPassLabel_, &tauLabel_, &bandLabel_, &serialLabel_, &rangeLabel_, &weightingLabels_[0], &weightingLabels_[1], &weightingLabels_[2], &kLabels_[0], &kLabels_[1], &kLabels_[2] }) l->setColour (juce::Label::textColourId, pal_.text); for (auto* f : { &highPass_, &bandLow_, &bandHigh_, &lowerLimit_, &upperLimit_, &kFields_[0], &kFields_[1], &kFields_[2] }) f->style (pal_); - for (auto* c : { &quantityCombo_, &tauCombo_, &weightingCombos_[0], &weightingCombos_[1], &weightingCombos_[2] }) + for (auto* c : { &profileCombo_, &mainCombo_, &quantityCombo_, &tauCombo_, + &weightingCombos_[0], &weightingCombos_[1], &weightingCombos_[2] }) pal_.style (*c); serialEditor_.setColour (juce::TextEditor::backgroundColourId, pal_.field); serialEditor_.setColour (juce::TextEditor::textColourId, pal_.text); @@ -838,7 +863,7 @@ class InputsComponent : public juce::Component, accelCard_ = {}; if (accelVisible_) { - accelCard_ = page.removeFromBottom (pad * 2 + 16 + 3 + 16 + 10 + 4 * 28 + 3 * 6); + accelCard_ = page.removeFromBottom (pad * 2 + 16 + 3 + 16 + 10 + 5 * 28 + 4 * 6); page.removeFromBottom (16); auto c = accelCard_.reduced (pad); accelTitle_.setBounds (c.removeFromTop (16)); @@ -854,6 +879,14 @@ class InputsComponent : public juce::Component, comp.setBounds (r.reduced (0, 2)); }; auto row = c.removeFromTop (28); + { + auto r = row.withWidth (2 * colW - 12); + profileLabel_.setBounds (r.removeFromLeft (96)); + profileCombo_.setBounds (r.reduced (0, 2)); + } + cell (row, 2, mainLabel_, mainCombo_); + c.removeFromTop (6); + row = c.removeFromTop (28); cell (row, 0, quantityLabel_, quantityCombo_); cell (row, 1, highPassLabel_, highPass_); cell (row, 2, tauLabel_, tauCombo_); @@ -963,6 +996,16 @@ class InputsComponent : public juce::Component, void loadAccelSettings() { const auto s = processor_.getVibrationSettings(); + if (! profileCombo_.isPopupActive()) + { + const auto base = processor_.getVibrationProfile(); + if (base == vib::Profile::Custom || vib::settingsMatchProfile (s, base)) + profileCombo_.setSelectedId ((int) base + 1, juce::dontSendNotification); + else if (profileCombo_.getText() != processor_.getVibrationProfileLabel()) + profileCombo_.setText (processor_.getVibrationProfileLabel(), juce::dontSendNotification); + } + if (! mainCombo_.isPopupActive()) + mainCombo_.setSelectedId ((int) s.main + 1, juce::dontSendNotification); quantityCombo_.setSelectedId ((int) s.quantity + 1, juce::dontSendNotification); if (! highPass_.isBeingEdited()) highPass_.setValue (s.highPassHz); int tauIdx = 0; @@ -1084,7 +1127,8 @@ class InputsComponent : public juce::Component, std::vector accelComponents() { - std::vector v { &accelTitle_, &accelDesc_, &quantityLabel_, &quantityCombo_, + std::vector v { &accelTitle_, &accelDesc_, &profileLabel_, &profileCombo_, + &mainLabel_, &mainCombo_, &quantityLabel_, &quantityCombo_, &highPassLabel_, &highPass_, &tauLabel_, &tauCombo_, &bandLabel_, &bandLow_, &bandHigh_, &serialLabel_, &serialEditor_, &rangeLabel_, &lowerLimit_, &upperLimit_ }; @@ -1111,6 +1155,8 @@ class InputsComponent : public juce::Component, std::vector listed_; juce::Label accelTitle_, accelDesc_; + juce::Label profileLabel_, mainLabel_; + juce::ComboBox profileCombo_, mainCombo_; juce::Label quantityLabel_, highPassLabel_, tauLabel_, bandLabel_, serialLabel_, rangeLabel_; juce::ComboBox quantityCombo_, tauCombo_; NumberField highPass_ { 0.1, 20.0, 2, "Hz" }; diff --git a/Source/PluginEditor.cpp b/Source/PluginEditor.cpp index 3e36c18..19c4cec 100644 --- a/Source/PluginEditor.cpp +++ b/Source/PluginEditor.cpp @@ -569,6 +569,8 @@ bool SPLMeterAudioProcessorEditor::updateVibrationPanel() st.unit = audioProcessor.getVibrationDisplayUnit(); const auto settings = audioProcessor.getVibrationSettings(); st.tauSec = settings.tauSec; + st.profileLabel = audioProcessor.getVibrationProfileLabel(); + st.mainLabel = audioProcessor.getVibrationMainLabel(); const auto missingText = missing.isEmpty() ? juce::String() : missing.joinIntoString (", ") + (missing.size() == 1 ? " is" : " are") + " not available on this input"; @@ -599,6 +601,7 @@ bool SPLMeterAudioProcessorEditor::updateVibrationPanel() } for (int a = 0; a < 3; ++a) st.snap.weighting[a] = (int) settings.weighting[a]; + st.snap.mainKind = (int) settings.main; } st.note = "file playback with recorded roles and calibration"; } @@ -641,6 +644,7 @@ bool SPLMeterAudioProcessorEditor::updateVibrationPanel() } for (int a = 0; a < 3; ++a) st.snap.weighting[a] = (int) settings.weighting[a]; + st.snap.mainKind = (int) settings.main; } if (audioProcessor.isFileModeActive()) st.note = "the played file has no accelerometer tracks"; @@ -723,7 +727,8 @@ void SPLMeterAudioProcessorEditor::applyTheme (bool light) void SPLMeterAudioProcessorEditor::writeCsvRows (juce::OutputStream& stream, const std::vector& rows, const std::vector& markers, - vib::DisplayUnit vibUnit) + vib::DisplayUnit vibUnit, + const juce::String& vibProfile) { stream.writeText ("Timestamp,Peak dB SPL,Peak dBA SPL,Peak dBC SPL," "RMS dB SPL,RMS dBA SPL,RMS dBC SPL," @@ -784,7 +789,7 @@ void SPLMeterAudioProcessorEditor::writeCsvRows (juce::OutputStream& stream, + juce::String (e.loudnessSone, 3) + "," + juce::String (e.psychoAnnoyance, 3) + "," + markerText - + VibrationCsv::columns (e.vib, vibUnit) + "\n"; + + VibrationCsv::columns (e.vib, vibUnit, vibProfile) + "\n"; stream.writeText (line, false, false, nullptr); } } @@ -798,10 +803,11 @@ void SPLMeterAudioProcessorEditor::doSaveCsv() splmeterLastFolder().getChildFile ("SPLMeter.csv"), "*.csv"); auto markers = markerEvents_; // snapshot for async lambda - const auto vibUnit = audioProcessor.getVibrationDisplayUnit(); + const auto vibUnit = audioProcessor.getVibrationDisplayUnit(); + const auto vibProfile = audioProcessor.getVibrationProfileKey(); fileChooser->launchAsync ( juce::FileBrowserComponent::saveMode | juce::FileBrowserComponent::canSelectFiles, - [rows, markers, vibUnit] (const juce::FileChooser& fc) + [rows, markers, vibUnit, vibProfile] (const juce::FileChooser& fc) { auto file = fc.getResult(); if (file == juce::File{}) return; @@ -809,7 +815,7 @@ void SPLMeterAudioProcessorEditor::doSaveCsv() juce::FileOutputStream stream (file); if (!stream.openedOk()) return; stream.setPosition (0); stream.truncate(); - writeCsvRows (stream, rows, markers, vibUnit); + writeCsvRows (stream, rows, markers, vibUnit, vibProfile); }); } @@ -858,12 +864,13 @@ void SPLMeterAudioProcessorEditor::doSaveAll() auto rows = audioProcessor.copyLog(); auto markers = markerEvents_; auto snapshot = createComponentSnapshot (getLocalBounds()); - const auto vibUnit = audioProcessor.getVibrationDisplayUnit(); + const auto vibUnit = audioProcessor.getVibrationDisplayUnit(); + const auto vibProfile = audioProcessor.getVibrationProfileKey(); fileChooser = std::make_unique ( "Choose destination folder", splmeterLastFolder()); fileChooser->launchAsync ( juce::FileBrowserComponent::openMode | juce::FileBrowserComponent::canSelectDirectories, - [this, rows, markers, snapshot, vibUnit] (const juce::FileChooser& fc) + [this, rows, markers, snapshot, vibUnit, vibProfile] (const juce::FileChooser& fc) { auto folder = fc.getResult(); if (folder == juce::File{} || !folder.isDirectory()) return; @@ -876,7 +883,7 @@ void SPLMeterAudioProcessorEditor::doSaveAll() if (!rows.empty()) { juce::FileOutputStream csv (base.withFileExtension ("csv")); - if (csv.openedOk()) { csv.setPosition (0); csv.truncate(); writeCsvRows (csv, rows, markers, vibUnit); } + if (csv.openedOk()) { csv.setPosition (0); csv.truncate(); writeCsvRows (csv, rows, markers, vibUnit, vibProfile); } } // WAV diff --git a/Source/PluginEditor.h b/Source/PluginEditor.h index 69dae79..4176cad 100644 --- a/Source/PluginEditor.h +++ b/Source/PluginEditor.h @@ -278,7 +278,8 @@ class SPLMeterAudioProcessorEditor : public juce::AudioProcessorEditor, void doSaveSettingsJson(); void doLoadSettingsJson(); static void writeCsvRows (juce::OutputStream&, const std::vector&, - const std::vector&, vib::DisplayUnit); + const std::vector&, vib::DisplayUnit, + const juce::String& vibProfile); SPLMeterAudioProcessor& audioProcessor; // Must stay above the child components so they are built from the restored state diff --git a/Source/PluginProcessor.cpp b/Source/PluginProcessor.cpp index 9d559a1..0e9ff90 100644 --- a/Source/PluginProcessor.cpp +++ b/Source/PluginProcessor.cpp @@ -802,6 +802,8 @@ void SPLMeterAudioProcessor::pushLogEntry (float rawPk, float aPk, float cPk, e.vib.quantity = vibWork_.quantity; e.vib.axisMask = vibWork_.axisMask; e.vib.uniaxial = vibWork_.uniaxial; + e.vib.mainKind = vibWork_.mainKind; + e.vib.main = vibWork_.main; for (int a = 0; a < vib::kNumAxisSlots; ++a) { e.vib.rms[a] = vibWork_.axis[a].rms; @@ -1026,6 +1028,8 @@ vib::VibrationSettings SPLMeterAudioProcessor::getVibrationSettings() const s.bandLowHz = juce::jlimit (0.1, 1000.0, (double) node.getProperty ("bandLowHz", s.bandLowHz)); s.bandHighHz = juce::jlimit (1.0, 20000.0, (double) node.getProperty ("bandHighHz", s.bandHighHz)); s.tauSec = juce::jlimit (0.01, 10.0, (double) node.getProperty ("tauSec", s.tauSec)); + s.main = static_cast (juce::jlimit (0, (int) vib::MainValue::MaxAxisPeakMax, + (int) node.getProperty ("mainValue", 0))); return s; } @@ -1042,6 +1046,7 @@ void SPLMeterAudioProcessor::setVibrationSettings (const vib::VibrationSettings& node.setProperty ("bandLowHz", s.bandLowHz, nullptr); node.setProperty ("bandHighHz", s.bandHighHz, nullptr); node.setProperty ("tauSec", s.tauSec, nullptr); + node.setProperty ("mainValue", (int) s.main, nullptr); rebuildVibrationEngine(); } @@ -1158,6 +1163,41 @@ void SPLMeterAudioProcessor::setAccelSensorInfo (const AccelSensorInfo& info) node.setProperty ("upperLimitHz", info.upperLimitHz, nullptr); } +vib::Profile SPLMeterAudioProcessor::getVibrationProfile() const +{ + const auto node = apvts.state.getChildWithName ("UIState").getChildWithName (kAccelNode); + return vib::profileFromInt (node.isValid() ? (int) node.getProperty ("profile", 0) : 0); +} + +void SPLMeterAudioProcessor::applyVibrationProfile (vib::Profile profile) +{ + getUiState().getOrCreateChildWithName (kAccelNode, nullptr).setProperty ("profile", (int) profile, nullptr); + if (profile == vib::Profile::Custom) + return; // keeps the current settings + const auto& def = vib::profileDefinition (profile); + setVibrationDisplayUnit (def.unit); + setVibrationSettings (def.settings); +} + +juce::String SPLMeterAudioProcessor::getVibrationProfileLabel() const +{ + return juce::String::fromUTF8 (vib::profileLabel (getVibrationSettings(), getVibrationProfile()).c_str()); +} + +juce::String SPLMeterAudioProcessor::getVibrationProfileKey() const +{ + const auto p = getVibrationProfile(); + const juce::String key (vib::profileDefinition (p).key); + if (p == vib::Profile::Custom || vib::settingsMatchProfile (getVibrationSettings(), p)) + return key; + return "custom(" + key + ")"; +} + +juce::String SPLMeterAudioProcessor::getVibrationMainLabel() const +{ + return juce::String::fromUTF8 (vib::mainValueLabel (getVibrationSettings(), getVibrationProfile()).c_str()); +} + vib::DisplayUnit SPLMeterAudioProcessor::getVibrationDisplayUnit() const { const auto node = apvts.state.getChildWithName ("UIState").getChildWithName (kAccelNode); @@ -1175,7 +1215,8 @@ namespace // Keys of UIState/Accel exchanged with JSON settings files const char* const kAccelJsonKeys[] = { "highPassHz", "quantity", "weightingX", "weightingY", "weightingZ", "kx", "ky", "kz", "bandLowHz", "bandHighHz", "tauSec", - "sensorSerial", "lowerLimitHz", "upperLimitHz", "displayUnit" }; + "sensorSerial", "lowerLimitHz", "upperLimitHz", "displayUnit", + "mainValue", "profile" }; } juce::var SPLMeterAudioProcessor::getInputsJson() const diff --git a/Source/PluginProcessor.h b/Source/PluginProcessor.h index a9d0d4f..319acb0 100644 --- a/Source/PluginProcessor.h +++ b/Source/PluginProcessor.h @@ -12,6 +12,7 @@ #include "Vibration/VibrationEngine.h" #include "Vibration/CalibratorMeasurement.h" #include "Vibration/Units.h" +#include "Vibration/Profiles.h" #include "RtHandover.h" #include "WavRecording.h" #include @@ -29,6 +30,8 @@ struct VibrationLog bool uniaxial = false; float rms[4] {}; float peak[4] {}; // max |x| in the last snapshot interval + int mainKind = 0; // vib::MainValue of the profile + float main = 0.0f; // the profile's main value }; struct LogEntry @@ -358,6 +361,14 @@ class SPLMeterAudioProcessor : public juce::AudioProcessor AccelSensorInfo getAccelSensorInfo() const; void setAccelSensorInfo (const AccelSensorInfo& info); + // Measurement profile (spec §6, UIState/Accel "profile"): applying one sets the + // accelerometer settings and display unit; later edits make it "Custom (based on …)" + vib::Profile getVibrationProfile() const; + void applyVibrationProfile (vib::Profile profile); + juce::String getVibrationProfileLabel() const; // e.g. "Custom (based on Hand-arm (ISO 5349-1))" + juce::String getVibrationProfileKey() const; // CSV/JSON: "hand-arm" or "custom(hand-arm)" + juce::String getVibrationMainLabel() const; // e.g. "a_w" + // Display unit of the vibration readout (UIState/Accel "displayUnit") vib::DisplayUnit getVibrationDisplayUnit() const; void setVibrationDisplayUnit (vib::DisplayUnit unit); diff --git a/Source/Vibration/Detectors.h b/Source/Vibration/Detectors.h index c5af80b..849227b 100644 --- a/Source/Vibration/Detectors.h +++ b/Source/Vibration/Detectors.h @@ -29,6 +29,8 @@ struct VibrationSnapshot int weighting[3] {}; // vib::Weighting per X/Y/Z double seconds = 0.0; // metered time since the last reset AxisValues axis[kNumAxisSlots]; + int mainKind = 0; // vib::MainValue of the profile + float main = 0.0f; // the profile's main value (SI units) }; static_assert (std::is_trivially_copyable_v); diff --git a/Source/Vibration/Profiles.h b/Source/Vibration/Profiles.h new file mode 100644 index 0000000..640e76b --- /dev/null +++ b/Source/Vibration/Profiles.h @@ -0,0 +1,145 @@ +#pragma once +#include "VibrationEngine.h" +#include "Units.h" +#include +#include + +namespace vib +{ +//============================================================================== +// Measurement profiles (vibration spec §6). A profile sets the defaults for +// quantity, weighting, filters, k-factors, time constant, main value and display +// unit; every value stays editable. When the settings no longer match the stored +// profile it is shown as "Custom (based on …)". +// Values are persisted — only append new entries. +enum class Profile : int +{ + Custom = 0, + StructureBorne, + MachineryIso20816, + MachineryLowSpeed, + WholeBodyHealth, + WholeBodyComfort, + HandArm, + BuildingPerception, + BuildingStructural, + NumProfiles +}; + +struct ProfileDefinition +{ + const char* name; // UI and report + const char* key; // CSV vib_profile, JSON + const char* mainLabel; // symbol of the main value, UTF-8 + VibrationSettings settings; + DisplayUnit unit; +}; + +inline VibrationSettings makeSettings (Quantity q, Weighting wx, Weighting wy, Weighting wz, + double bandLow, double bandHigh, double hp, + double kx, double ky, double kz, double tau, MainValue main) +{ + VibrationSettings s; + s.quantity = q; + s.weighting[0] = wx; s.weighting[1] = wy; s.weighting[2] = wz; + s.bandLowHz = bandLow; + s.bandHighHz = bandHigh; + s.highPassHz = hp; + s.k[0] = kx; s.k[1] = ky; s.k[2] = kz; + s.tauSec = tau; + s.main = main; + return s; +} + +// Main values that need the accumulating detectors of step 10 (VDV, A(8), KB_FTr, +// f_dom) use the closest running value until then. +inline const ProfileDefinition& profileDefinition (Profile p) +{ + using Q = Quantity; + using W = Weighting; + using M = MainValue; + static const ProfileDefinition defs[] = { + { "Custom", "custom", "", + VibrationSettings {}, DisplayUnit::Linear }, + { "Structure-borne", "structure-borne", "L_a", + makeSettings (Q::Acceleration, W::None, W::None, W::None, 10.0, 1000.0, 1.0, 1, 1, 1, 0.125, M::MaxAxisRms), + DisplayUnit::Db }, + { "Machinery (ISO 20816)", "machinery-iso20816", "v_rms", + makeSettings (Q::Velocity, W::BandLimit, W::BandLimit, W::BandLimit, 10.0, 1000.0, 2.0, 1, 1, 1, 1.0, M::MaxAxisRms), + DisplayUnit::Linear }, + { "Machinery, low speed", "machinery-low-speed", "v_rms", + makeSettings (Q::Velocity, W::BandLimit, W::BandLimit, W::BandLimit, 2.0, 1000.0, 1.0, 1, 1, 1, 1.0, M::MaxAxisRms), + DisplayUnit::Linear }, + { "Whole-body health (ISO 2631-1)", "whole-body-health", "a_w", + makeSettings (Q::Acceleration, W::Wd, W::Wd, W::Wk, 10.0, 1000.0, 0.1, 1.4, 1.4, 1.0, 1.0, M::MaxAxisKRms), + DisplayUnit::Linear }, + { "Whole-body comfort (ISO 2631-1)", "whole-body-comfort", "a_v", + makeSettings (Q::Acceleration, W::Wd, W::Wd, W::Wk, 10.0, 1000.0, 0.1, 1, 1, 1, 1.0, M::SumRms), + DisplayUnit::Linear }, + { "Hand-arm (ISO 5349-1)", "hand-arm", "a_hv", + makeSettings (Q::Acceleration, W::Wh, W::Wh, W::Wh, 10.0, 1000.0, 2.0, 1, 1, 1, 1.0, M::SumRms), + DisplayUnit::Linear }, + { "Building, perception (DIN 4150-2)", "building-perception", "KB_F", + makeSettings (Q::Velocity, W::KB, W::KB, W::KB, 10.0, 1000.0, 0.5, 1, 1, 1, 0.125, M::MaxAxisRms), + DisplayUnit::Linear }, + { "Building, structural (DIN 4150-3)", "building-structural", "PPV", + makeSettings (Q::Velocity, W::BandLimit, W::BandLimit, W::BandLimit, 1.0, 315.0, 0.5, 1, 1, 1, 0.125, M::MaxAxisPeakMax), + DisplayUnit::Linear }, + }; + static_assert (std::size (defs) == (size_t) Profile::NumProfiles); + const int i = (int) p; + return defs[(i >= 0 && i < (int) Profile::NumProfiles) ? i : 0]; +} + +inline Profile profileFromInt (int v) noexcept +{ + return (v >= 0 && v < (int) Profile::NumProfiles) ? (Profile) v : Profile::Custom; +} + +// Do the settings still equal the profile's? (The display unit is a view +// choice and does not make a profile custom.) +inline bool settingsMatchProfile (const VibrationSettings& s, Profile p) +{ + if (p == Profile::Custom) + return false; + const auto& d = profileDefinition (p).settings; + auto near = [] (double a, double b) { return std::abs (a - b) <= 1.0e-6 * std::max (1.0, std::abs (b)); }; + bool bandUsed = false; + for (int a = 0; a < 3; ++a) + { + if (s.weighting[a] != d.weighting[a] || ! near (s.k[a], d.k[a])) + return false; + bandUsed = bandUsed || d.weighting[a] == Weighting::BandLimit; + } + if (bandUsed && (! near (s.bandLowHz, d.bandLowHz) || ! near (s.bandHighHz, d.bandHighHz))) + return false; + return s.quantity == d.quantity && s.main == d.main + && near (s.highPassHz, d.highPassHz) && near (s.tauSec, d.tauSec); +} + +// "Whole-body health (ISO 2631-1)", "Custom (based on …)" or "Custom" (UTF-8) +inline std::string profileLabel (const VibrationSettings& s, Profile base) +{ + if (base == Profile::Custom) + return "Custom"; + if (settingsMatchProfile (s, base)) + return profileDefinition (base).name; + return std::string ("Custom (based on ") + profileDefinition (base).name + ")"; +} + +// Symbol of the main value for the panel and report +inline std::string mainValueLabel (const VibrationSettings& s, Profile base) +{ + if (base != Profile::Custom && s.main == profileDefinition (base).settings.main) + return profileDefinition (base).mainLabel; + switch (s.main) + { + case MainValue::MaxAxisRms: return "max RMS"; + case MainValue::MaxAxisKRms: return "max k\xc2\xb7RMS"; + case MainValue::SumRms: return "\xce\xa3 RMS"; + case MainValue::MaxAxisPeakMax: return "max peak"; + case MainValue::None: break; + } + return {}; +} +} // namespace vib diff --git a/Source/Vibration/VibrationEngine.h b/Source/Vibration/VibrationEngine.h index d62d969..62975ae 100644 --- a/Source/Vibration/VibrationEngine.h +++ b/Source/Vibration/VibrationEngine.h @@ -4,6 +4,40 @@ namespace vib { +//============================================================================== +// The single value a measurement profile is about (vibration spec §6), computed +// from the snapshot. Values are persisted — only append new entries. +enum class MainValue : int +{ + None = 0, + MaxAxisRms, // largest axis running RMS (machinery v_rms, KB_F) + MaxAxisKRms, // largest k-weighted axis RMS (ISO 2631-1 health: 1.4·a_wx, 1.4·a_wy, a_wz) + SumRms, // vector sum Σ (a_v, a_hv); the axis for a single axis + MaxAxisPeakMax // largest |x| since reset over the axes (PPV) +}; + +inline float computeMainValue (MainValue m, const VibrationSnapshot& s, const double (&k)[3]) noexcept +{ + float best = 0.0f; + int axes = 0; + for (int a = 0; a < 3; ++a) + { + if (! (s.axisMask & (1 << a))) continue; + ++axes; + switch (m) + { + case MainValue::MaxAxisRms: best = std::max (best, s.axis[a].rms); break; + case MainValue::MaxAxisKRms: best = std::max (best, (float) k[a] * s.axis[a].rms); break; + case MainValue::SumRms: best = std::max (best, s.axis[a].rms); break; + case MainValue::MaxAxisPeakMax: best = std::max (best, s.axis[a].peakMax); break; + case MainValue::None: break; + } + } + if (m == MainValue::SumRms && axes > 1 && ! s.uniaxial) + return s.axis[AxisSum].rms; + return best; +} + //============================================================================== // Settings shared by all axes of the accelerometer sensor (spec §3.2). // Persisted in UIState/Accel; per-input calibration lives in UIState/Inputs. @@ -16,6 +50,7 @@ struct VibrationSettings double bandHighHz = 1000.0; double tauSec = 1.0; // running RMS time constant double k[3] { 1.0, 1.0, 1.0 }; // vector-sum multiplying factors + MainValue main = MainValue::None; }; // Which input feeds which axis (-1 = absent) and its calibration @@ -134,6 +169,8 @@ class VibrationEngine out.axis[AxisSum] = detector_[AxisSum].values(); out.axis[AxisSum].rms = (float) std::sqrt (sumMs); out.axis[AxisSum].p2p = 0.0f; // not defined for a magnitude + out.mainKind = static_cast (settings_.main); + out.main = computeMainValue (settings_.main, out, settings_.k); } VibrationSettings settings_; diff --git a/Source/VibrationCsv.h b/Source/VibrationCsv.h index d20d70d..3f642f0 100644 --- a/Source/VibrationCsv.h +++ b/Source/VibrationCsv.h @@ -13,7 +13,8 @@ namespace VibrationCsv return ",vibX_rms,vibY_rms,vibZ_rms,vibSum_rms,vibX_pk,vibY_pk,vibZ_pk,vibSum_pk,vib_main,vib_unit,vib_profile"; } - inline juce::String columns (const VibrationLog& v, vib::DisplayUnit unit) + // profileKey: vib_profile column, e.g. "hand-arm" or "custom(hand-arm)" + inline juce::String columns (const VibrationLog& v, vib::DisplayUnit unit, const juce::String& profileKey = {}) { if (! v.valid) return ",,,,,,,,,,,"; @@ -36,14 +37,21 @@ namespace VibrationCsv for (int slot = 0; slot < vib::kNumAxisSlots; ++slot) s << ',' << (present (slot) ? num (values[slot]) : juce::String()); - // Main value: Σ when there is a vector sum, otherwise the single axis - int mainSlot = vib::AxisSum; - if (! hasSum) - for (int a = 2; a >= 0; --a) - if (present (a)) mainSlot = a; - s << ',' << num (v.rms[mainSlot]); + // Main value: the profile's; without one Σ, or the single axis + if (v.mainKind != (int) vib::MainValue::None) + { + s << ',' << num (v.main); + } + else + { + int mainSlot = vib::AxisSum; + if (! hasSum) + for (int a = 2; a >= 0; --a) + if (present (a)) mainSlot = a; + s << ',' << num (v.rms[mainSlot]); + } s << ',' << juce::String::fromUTF8 (vib::units::label (unit, q)); - s << ','; // profile: phase 1b + s << ',' << profileKey; return s; } } diff --git a/Source/VibrationPanel.h b/Source/VibrationPanel.h index 52c331d..03c3989 100644 --- a/Source/VibrationPanel.h +++ b/Source/VibrationPanel.h @@ -20,6 +20,8 @@ class VibrationPanel : public juce::Component vib::VibrationSnapshot snap; vib::DisplayUnit unit = vib::DisplayUnit::Linear; double tauSec = 1.0; + juce::String profileLabel; // "Whole-body health (ISO 2631-1)", "Custom (based on …)" + juce::String mainLabel; // symbol of snap.main, e.g. "a_w" }; std::function onUnitChange; @@ -97,6 +99,28 @@ class VibrationPanel : public juce::Component if (unitCombo_.isVisible()) header.removeFromRight (160); + // The profile's main value, right-aligned in the header + if (state_.kind == State::Kind::Running && state_.snap.mainKind != 0) + { + const auto q = quantity(); + auto mainArea = header.removeFromRight (300); + const auto unitText = juce::String::fromUTF8 (vib::units::label (state_.unit, q)); + g.setColour (textSec); + g.setFont (juce::Font (juce::FontOptions().withHeight (13.0f))); + g.drawText (unitText, mainArea.removeFromRight (100), juce::Justification::centredLeft, true); + const juce::Font valueFont (juce::FontOptions().withHeight (19.0f).withStyle ("Bold")); + const auto valueText = (state_.snap.valid ? juce::String (vib::units::format (state_.snap.main, state_.unit, q)) + : juce::String ("--")) + " "; + const int valueW = (int) std::ceil (juce::GlyphArrangement::getStringWidth (valueFont, valueText)); + g.setColour (textPri); + g.setFont (valueFont); + g.drawText (valueText, mainArea.removeFromRight (valueW), juce::Justification::centredRight, false); + mainArea.removeFromRight (8); + g.setColour (textSec); + g.setFont (juce::Font (juce::FontOptions().withHeight (14.0f).withStyle ("Bold"))); + g.drawText (state_.mainLabel, mainArea, juce::Justification::centredRight, true); + } + g.setColour (textSec); g.setFont (juce::Font (juce::FontOptions().withHeight (12.0f).withStyle ("Bold"))); g.drawText ("VIBRATION", header.removeFromLeft (90), juce::Justification::centredLeft, false); @@ -209,7 +233,10 @@ class VibrationPanel : public juce::Component return state_.note; const auto& s = state_.snap; const char* qNames[3] = { "Acceleration", "Velocity", "Displacement" }; - juce::String text = qNames[juce::jlimit (0, 2, s.quantity)]; + juce::String text; + if (state_.profileLabel.isNotEmpty()) + text << state_.profileLabel << juce::String::fromUTF8 (" \xc2\xb7 "); + text << qNames[juce::jlimit (0, 2, s.quantity)]; juce::StringArray w; for (int a = 0; a < 3; ++a) diff --git a/Tests/VibrationDspTests.cpp b/Tests/VibrationDspTests.cpp index ac6245f..61da110 100644 --- a/Tests/VibrationDspTests.cpp +++ b/Tests/VibrationDspTests.cpp @@ -398,3 +398,88 @@ TEST_CASE ("Vibration display units: conversion, ISO 1683 levels and labels", "[ CHECK (format (0.0012345, DisplayUnit::Linear, Quantity::Velocity) == "1.23"); CHECK (format (10.0, DisplayUnit::Db, Quantity::Acceleration) == "140.0"); } + +//============================================================================== +#include "Vibration/Profiles.h" + +TEST_CASE ("Vibration profiles: definitions follow spec §6", "[vibration][profiles]") +{ + auto def = [] (Profile p) { return profileDefinition (p).settings; }; + + const auto health = def (Profile::WholeBodyHealth); + CHECK (health.quantity == Quantity::Acceleration); + CHECK (health.weighting[0] == Weighting::Wd); + CHECK (health.weighting[1] == Weighting::Wd); + CHECK (health.weighting[2] == Weighting::Wk); + CHECK (health.k[0] == Approx (1.4)); + CHECK (health.k[2] == Approx (1.0)); + CHECK (health.highPassHz == Approx (0.1)); + CHECK (health.main == MainValue::MaxAxisKRms); + + const auto machinery = def (Profile::MachineryIso20816); + CHECK (machinery.quantity == Quantity::Velocity); + CHECK (machinery.weighting[1] == Weighting::BandLimit); + CHECK (machinery.bandLowHz == Approx (10.0)); + CHECK (machinery.bandHighHz == Approx (1000.0)); + CHECK (def (Profile::MachineryLowSpeed).bandLowHz == Approx (2.0)); + + CHECK (def (Profile::HandArm).weighting[2] == Weighting::Wh); + CHECK (def (Profile::HandArm).main == MainValue::SumRms); + CHECK (def (Profile::BuildingPerception).weighting[0] == Weighting::KB); + CHECK (def (Profile::BuildingPerception).tauSec == Approx (0.125)); // KB_F(t) + CHECK (def (Profile::BuildingStructural).bandHighHz == Approx (315.0)); + CHECK (def (Profile::BuildingStructural).main == MainValue::MaxAxisPeakMax); + CHECK (profileDefinition (Profile::StructureBorne).unit == DisplayUnit::Db); + + // Every profile matches its own settings; out-of-range values fall back to Custom + for (int p = 1; p < (int) Profile::NumProfiles; ++p) + CHECK (settingsMatchProfile (def ((Profile) p), (Profile) p)); + CHECK (profileFromInt (99) == Profile::Custom); + CHECK_FALSE (settingsMatchProfile (VibrationSettings {}, Profile::Custom)); +} + +TEST_CASE ("Vibration profiles: edits make the profile custom", "[vibration][profiles]") +{ + auto s = profileDefinition (Profile::WholeBodyHealth).settings; + CHECK (profileLabel (s, Profile::WholeBodyHealth) == "Whole-body health (ISO 2631-1)"); + CHECK (mainValueLabel (s, Profile::WholeBodyHealth) == "a_w"); + + s.k[0] = 1.0; + CHECK_FALSE (settingsMatchProfile (s, Profile::WholeBodyHealth)); + CHECK (profileLabel (s, Profile::WholeBodyHealth) == "Custom (based on Whole-body health (ISO 2631-1))"); + CHECK (mainValueLabel (s, Profile::WholeBodyHealth) == "a_w"); // main value unchanged + + s = profileDefinition (Profile::WholeBodyHealth).settings; + s.main = MainValue::SumRms; + CHECK (mainValueLabel (s, Profile::WholeBodyHealth) == "\xce\xa3 RMS"); + + // Band limits only matter for profiles that use the band weighting + s = profileDefinition (Profile::WholeBodyHealth).settings; + s.bandLowHz = 3.0; + CHECK (settingsMatchProfile (s, Profile::WholeBodyHealth)); + s = profileDefinition (Profile::MachineryIso20816).settings; + s.bandLowHz = 3.0; + CHECK_FALSE (settingsMatchProfile (s, Profile::MachineryIso20816)); + CHECK (profileLabel (VibrationSettings {}, Profile::Custom) == "Custom"); +} + +TEST_CASE ("Vibration main values", "[vibration][profiles]") +{ + VibrationSnapshot s; + s.axisMask = 0b111; + s.axis[AxisX].rms = 0.3f; s.axis[AxisY].rms = 0.2f; s.axis[AxisZ].rms = 0.35f; + s.axis[AxisSum].rms = 0.6f; + s.axis[AxisX].peakMax = 0.9f; s.axis[AxisZ].peakMax = 1.2f; + const double k[3] { 1.4, 1.4, 1.0 }; + + CHECK (computeMainValue (MainValue::MaxAxisRms, s, k) == Approx (0.35)); + CHECK (computeMainValue (MainValue::MaxAxisKRms, s, k) == Approx (0.42)); // 1.4 · 0.3 + CHECK (computeMainValue (MainValue::SumRms, s, k) == Approx (0.6)); + CHECK (computeMainValue (MainValue::MaxAxisPeakMax, s, k) == Approx (1.2)); + CHECK (computeMainValue (MainValue::None, s, k) == 0.0f); + + // A single axis: Σ is that axis; absent axes are ignored + s.axisMask = 0b100; + CHECK (computeMainValue (MainValue::SumRms, s, k) == Approx (0.35)); + CHECK (computeMainValue (MainValue::MaxAxisKRms, s, k) == Approx (0.35)); +} diff --git a/Tests/VibrationProcessorTests.cpp b/Tests/VibrationProcessorTests.cpp index 3be626f..844c068 100644 --- a/Tests/VibrationProcessorTests.cpp +++ b/Tests/VibrationProcessorTests.cpp @@ -584,6 +584,53 @@ TEST_CASE ("Vibration WAV recording: role changes switch the recorded tracks", " CHECK (rig.proc->getRecordedInputs() == std::vector { 0, 1, 3, 4, 5 }); } +TEST_CASE ("Vibration profiles in processor: apply, custom, main value, persistence", "[vibration][processor][profiles]") +{ + juce::ScopedJuceInitialiser_GUI juceInit; + + Rig rig (4); + configureTriax (*rig.proc, 1); + rig.proc->applyVibrationProfile (vib::Profile::MachineryIso20816); + CHECK (rig.proc->getVibrationSettings().quantity == vib::Quantity::Velocity); + CHECK (rig.proc->getVibrationDisplayUnit() == vib::DisplayUnit::Linear); + CHECK (rig.proc->getVibrationProfileLabel() == "Machinery (ISO 20816)"); + CHECK (rig.proc->getVibrationProfileKey() == "machinery-iso20816"); + CHECK (rig.proc->getVibrationMainLabel() == "v_rms"); + + // Main value = largest axis v_rms: 80 Hz sines of 2 / 4 / 6 m/s² peak → v = a / (2π·80) + rig.prepare(); + rig.run (4.0, [] (int ch, int n) { return ch == 0 ? 0.0f : sine (80.0, 2.0 * ch, n); }); + const auto snap = rig.snap(); + REQUIRE (snap.valid); + CHECK (snap.mainKind == (int) vib::MainValue::MaxAxisRms); + const double vz = 6.0 * kRms / (2.0 * juce::MathConstants::pi * 80.0); + CHECK (snap.main == Approx (vz).epsilon (0.02)); + CHECK (rig.proc->copyLog().back().vib.main == Approx (vz).epsilon (0.02)); + + // An edit makes it custom; the CSV names the base profile + auto s = rig.proc->getVibrationSettings(); + s.highPassHz = 5.0; + rig.proc->setVibrationSettings (s); + CHECK (rig.proc->getVibrationProfileLabel() == "Custom (based on Machinery (ISO 20816))"); + CHECK (rig.proc->getVibrationProfileKey() == "custom(machinery-iso20816)"); + CHECK (VibrationCsv::columns (rig.proc->copyLog().back().vib, vib::DisplayUnit::Linear, + rig.proc->getVibrationProfileKey()).endsWith (",custom(machinery-iso20816)")); + + // Persisted with the plugin state + juce::MemoryBlock blob; + rig.proc->getStateInformation (blob); + auto restored = std::make_unique(); + restored->setStateInformation (blob.getData(), (int) blob.getSize()); + CHECK (restored->getVibrationProfile() == vib::Profile::MachineryIso20816); + CHECK (restored->getVibrationSettings().main == vib::MainValue::MaxAxisRms); + CHECK (restored->getVibrationProfileLabel() == "Custom (based on Machinery (ISO 20816))"); + + // Choosing "Custom" keeps the settings + restored->applyVibrationProfile (vib::Profile::Custom); + CHECK (restored->getVibrationSettings().highPassHz == Approx (5.0)); + CHECK (restored->getVibrationProfileLabel() == "Custom"); +} + TEST_CASE ("Vibration in processor: CPU budget", "[vibration][processor][performance]") { juce::ScopedJuceInitialiser_GUI juceInit; diff --git a/docs/VIBRATION_SPEC.md b/docs/VIBRATION_SPEC.md index 1149e4d..53b25bc 100644 --- a/docs/VIBRATION_SPEC.md +++ b/docs/VIBRATION_SPEC.md @@ -178,6 +178,8 @@ A profile sets the defaults for weighting, quantity, filters, detectors, k-facto | Building – structural (DIN 4150-3) | v | band 1–315 Hz | 0.5 Hz | — | PPV per axis + f_dom | Guideline lines | | Custom | any | any | any | any | — | — | +Implementation (step 9, `Source/Vibration/Profiles.h`): the profile is stored as the *base* profile (`UIState/Accel` `profile`); applying it writes its settings, RMS τ (0.125 s for structure-borne and both building profiles, 1 s otherwise), main value and display unit (dB for structure-borne, linear otherwise). "Custom (based on …)" is derived by comparing the current settings with the base profile (the display unit does not count). The main value (`MainValue`: max axis RMS, max k·axis RMS, Σ RMS, max axis peak since reset) is computed into every snapshot and log entry, shown in the panel header and written to the CSV `vib_main`; `vib_profile` holds the profile key, e.g. `custom(hand-arm)`. It can also be chosen freely in the Inputs and Sensors window. Until step 10 the profiles whose main value needs accumulating detectors use the closest running value: health and hand-arm use running RMS instead of a_w,rms / A(8), building perception uses KB_F(t) instead of KB_Fmax / KB_FTr, structural PPV is already the maximum |v| since reset (f_dom follows). + ## 7. UI ### 7.1 Settings → "Inputs and Sensors" window From 9a843377c339b66f3d853400806cb224185d096a Mon Sep 17 00:00:00 2001 From: Philipp Paul Klose Date: Thu, 12 Nov 2026 21:50:28 +0100 Subject: [PATCH 17/30] Vibration step 10: accumulating detectors - Per axis: a_w,rms (linear), MTVV (tau 1 s), VDV, crest factor, KB_Fmax, KB_FTr (30 s cycles), dominant frequency at the PPV - Sum per ISO 2631-1: a_w and MTVV from k-weighted axes, VDV_total = (sum (k*VDV)^4)^(1/4) - Main values over the measurement: health max k*a_w, comfort/hand-arm sum a_w, building perception KB_Fmax; A(8) with daily exposure time - Panel results line: A(8), VDV, MTVV, crest factor / KB_FTr / PPV axis + f_dom - Engine settles (0.8 s / HP, 0.5-10 s) before the detectors start, so the start-up transient no longer inflates PPV, MTVV, KB_Fmax and f_dom - Tests: closed-form a_w, VDV (a*(1.5T)^(1/4)), MTVV burst, crest, f_dom of decaying sines, KB_FTr cycles, sum combination, processor reset and transient-free PPV (verified to fail without settling) Co-Authored-By: Claude Opus 5.5 --- Source/InputsComponent.h | 22 ++++- Source/PluginEditor.cpp | 3 + Source/PluginProcessor.cpp | 6 +- Source/PluginProcessor.h | 1 + Source/Vibration/Detectors.h | 120 +++++++++++++++++++++++++--- Source/Vibration/Profiles.h | 59 ++++++++++++-- Source/Vibration/VibrationEngine.h | 68 +++++++++++++--- Source/VibrationPanel.h | 51 +++++++++++- Tests/VibrationDspTests.cpp | 124 ++++++++++++++++++++++++++++- Tests/VibrationProcessorTests.cpp | 66 ++++++++++++++- docs/VIBRATION_SPEC.md | 8 +- 11 files changed, 485 insertions(+), 43 deletions(-) diff --git a/Source/InputsComponent.h b/Source/InputsComponent.h index d28d6e6..4af393e 100644 --- a/Source/InputsComponent.h +++ b/Source/InputsComponent.h @@ -732,6 +732,9 @@ class InputsComponent : public juce::Component, mainCombo_.addItem (U ("Max k\xc2\xb7" "axis RMS"), 3); mainCombo_.addItem (U ("\xce\xa3 RMS (vector sum)"), 4); mainCombo_.addItem ("Max axis peak since reset", 5); + mainCombo_.addItem (U ("Max k\xc2\xb7" "a_w over the measurement"), 6); + mainCombo_.addItem (U ("\xce\xa3 a_w over the measurement"), 7); + mainCombo_.addItem ("Max axis KB_Fmax", 8); mainCombo_.onChange = [this] { auto s = processor_.getVibrationSettings(); s.main = (vib::MainValue) (mainCombo_.getSelectedId() - 1); processor_.setVibrationSettings (s); }; @@ -791,6 +794,11 @@ class InputsComponent : public juce::Component, i.serial = serialEditor_.getText().trim(); processor_.setAccelSensorInfo (i); }; addAndMakeVisible (serialEditor_); + setupLabel (exposureLabel_, "Exposure / day"); + exposure_.setTooltip (U ("Daily exposure time T for A(8) = a_w \xc2\xb7 sqrt(T / 8 h)")); + exposure_.onValueChange = [this] (double v) { auto i = processor_.getAccelSensorInfo(); + i.exposureHours = v; processor_.setAccelSensorInfo (i); }; + addAndMakeVisible (exposure_); setupLabel (rangeLabel_, "Usable range"); lowerLimit_.onValueChange = [this] (double v) { auto i = processor_.getAccelSensorInfo(); i.lowerLimitHz = v; processor_.setAccelSensorInfo (i); }; @@ -822,12 +830,12 @@ class InputsComponent : public juce::Component, l->setColour (juce::Label::textColourId, pal_.subtext.withAlpha (0.85f)); for (auto& l : headerLabels_) l.setColour (juce::Label::textColourId, pal_.subtext); - for (auto* l : { &profileLabel_, &mainLabel_, + for (auto* l : { &profileLabel_, &mainLabel_, &exposureLabel_, &quantityLabel_, &highPassLabel_, &tauLabel_, &bandLabel_, &serialLabel_, &rangeLabel_, &weightingLabels_[0], &weightingLabels_[1], &weightingLabels_[2], &kLabels_[0], &kLabels_[1], &kLabels_[2] }) l->setColour (juce::Label::textColourId, pal_.text); - for (auto* f : { &highPass_, &bandLow_, &bandHigh_, &lowerLimit_, &upperLimit_, + for (auto* f : { &exposure_, &highPass_, &bandLow_, &bandHigh_, &lowerLimit_, &upperLimit_, &kFields_[0], &kFields_[1], &kFields_[2] }) f->style (pal_); for (auto* c : { &profileCombo_, &mainCombo_, &quantityCombo_, &tauCombo_, @@ -863,7 +871,7 @@ class InputsComponent : public juce::Component, accelCard_ = {}; if (accelVisible_) { - accelCard_ = page.removeFromBottom (pad * 2 + 16 + 3 + 16 + 10 + 5 * 28 + 4 * 6); + accelCard_ = page.removeFromBottom (pad * 2 + 16 + 3 + 16 + 10 + 6 * 28 + 5 * 6); page.removeFromBottom (16); auto c = accelCard_.reduced (pad); accelTitle_.setBounds (c.removeFromTop (16)); @@ -915,6 +923,9 @@ class InputsComponent : public juce::Component, r.removeFromRight (8); bandLow_.setBounds (r.reduced (0, 2)); } + c.removeFromTop (6); + row = c.removeFromTop (28); + cell (row, 0, exposureLabel_, exposure_); } inputsCard_ = page; @@ -1031,6 +1042,7 @@ class InputsComponent : public juce::Component, serialEditor_.setText (info.serial, false); if (! lowerLimit_.isBeingEdited()) lowerLimit_.setValue (info.lowerLimitHz); if (! upperLimit_.isBeingEdited()) upperLimit_.setValue (info.upperLimitHz); + if (! exposure_.isBeingEdited()) exposure_.setValue (info.exposureHours); } void timerCallback() override @@ -1131,7 +1143,7 @@ class InputsComponent : public juce::Component, &mainLabel_, &mainCombo_, &quantityLabel_, &quantityCombo_, &highPassLabel_, &highPass_, &tauLabel_, &tauCombo_, &bandLabel_, &bandLow_, &bandHigh_, &serialLabel_, &serialEditor_, - &rangeLabel_, &lowerLimit_, &upperLimit_ }; + &rangeLabel_, &lowerLimit_, &upperLimit_, &exposureLabel_, &exposure_ }; for (int a = 0; a < 3; ++a) { v.push_back (&weightingLabels_[a]); v.push_back (&weightingCombos_[a]); @@ -1166,6 +1178,8 @@ class InputsComponent : public juce::Component, NumberField bandLow_ { 0.1, 1000.0, 1, "Hz" }, bandHigh_ { 1.0, 20000.0, 0, "Hz" }; juce::TextEditor serialEditor_; NumberField lowerLimit_ { 0.01, 1000.0, 2, "Hz" }, upperLimit_ { 1.0, 100000.0, 0, "Hz" }; + juce::Label exposureLabel_; + NumberField exposure_ { 0.01, 24.0, 2, "h" }; JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (InputsComponent) }; diff --git a/Source/PluginEditor.cpp b/Source/PluginEditor.cpp index 19c4cec..8848894 100644 --- a/Source/PluginEditor.cpp +++ b/Source/PluginEditor.cpp @@ -571,6 +571,9 @@ bool SPLMeterAudioProcessorEditor::updateVibrationPanel() st.tauSec = settings.tauSec; st.profileLabel = audioProcessor.getVibrationProfileLabel(); st.mainLabel = audioProcessor.getVibrationMainLabel(); + for (int a = 0; a < 3; ++a) + st.k[a] = settings.k[a]; + st.exposureHours = audioProcessor.getAccelSensorInfo().exposureHours; const auto missingText = missing.isEmpty() ? juce::String() : missing.joinIntoString (", ") + (missing.size() == 1 ? " is" : " are") + " not available on this input"; diff --git a/Source/PluginProcessor.cpp b/Source/PluginProcessor.cpp index 0e9ff90..523a965 100644 --- a/Source/PluginProcessor.cpp +++ b/Source/PluginProcessor.cpp @@ -1028,7 +1028,7 @@ vib::VibrationSettings SPLMeterAudioProcessor::getVibrationSettings() const s.bandLowHz = juce::jlimit (0.1, 1000.0, (double) node.getProperty ("bandLowHz", s.bandLowHz)); s.bandHighHz = juce::jlimit (1.0, 20000.0, (double) node.getProperty ("bandHighHz", s.bandHighHz)); s.tauSec = juce::jlimit (0.01, 10.0, (double) node.getProperty ("tauSec", s.tauSec)); - s.main = static_cast (juce::jlimit (0, (int) vib::MainValue::MaxAxisPeakMax, + s.main = static_cast (juce::jlimit (0, vib::kNumMainValues - 1, (int) node.getProperty ("mainValue", 0))); return s; } @@ -1152,6 +1152,7 @@ SPLMeterAudioProcessor::AccelSensorInfo SPLMeterAudioProcessor::getAccelSensorIn info.serial = node.getProperty ("sensorSerial", juce::String()).toString(); info.lowerLimitHz = juce::jlimit (0.01, 1000.0, (double) node.getProperty ("lowerLimitHz", info.lowerLimitHz)); info.upperLimitHz = juce::jlimit (1.0, 100000.0, (double) node.getProperty ("upperLimitHz", info.upperLimitHz)); + info.exposureHours = juce::jlimit (0.01, 24.0, (double) node.getProperty ("exposureHours", info.exposureHours)); return info; } @@ -1161,6 +1162,7 @@ void SPLMeterAudioProcessor::setAccelSensorInfo (const AccelSensorInfo& info) node.setProperty ("sensorSerial", info.serial, nullptr); node.setProperty ("lowerLimitHz", info.lowerLimitHz, nullptr); node.setProperty ("upperLimitHz", info.upperLimitHz, nullptr); + node.setProperty ("exposureHours", info.exposureHours, nullptr); } vib::Profile SPLMeterAudioProcessor::getVibrationProfile() const @@ -1216,7 +1218,7 @@ namespace const char* const kAccelJsonKeys[] = { "highPassHz", "quantity", "weightingX", "weightingY", "weightingZ", "kx", "ky", "kz", "bandLowHz", "bandHighHz", "tauSec", "sensorSerial", "lowerLimitHz", "upperLimitHz", "displayUnit", - "mainValue", "profile" }; + "mainValue", "profile", "exposureHours" }; } juce::var SPLMeterAudioProcessor::getInputsJson() const diff --git a/Source/PluginProcessor.h b/Source/PluginProcessor.h index 319acb0..09cbd44 100644 --- a/Source/PluginProcessor.h +++ b/Source/PluginProcessor.h @@ -357,6 +357,7 @@ class SPLMeterAudioProcessor : public juce::AudioProcessor juce::String serial; double lowerLimitHz = 0.5; // usable range from the datasheet (spec §3.2) double upperLimitHz = 10000.0; + double exposureHours = 8.0; // daily exposure time T for A(8) }; AccelSensorInfo getAccelSensorInfo() const; void setAccelSensorInfo (const AccelSensorInfo& info); diff --git a/Source/Vibration/Detectors.h b/Source/Vibration/Detectors.h index 849227b..926984d 100644 --- a/Source/Vibration/Detectors.h +++ b/Source/Vibration/Detectors.h @@ -14,8 +14,17 @@ struct AxisValues { float rms = 0.0f; // running RMS (exponential, time constant τ) float peak = 0.0f; // max |x| in the last snapshot interval - float peakMax = 0.0f; // max |x| since the last reset + float peakMax = 0.0f; // max |x| since the last reset (PPV for velocity) float p2p = 0.0f; // peak-to-peak in the last snapshot interval + + // Accumulated since the last reset (spec §5.3) + float awRms = 0.0f; // linear RMS over the measurement (a_w,rms) + float mtvv = 0.0f; // max of the running RMS with τ = 1 s + float vdv = 0.0f; // (∫ x⁴ dt)^¼, e.g. m/s^1.75 + float crest = 0.0f; // peakMax / awRms + float fDom = 0.0f; // dominant frequency at peakMax (Hz; half-period between zero crossings) + float kbFmax = 0.0f; // max of the running RMS with τ = 0.125 s (KB_Fmax) + float kbFTr = 0.0f; // √(mean of the squared 30 s cycle maxima) (KB_FTr) }; // Published every snapshot interval (125 ms). Units follow the quantity: @@ -84,32 +93,102 @@ class SeqLock class AxisDetector { public: + static constexpr double kMtvvTau = 1.0; // ISO 2631-1 MTVV + static constexpr double kKbTau = 0.125; // DIN 4150-2 KB_F(t) + static constexpr double kKbCycleSec = 30.0; // DIN 4150-2 cycle (Takt) + void prepare (double fs, double tauSec) noexcept { - alpha_ = 1.0 - std::exp (-1.0 / (std::max (1.0e-3, tauSec) * fs)); + fs_ = fs; + alpha_ = 1.0 - std::exp (-1.0 / (std::max (1.0e-3, tauSec) * fs)); + alpha1_ = 1.0 - std::exp (-1.0 / (kMtvvTau * fs)); + alphaF_ = 1.0 - std::exp (-1.0 / (kKbTau * fs)); + cycleLen_ = (long long) std::llround (kKbCycleSec * fs); reset(); } void reset() noexcept { - meanSquare_ = 0.0; + meanSquare_ = ms1_ = msF_ = 0.0; peakMax_ = 0.0; + sumSq_ = sum4_ = 0.0; + count_ = 0; + mtvv_ = kbFmax_ = 0.0; + cycleMax_ = cycleSumSq_ = 0.0; + cycleCount_ = 0; + cyclePos_ = 0; + prevX_ = 0.0; + lastZc_ = -1.0; + peakZc_ = -1.0; + awaitingZc_ = false; + fDom_ = 0.0; startInterval(); } // x: signed sample (axes); for the vector sum pass the instantaneous magnitude void process (double x) noexcept { - meanSquare_ += alpha_ * (x * x - meanSquare_); + const double x2 = x * x; + meanSquare_ += alpha_ * (x2 - meanSquare_); + ms1_ += alpha1_ * (x2 - ms1_); + msF_ += alphaF_ * (x2 - msF_); + sumSq_ += x2; + sum4_ += x2 * x2; + mtvv_ = std::max (mtvv_, ms1_); + kbFmax_ = std::max (kbFmax_, msF_); + + // 30 s cycles of KB_F (KB_FTm per cycle) + cycleMax_ = std::max (cycleMax_, msF_); + if (++cyclePos_ >= cycleLen_) + { + cycleSumSq_ += cycleMax_; // KB_FTi² (msF is already squared) + ++cycleCount_; + cycleMax_ = 0.0; + cyclePos_ = 0; + } + + // Zero crossings bound the half-cycle that contains the peak + const double t = (double) count_; + if ((prevX_ < 0.0 && x >= 0.0) || (prevX_ > 0.0 && x <= 0.0)) + { + const double zc = t - 1.0 + prevX_ / (prevX_ - x); // interpolated + if (awaitingZc_ && zc > peakZc_) + { + if (peakZc_ >= 0.0) + { + fDom_ = fs_ / (2.0 * (zc - peakZc_)); + awaitingZc_ = false; + } + else + { + // Peak in the first half-cycle of an event (no crossing before + // it): use the following half-cycle instead + peakZc_ = zc; + } + } + lastZc_ = zc; + } + prevX_ = x; + ++count_; + const double a = std::fabs (x); - peak_ = std::max (peak_, a); - peakMax_ = std::max (peakMax_, a); - min_ = std::min (min_, x); - max_ = std::max (max_, x); + if (a > peakMax_) + { + peakMax_ = a; + peakZc_ = lastZc_; // -1: no crossing yet, see above + awaitingZc_ = true; + } + peak_ = std::max (peak_, a); + min_ = std::min (min_, x); + max_ = std::max (max_, x); } // Running mean square — the vector sum combines these - double meanSquare() const noexcept { return meanSquare_; } + double meanSquare() const noexcept { return meanSquare_; } + double meanSquare1s() const noexcept { return ms1_; } + double linearMeanSquare() const noexcept { return count_ > 0 ? sumSq_ / (double) count_ : 0.0; } + double fourthPowerIntegral() const noexcept { return sum4_ / fs_; } // ∫ x⁴ dt + double seconds() const noexcept { return (double) count_ / fs_; } AxisValues values() const noexcept { @@ -118,6 +197,15 @@ class AxisDetector v.peak = (float) peak_; v.peakMax = (float) peakMax_; v.p2p = (max_ >= min_) ? (float) (max_ - min_) : 0.0f; + v.awRms = (float) std::sqrt (linearMeanSquare()); + v.mtvv = (float) std::sqrt (mtvv_); + v.vdv = (float) std::pow (fourthPowerIntegral(), 0.25); + v.crest = v.awRms > 0.0f ? v.peakMax / v.awRms : 0.0f; + v.fDom = (float) fDom_; + v.kbFmax = (float) std::sqrt (kbFmax_); + // Completed cycles; before the first one completes, the running cycle + const double ftr2 = cycleCount_ > 0 ? cycleSumSq_ / (double) cycleCount_ : cycleMax_; + v.kbFTr = (float) std::sqrt (ftr2); return v; } @@ -129,7 +217,17 @@ class AxisDetector } private: - double alpha_ = 0.0, meanSquare_ = 0.0; - double peak_ = 0.0, peakMax_ = 0.0, min_ = 1.0e300, max_ = -1.0e300; + double fs_ = 12000.0; + double alpha_ = 0.0, alpha1_ = 0.0, alphaF_ = 0.0; + double meanSquare_ = 0.0, ms1_ = 0.0, msF_ = 0.0; + double peak_ = 0.0, peakMax_ = 0.0, min_ = 1.0e300, max_ = -1.0e300; + double sumSq_ = 0.0, sum4_ = 0.0; + long long count_ = 0; + double mtvv_ = 0.0, kbFmax_ = 0.0; // squared + double cycleMax_ = 0.0, cycleSumSq_ = 0.0; // squared + long long cycleLen_ = 360000, cyclePos_ = 0; + int cycleCount_ = 0; + double prevX_ = 0.0, lastZc_ = -1.0, peakZc_ = -1.0, fDom_ = 0.0; + bool awaitingZc_ = false; }; } // namespace vib diff --git a/Source/Vibration/Profiles.h b/Source/Vibration/Profiles.h index 640e76b..b2236fb 100644 --- a/Source/Vibration/Profiles.h +++ b/Source/Vibration/Profiles.h @@ -51,8 +51,8 @@ inline VibrationSettings makeSettings (Quantity q, Weighting wx, Weighting wy, W return s; } -// Main values that need the accumulating detectors of step 10 (VDV, A(8), KB_FTr, -// f_dom) use the closest running value until then. +// Main values: a_w and a_hv are linear RMS values over the measurement; VDV, +// A(8), KB_FTr and f_dom are secondary values (panel, report). inline const ProfileDefinition& profileDefinition (Profile p) { using Q = Quantity; @@ -71,16 +71,16 @@ inline const ProfileDefinition& profileDefinition (Profile p) makeSettings (Q::Velocity, W::BandLimit, W::BandLimit, W::BandLimit, 2.0, 1000.0, 1.0, 1, 1, 1, 1.0, M::MaxAxisRms), DisplayUnit::Linear }, { "Whole-body health (ISO 2631-1)", "whole-body-health", "a_w", - makeSettings (Q::Acceleration, W::Wd, W::Wd, W::Wk, 10.0, 1000.0, 0.1, 1.4, 1.4, 1.0, 1.0, M::MaxAxisKRms), + makeSettings (Q::Acceleration, W::Wd, W::Wd, W::Wk, 10.0, 1000.0, 0.1, 1.4, 1.4, 1.0, 1.0, M::MaxAxisKAw), DisplayUnit::Linear }, { "Whole-body comfort (ISO 2631-1)", "whole-body-comfort", "a_v", - makeSettings (Q::Acceleration, W::Wd, W::Wd, W::Wk, 10.0, 1000.0, 0.1, 1, 1, 1, 1.0, M::SumRms), + makeSettings (Q::Acceleration, W::Wd, W::Wd, W::Wk, 10.0, 1000.0, 0.1, 1, 1, 1, 1.0, M::SumAw), DisplayUnit::Linear }, { "Hand-arm (ISO 5349-1)", "hand-arm", "a_hv", - makeSettings (Q::Acceleration, W::Wh, W::Wh, W::Wh, 10.0, 1000.0, 2.0, 1, 1, 1, 1.0, M::SumRms), + makeSettings (Q::Acceleration, W::Wh, W::Wh, W::Wh, 10.0, 1000.0, 2.0, 1, 1, 1, 1.0, M::SumAw), DisplayUnit::Linear }, - { "Building, perception (DIN 4150-2)", "building-perception", "KB_F", - makeSettings (Q::Velocity, W::KB, W::KB, W::KB, 10.0, 1000.0, 0.5, 1, 1, 1, 0.125, M::MaxAxisRms), + { "Building, perception (DIN 4150-2)", "building-perception", "KB_Fmax", + makeSettings (Q::Velocity, W::KB, W::KB, W::KB, 10.0, 1000.0, 0.5, 1, 1, 1, 0.125, M::MaxAxisKbFmax), DisplayUnit::Linear }, { "Building, structural (DIN 4150-3)", "building-structural", "PPV", makeSettings (Q::Velocity, W::BandLimit, W::BandLimit, W::BandLimit, 1.0, 315.0, 0.5, 1, 1, 1, 0.125, M::MaxAxisPeakMax), @@ -127,6 +127,48 @@ inline std::string profileLabel (const VibrationSettings& s, Profile base) return std::string ("Custom (based on ") + profileDefinition (base).name + ")"; } +//============================================================================== +// Daily exposure A(8) = a_w · √(T / 8 h) (EU 2002/44/EC; ISO 2631-1, ISO 5349-1) +inline double dailyExposureA8 (double aw, double exposureHours) noexcept +{ + return aw * std::sqrt (std::max (0.0, exposureHours) / 8.0); +} + +// Secondary values shown with a main value (panel results line, report) +struct MeasurementSummary +{ + float vdv = 0.0f; // Σ: VDV_total, max axis: max k·VDV + float mtvv = 0.0f; // Σ or max k·MTVV + float crest = 0.0f; // largest axis crest factor + float kbFTr = 0.0f; // largest axis KB_FTr + float ppv = 0.0f; // largest axis peak since reset + float fDom = 0.0f; // dominant frequency at that peak + int ppvAxis = -1; // axis of ppv (0–2) +}; + +inline MeasurementSummary summarize (const VibrationSnapshot& s, MainValue m, const double (&k)[3]) noexcept +{ + MeasurementSummary r; + int axes = 0; + for (int a = 0; a < 3; ++a) + { + if (! (s.axisMask & (1 << a))) continue; + ++axes; + const auto& v = s.axis[a]; + r.vdv = std::max (r.vdv, (float) k[a] * v.vdv); + r.mtvv = std::max (r.mtvv, (float) k[a] * v.mtvv); + r.crest = std::max (r.crest, v.crest); + r.kbFTr = std::max (r.kbFTr, v.kbFTr); + if (v.peakMax > r.ppv) { r.ppv = v.peakMax; r.fDom = v.fDom; r.ppvAxis = a; } + } + if ((m == MainValue::SumAw || m == MainValue::SumRms) && axes > 1 && ! s.uniaxial) + { + r.vdv = s.axis[AxisSum].vdv; + r.mtvv = s.axis[AxisSum].mtvv; + } + return r; +} + // Symbol of the main value for the panel and report inline std::string mainValueLabel (const VibrationSettings& s, Profile base) { @@ -138,6 +180,9 @@ inline std::string mainValueLabel (const VibrationSettings& s, Profile base) case MainValue::MaxAxisKRms: return "max k\xc2\xb7RMS"; case MainValue::SumRms: return "\xce\xa3 RMS"; case MainValue::MaxAxisPeakMax: return "max peak"; + case MainValue::MaxAxisKAw: return "max k\xc2\xb7" "a_w"; + case MainValue::SumAw: return "\xce\xa3 a_w"; + case MainValue::MaxAxisKbFmax: return "KB_Fmax"; case MainValue::None: break; } return {}; diff --git a/Source/Vibration/VibrationEngine.h b/Source/Vibration/VibrationEngine.h index 62975ae..13dbe14 100644 --- a/Source/Vibration/VibrationEngine.h +++ b/Source/Vibration/VibrationEngine.h @@ -13,8 +13,12 @@ enum class MainValue : int MaxAxisRms, // largest axis running RMS (machinery v_rms, KB_F) MaxAxisKRms, // largest k-weighted axis RMS (ISO 2631-1 health: 1.4·a_wx, 1.4·a_wy, a_wz) SumRms, // vector sum Σ (a_v, a_hv); the axis for a single axis - MaxAxisPeakMax // largest |x| since reset over the axes (PPV) + MaxAxisPeakMax, // largest |x| since reset over the axes (PPV) + MaxAxisKAw, // largest k-weighted a_w,rms over the measurement (ISO 2631-1 health) + SumAw, // Σ of the a_w,rms over the measurement (a_v comfort, a_hv) + MaxAxisKbFmax // largest KB_Fmax over the axes (DIN 4150-2) }; +constexpr int kNumMainValues = 8; inline float computeMainValue (MainValue m, const VibrationSnapshot& s, const double (&k)[3]) noexcept { @@ -30,11 +34,15 @@ inline float computeMainValue (MainValue m, const VibrationSnapshot& s, const do case MainValue::MaxAxisKRms: best = std::max (best, (float) k[a] * s.axis[a].rms); break; case MainValue::SumRms: best = std::max (best, s.axis[a].rms); break; case MainValue::MaxAxisPeakMax: best = std::max (best, s.axis[a].peakMax); break; + case MainValue::MaxAxisKAw: best = std::max (best, (float) k[a] * s.axis[a].awRms); break; + case MainValue::SumAw: best = std::max (best, s.axis[a].awRms); break; + case MainValue::MaxAxisKbFmax: best = std::max (best, s.axis[a].kbFmax); break; case MainValue::None: break; } } - if (m == MainValue::SumRms && axes > 1 && ! s.uniaxial) - return s.axis[AxisSum].rms; + const bool hasSum = axes > 1 && ! s.uniaxial; + if (m == MainValue::SumRms && hasSum) return s.axis[AxisSum].rms; + if (m == MainValue::SumAw && hasSum) return s.axis[AxisSum].awRms; return best; } @@ -68,6 +76,14 @@ class VibrationEngine public: static constexpr double kSnapshotInterval = 0.125; // s, like the SPL log + // Filters settle before the detectors start: the start-up transient of the + // high-pass, integrators and weightings would otherwise end up in the + // since-reset values (PPV, MTVV, KB_Fmax, crest factor) + static double settlingSeconds (double highPassHz) noexcept + { + return std::clamp (0.8 / std::max (highPassHz, 1.0e-3), 0.5, 10.0); + } + VibrationEngine (double fs, const VibrationSettings& settings, const AxisInput (&axes)[3], bool uniaxial) : settings_ (settings), uniaxial_ (uniaxial) @@ -92,6 +108,7 @@ class VibrationEngine for (auto& d : detector_) d.prepare (fsd_, settings.tauSec); intervalSamples_ = std::max (1, (int) std::lround (kSnapshotInterval * fsd_)); + settleRemaining_ = (long long) std::llround (settlingSeconds (settings.highPassHz) * fsd_); } int inputChannel (int axis) const noexcept { return input_[axis]; } @@ -108,6 +125,7 @@ class VibrationEngine { for (auto& d : detector_) d.reset(); meteredSamples_ = 0; + mtvvSumSq_ = 0.0; resetPending_ = false; } @@ -123,7 +141,14 @@ class VibrationEngine // All axes share the decimator phase, so they produce samples together produced = channel_[a].process (in[a] != nullptr ? in[a][s] : 0.0f, full, decimated[a]); } - if (! produced || ! metering) + if (! produced) + continue; + if (settleRemaining_ > 0) + { + --settleRemaining_; // filters run, detectors wait (snapshot stays invalid) + continue; + } + if (! metering) continue; double sumSq = 0.0; @@ -137,6 +162,13 @@ class VibrationEngine detector_[AxisSum].process (std::sqrt (sumSq)); ++meteredSamples_; + // Σ MTVV: running 1 s values of the axes, combined with the k-factors + double ms1 = 0.0; + for (int a = 0; a < 3; ++a) + if (input_[a] >= 0) + ms1 += settings_.k[a] * settings_.k[a] * detector_[a].meanSquare1s(); + mtvvSumSq_ = std::max (mtvvSumSq_, ms1); + if (++intervalCount_ >= intervalSamples_) { intervalCount_ = 0; @@ -156,19 +188,31 @@ class VibrationEngine out.axisMask = axisMask_; out.quantity = static_cast (settings_.quantity); out.seconds = meteredSamples_ / fsd_; - double sumMs = 0.0; + double sumMs = 0.0, sumLin = 0.0, sumVdv4 = 0.0; for (int a = 0; a < 3; ++a) { out.weighting[a] = static_cast (settings_.weighting[a]); out.axis[a] = input_[a] >= 0 ? detector_[a].values() : AxisValues {}; if (input_[a] >= 0) - sumMs += settings_.k[a] * settings_.k[a] * detector_[a].meanSquare(); + { + const double k2 = settings_.k[a] * settings_.k[a]; + sumMs += k2 * detector_[a].meanSquare(); + sumLin += k2 * detector_[a].linearMeanSquare(); + sumVdv4 += k2 * k2 * detector_[a].fourthPowerIntegral(); + } } - // Σ: RMS from the k-weighted axis mean squares (ISO 2631-1 a_v); peaks - // from the sample-wise vector magnitude - out.axis[AxisSum] = detector_[AxisSum].values(); - out.axis[AxisSum].rms = (float) std::sqrt (sumMs); - out.axis[AxisSum].p2p = 0.0f; // not defined for a magnitude + // Σ from the k-weighted axis values (ISO 2631-1: a_v, MTVV, VDV_total = + // (Σ (k·VDV)⁴)^¼); peaks from the sample-wise vector magnitude + auto& sum = out.axis[AxisSum]; + sum = detector_[AxisSum].values(); + sum.rms = (float) std::sqrt (sumMs); + sum.p2p = 0.0f; // not defined for a magnitude + sum.awRms = (float) std::sqrt (sumLin); + sum.mtvv = (float) std::sqrt (mtvvSumSq_); + sum.vdv = (float) std::pow (sumVdv4, 0.25); + sum.crest = sum.awRms > 0.0f ? sum.peakMax / sum.awRms : 0.0f; + sum.fDom = 0.0f; + sum.kbFmax = sum.kbFTr = 0.0f; // DIN 4150-2 assesses single axes out.mainKind = static_cast (settings_.main); out.main = computeMainValue (settings_.main, out, settings_.k); } @@ -182,6 +226,8 @@ class VibrationEngine double fsd_ = 12000.0; int intervalSamples_ = 1500, intervalCount_ = 0; long long meteredSamples_ = 0; + double mtvvSumSq_ = 0.0; + long long settleRemaining_ = 0; bool resetPending_ = false; }; } // namespace vib diff --git a/Source/VibrationPanel.h b/Source/VibrationPanel.h index 03c3989..d4e851d 100644 --- a/Source/VibrationPanel.h +++ b/Source/VibrationPanel.h @@ -2,6 +2,7 @@ #include #include "Vibration/Detectors.h" #include "Vibration/Units.h" +#include "Vibration/Profiles.h" //============================================================================== // Vibration readout below the SPL meter (vibration spec §7.2): one row per axis @@ -22,6 +23,8 @@ class VibrationPanel : public juce::Component double tauSec = 1.0; juce::String profileLabel; // "Whole-body health (ISO 2631-1)", "Custom (based on …)" juce::String mainLabel; // symbol of snap.main, e.g. "a_w" + double k[3] { 1.0, 1.0, 1.0 }; + double exposureHours = 8.0; // for A(8) }; std::function onUnitChange; @@ -46,7 +49,7 @@ class VibrationPanel : public juce::Component case State::Kind::Message: return kPad * 2 + kHeaderH + kRowH; case State::Kind::Running: break; } - return kPad * 2 + kHeaderH + numRows() * kRowH; + return kPad * 2 + kHeaderH + kResultsH + numRows() * kRowH; } void setState (const State& s) @@ -127,6 +130,14 @@ class VibrationPanel : public juce::Component g.setFont (juce::Font (juce::FontOptions().withHeight (13.0f))); g.drawText (headerSummary(), header, juce::Justification::centredLeft, true); + if (state_.kind == State::Kind::Running) + { + g.setColour (textSec); + g.setFont (juce::Font (juce::FontOptions().withHeight (13.0f))); + g.drawText (resultsLine(), content.removeFromTop (kResultsH).withTrimmedLeft (90), + juce::Justification::centredLeft, true); + } + if (state_.kind == State::Kind::Message) { g.setColour (state_.messageIsError ? bad : textSec); @@ -197,7 +208,43 @@ class VibrationPanel : public juce::Component } private: - static constexpr int kMargin = 20, kPad = 8, kHeaderH = 24, kRowH = 28; + static constexpr int kMargin = 20, kPad = 8, kHeaderH = 24, kResultsH = 20, kRowH = 28; + + // Accumulated values for the profile's main value (spec §5.3, §6) + juce::String resultsLine() const + { + const auto& s = state_.snap; + const auto dot = juce::String::fromUTF8 (" \xc2\xb7 "); + juce::String text = "Measured " + juce::String (s.seconds, 1) + " s"; + if (! s.valid) + return text; + const auto q = quantity(); + const auto unit = juce::String::fromUTF8 (vib::units::label (state_.unit, q)); + auto value = [&] (float si) { return juce::String (vib::units::format (si, state_.unit, q)) + " " + unit; }; + const auto m = (vib::MainValue) s.mainKind; + const auto sum = vib::summarize (s, m, state_.k); + + if (m == vib::MainValue::MaxAxisKAw || m == vib::MainValue::SumAw) + { + text << dot << "A(8) " << value ((float) vib::dailyExposureA8 (s.main, state_.exposureHours)) + << " (T = " << juce::String (state_.exposureHours, state_.exposureHours < 10.0 ? 2 : 1) << " h)"; + if (q == vib::Quantity::Acceleration) + text << dot << "VDV " << juce::String (sum.vdv, 3) << " m/s^1.75"; + text << dot << "MTVV " << value (sum.mtvv) + << dot << "crest factor " << juce::String (sum.crest, 1); + } + else if (m == vib::MainValue::MaxAxisKbFmax) + { + text << dot << "KB_FTr " << value (sum.kbFTr); + } + else if (m == vib::MainValue::MaxAxisPeakMax && sum.ppvAxis >= 0) + { + const char* axis[3] = { "X", "Y", "Z" }; + text << dot << "on " << (s.uniaxial ? "the axis" : axis[sum.ppvAxis]) + << dot << "f_dom " << (sum.fDom > 0.0f ? juce::String (sum.fDom, 1) + " Hz" : juce::String ("--")); + } + return text; + } struct Row { int slot; juce::String label; juce::Colour colour; }; diff --git a/Tests/VibrationDspTests.cpp b/Tests/VibrationDspTests.cpp index 61da110..87439af 100644 --- a/Tests/VibrationDspTests.cpp +++ b/Tests/VibrationDspTests.cpp @@ -414,7 +414,7 @@ TEST_CASE ("Vibration profiles: definitions follow spec §6", "[vibration][profi CHECK (health.k[0] == Approx (1.4)); CHECK (health.k[2] == Approx (1.0)); CHECK (health.highPassHz == Approx (0.1)); - CHECK (health.main == MainValue::MaxAxisKRms); + CHECK (health.main == MainValue::MaxAxisKAw); const auto machinery = def (Profile::MachineryIso20816); CHECK (machinery.quantity == Quantity::Velocity); @@ -424,7 +424,9 @@ TEST_CASE ("Vibration profiles: definitions follow spec §6", "[vibration][profi CHECK (def (Profile::MachineryLowSpeed).bandLowHz == Approx (2.0)); CHECK (def (Profile::HandArm).weighting[2] == Weighting::Wh); - CHECK (def (Profile::HandArm).main == MainValue::SumRms); + CHECK (def (Profile::HandArm).main == MainValue::SumAw); + CHECK (def (Profile::WholeBodyComfort).main == MainValue::SumAw); + CHECK (def (Profile::BuildingPerception).main == MainValue::MaxAxisKbFmax); CHECK (def (Profile::BuildingPerception).weighting[0] == Weighting::KB); CHECK (def (Profile::BuildingPerception).tauSec == Approx (0.125)); // KB_F(t) CHECK (def (Profile::BuildingStructural).bandHighHz == Approx (315.0)); @@ -483,3 +485,121 @@ TEST_CASE ("Vibration main values", "[vibration][profiles]") CHECK (computeMainValue (MainValue::SumRms, s, k) == Approx (0.35)); CHECK (computeMainValue (MainValue::MaxAxisKRms, s, k) == Approx (0.35)); } + +//============================================================================== +namespace +{ +template +AxisValues runDetector (double fs, double seconds, Signal&& x, double tau = 0.125) +{ + AxisDetector d; + d.prepare (fs, tau); + const auto n = (long long) (seconds * fs); + for (long long i = 0; i < n; ++i) + d.process (x (i / fs)); + return d.values(); +} +} // namespace + +TEST_CASE ("Vibration accumulating detectors: a_w,rms, VDV, MTVV, crest factor", "[vibration][detectors]") +{ + const double twoPi = 2.0 * kPi, fs = 4000.0; + const double A = 2.0, a = A / std::sqrt (2.0), T = 20.0; + const auto v = runDetector (fs, T, [&] (double t) { return A * std::sin (twoPi * 50.0 * t); }); + + CHECK (v.awRms == Approx (a).epsilon (1e-4)); // linear RMS + CHECK (v.vdv == Approx (a * std::pow (1.5 * T, 0.25)).epsilon (1e-4)); // spec §11 + CHECK (v.mtvv == Approx (a).epsilon (0.01)); + CHECK (v.crest == Approx (std::sqrt (2.0)).epsilon (1e-3)); + + // MTVV catches a 3 s burst that the linear RMS averages away + const auto b = runDetector (fs, 30.0, [&] (double t) + { + return (t > 10.0 && t < 13.0 ? A : 0.1 * A) * std::sin (twoPi * 50.0 * t); + }); + CHECK (b.mtvv == Approx (a * std::sqrt (1.0 - std::exp (-3.0))).epsilon (0.02)); + const double awBurst = a * std::sqrt ((3.0 + 0.01 * 27.0) / 30.0); + CHECK (b.awRms == Approx (awBurst).epsilon (0.01)); + CHECK (b.crest == Approx (A / awBurst).epsilon (0.01)); +} + +TEST_CASE ("Vibration accumulating detectors: PPV with dominant frequency", "[vibration][detectors]") +{ + const double twoPi = 2.0 * kPi, fs = 4000.0; + for (double f : { 4.0, 25.0, 80.0 }) + { + INFO ("f = " << f); + // Decaying sine starting at 1 s: the first peak is the PPV + const auto v = runDetector (fs, 4.0, [&] (double t) + { + return t < 1.0 ? 0.0 : 0.012 * std::exp (-1.5 * (t - 1.0)) * std::sin (twoPi * f * (t - 1.0) + 0.3); + }); + CHECK (v.peakMax == Approx (0.012).epsilon (0.15)); + CHECK (v.fDom == Approx (f).epsilon (0.05)); + } +} + +TEST_CASE ("Vibration accumulating detectors: KB_Fmax and KB_FTr over 30 s cycles", "[vibration][detectors]") +{ + const double twoPi = 2.0 * kPi, fs = 2000.0; + // Cycle 1: 0.5 mm/s peak, cycle 2: 1 mm/s, cycle 3: 2 mm/s (rising, so no cycle + // inherits the decay of a louder one) + const auto v = runDetector (fs, 90.0, [&] (double t) + { + const double A = t < 30.0 ? 0.5e-3 : (t < 60.0 ? 1.0e-3 : 2.0e-3); + return A * std::sin (twoPi * 100.0 * t); + }, 1.0); // the KB detectors use τ = 0.125 s regardless of the running RMS τ + + const double r = 1.0 / std::sqrt (2.0); + CHECK (v.kbFmax == Approx (2.0e-3 * r).epsilon (0.01)); + CHECK (v.kbFTr == Approx (r * 1.0e-3 * std::sqrt ((0.25 + 1.0 + 4.0) / 3.0)).epsilon (0.01)); + + // Before the first cycle completes, KB_FTr is the running cycle's maximum + const auto early = runDetector (fs, 10.0, [&] (double t) { return 1.0e-3 * std::sin (twoPi * 100.0 * t); }, 1.0); + CHECK (early.kbFTr == Approx (1.0e-3 * r).epsilon (0.01)); +} + +TEST_CASE ("Vibration engine: vector sum of the accumulated values", "[vibration][detectors]") +{ + VibrationSettings s; + s.k[0] = 1.4; s.k[1] = 1.4; s.k[2] = 1.0; + s.highPassHz = 1.0; + AxisInput axes[3] { { 0, 120.0 }, { 1, 120.0 }, { 2, 120.0 } }; // 1 FS = 1 m/s² + VibrationEngine engine (48000.0, s, axes, false); + + const double twoPi = 2.0 * kPi, fs = 48000.0; + const double A[3] { 0.5, 0.8, 1.2 }; + std::vector buf[3]; + for (auto& b : buf) b.resize (480); + VibrationSnapshot snap; + long long n = 0; + for (int block = 0; block < 1000; ++block) // 10 s + { + for (int i = 0; i < 480; ++i, ++n) + for (int a = 0; a < 3; ++a) + buf[a][(size_t) i] = (float) (A[a] * std::sin (twoPi * (40.0 + 20.0 * a) * n / fs)); + const float* in[3] { buf[0].data(), buf[1].data(), buf[2].data() }; + engine.process (in, 480, true, snap); + } + REQUIRE (snap.valid); + double sumAw2 = 0.0, sumVdv4 = 0.0; + for (int a = 0; a < 3; ++a) + { + sumAw2 += s.k[a] * s.k[a] * snap.axis[a].awRms * snap.axis[a].awRms; + sumVdv4 += std::pow (s.k[a] * snap.axis[a].vdv, 4.0); + } + CHECK (snap.axis[AxisSum].awRms == Approx (std::sqrt (sumAw2)).epsilon (1e-4)); + CHECK (snap.axis[AxisSum].vdv == Approx (std::pow (sumVdv4, 0.25)).epsilon (1e-4)); + CHECK (snap.axis[AxisZ].awRms == Approx (1.2 / std::sqrt (2.0)).epsilon (0.01)); + CHECK (snap.axis[AxisSum].mtvv == Approx (std::sqrt (sumAw2)).epsilon (0.02)); + + // Main values over the measurement + CHECK (computeMainValue (MainValue::MaxAxisKAw, snap, s.k) + == Approx (std::max ({ 1.4 * snap.axis[0].awRms, 1.4 * snap.axis[1].awRms, (double) snap.axis[2].awRms }))); + CHECK (computeMainValue (MainValue::SumAw, snap, s.k) == Approx (snap.axis[AxisSum].awRms)); + + const auto summary = summarize (snap, MainValue::SumAw, s.k); + CHECK (summary.vdv == Approx (snap.axis[AxisSum].vdv)); + CHECK (summary.ppvAxis == AxisZ); + CHECK (dailyExposureA8 (0.5, 2.0) == Approx (0.25)); +} diff --git a/Tests/VibrationProcessorTests.cpp b/Tests/VibrationProcessorTests.cpp index 844c068..1019389 100644 --- a/Tests/VibrationProcessorTests.cpp +++ b/Tests/VibrationProcessorTests.cpp @@ -95,7 +95,8 @@ TEST_CASE ("Vibration in processor: triaxial RMS, peak, peak-to-peak and vector CHECK (s.axis[vib::AxisX].p2p == Approx (2.0).epsilon (0.01)); CHECK (s.axis[vib::AxisY].peakMax == Approx (2.0).epsilon (0.01)); CHECK (s.axis[vib::AxisSum].rms == Approx (std::sqrt (0.5 + 2.0 + 0.125)).epsilon (0.01)); - CHECK (s.seconds == Approx (3.0).margin (0.15)); + // Metered time excludes the filter settling after the engine was built + CHECK (s.seconds == Approx (3.0 - vib::VibrationEngine::settlingSeconds (1.0)).margin (0.15)); // The microphone path is unaffected: 0.1 peak sine = −23 dBFS → 104 dB at calOffset 127 CHECK (rig.proc->getRMSSPL() == Approx (103.99).margin (0.05)); @@ -163,7 +164,7 @@ TEST_CASE ("Vibration in processor: calibration, integration and weighting", "[v Rig rig (3); configureTriax (*rig.proc, 0, s, 1.0); rig.prepare(); - rig.run (10.0, [] (int, int n) { return sine (8.0, 1.0, n); }); + rig.run (18.0, [] (int, int n) { return sine (8.0, 1.0, n); }); // 8 s settling at 0.1 Hz const auto snap = rig.snap(); REQUIRE (snap.valid); CHECK (snap.weighting[2] == (int) vib::Weighting::Wk); @@ -524,7 +525,7 @@ TEST_CASE ("Vibration WAV recording: tracks, metadata and file playback", "[vibr rig.proc->loadFile (tmp); CHECK (rig.proc->fileHasAccelerometer()); CHECK (rig.proc->isVibrationAvailable()); - rig.run (4.0, [] (int, int) { return 0.0f; }); + rig.run (4.8, [] (int, int) { return 0.0f; }); // < 5 s file; settling + τ = 1 s const auto snap = rig.snap(); REQUIRE (snap.valid); @@ -631,6 +632,65 @@ TEST_CASE ("Vibration profiles in processor: apply, custom, main value, persiste CHECK (restored->getVibrationProfileLabel() == "Custom"); } +TEST_CASE ("Vibration in processor: accumulated values and session reset", "[vibration][processor][detectors]") +{ + juce::ScopedJuceInitialiser_GUI juceInit; + + Rig rig (4); + configureTriax (*rig.proc, 1); + rig.proc->applyVibrationProfile (vib::Profile::HandArm); // Wh, a_hv = Σ a_w + rig.prepare(); + // 80 Hz (inside the Wh band): 2 / 4 / 6 m/s² peak + auto loud = [] (int ch, int n) { return ch == 0 ? 0.0f : sine (80.0, 2.0 * ch, n); }; + auto quiet = [] (int ch, int n) { return ch == 0 ? 0.0f : sine (80.0, 0.2 * ch, n); }; + rig.run (6.0, loud); + + auto snap = rig.snap(); + REQUIRE (snap.valid); + const double settle = vib::VibrationEngine::settlingSeconds (2.0); // hand-arm HP + CHECK (snap.seconds == Approx (6.0 - settle).margin (0.02)); + CHECK (snap.mainKind == (int) vib::MainValue::SumAw); + CHECK (snap.main == Approx (snap.axis[vib::AxisSum].awRms)); + const float ahvLoud = snap.main; + CHECK (ahvLoud > 1.0f); + + // a_w is linear over the measurement: loud part + 6 s quiet + rig.run (6.0, quiet); + snap = rig.snap(); + const double tl = 6.0 - settle; + CHECK (snap.main == Approx (ahvLoud * std::sqrt ((tl + 0.01 * 6.0) / (tl + 6.0))).epsilon (0.03)); + CHECK (snap.axis[vib::AxisSum].mtvv == Approx (ahvLoud).epsilon (0.03)); // MTVV keeps the loud part + + // Session reset (the main Reset button) starts all accumulators afresh + rig.proc->resetSessionPeak(); + rig.run (3.0, quiet); + snap = rig.snap(); + CHECK (snap.seconds == Approx (3.0).epsilon (0.02)); + CHECK (snap.main == Approx (ahvLoud * 0.1f).epsilon (0.05)); + CHECK (snap.axis[vib::AxisSum].mtvv < 0.2f * ahvLoud); +} + +TEST_CASE ("Vibration in processor: PPV and f_dom are free of the start-up transient", "[vibration][processor][detectors]") +{ + juce::ScopedJuceInitialiser_GUI juceInit; + + Rig rig (4); + configureTriax (*rig.proc, 1); + rig.proc->applyVibrationProfile (vib::Profile::BuildingStructural); // v, 1–315 Hz, HP 0.5 Hz + rig.prepare(); + // Z: 24 Hz, 1.2 m/s² peak → v = 1.2 / (2π·24) = 7.96 mm/s + rig.run (6.0, [] (int ch, int n) { return ch == 3 ? sine (24.0, 1.2, n) : 0.0f; }); + + const auto snap = rig.snap(); + REQUIRE (snap.valid); + const double ppv = 1.2 / (2.0 * juce::MathConstants::pi * 24.0) + * vib::analogMagnitude (vib::Weighting::BandLimit, 24.0, 1.0, 315.0); + CHECK (snap.main == Approx (ppv).epsilon (0.02)); + CHECK (snap.axis[vib::AxisZ].fDom == Approx (24.0).epsilon (0.02)); + const auto summary = vib::summarize (snap, vib::MainValue::MaxAxisPeakMax, { 1.0, 1.0, 1.0 }); + CHECK (summary.ppvAxis == vib::AxisZ); +} + TEST_CASE ("Vibration in processor: CPU budget", "[vibration][processor][performance]") { juce::ScopedJuceInitialiser_GUI juceInit; diff --git a/docs/VIBRATION_SPEC.md b/docs/VIBRATION_SPEC.md index 53b25bc..04f0712 100644 --- a/docs/VIBRATION_SPEC.md +++ b/docs/VIBRATION_SPEC.md @@ -158,6 +158,12 @@ Unit tests (`Tests/VibrationDspTests.cpp`): Accumulating detectors (a_w,rms, MTVV, VDV, PPV, KB_FTr) reset together with the existing session reset (the same button that resets `sessionPeakDBCSPL_`). They pause during DAW-sync pauses, like the log. +Implementation (step 10, `Source/Vibration/Detectors.h`): every axis detector accumulates a_w,rms (linear), MTVV (exponential τ = 1 s, independent of the running-RMS τ), VDV, crest factor (peak since reset / a_w,rms), KB_Fmax and KB_FTr (τ = 0.125 s; completed 30 s cycles, the running cycle until the first one completes) and the dominant frequency at the PPV (interpolated zero crossings around the peak; for a peak in the first half-cycle of an event, the following half-cycle). Σ combines the axes with the k-factors: a_w,rms and MTVV as √Σ k²·x², VDV_total = (Σ (k·VDV)⁴)^¼ (ISO 2631-1). A(8) = a_w · √(T / 8 h) with the daily exposure time T (`exposureHours`, default 8 h, in the accelerometer group). + +Settling: after an engine is built (start, settings or role change) the filters run for `0.8 s / highPassHz` (0.5 … 10 s) before the detectors start, so the start-up transient of the high-pass, integrators and weightings does not reach PPV, MTVV, KB_Fmax or the crest factor. The readout shows "--" meanwhile. A session reset does not need settling. + +Final main values: health = max k·a_w,rms, comfort = Σ a_w,rms (a_v), hand-arm = Σ a_w,rms (a_hv), building perception = max axis KB_Fmax. The panel shows a results line under the header: measured time, then per main value A(8), VDV, MTVV and crest factor (a_w types), KB_FTr (KB), or the PPV axis and f_dom (PPV). + ### 5.4 Publishing to the GUI As for SPL: the audio thread writes `std::atomic` values, and the GUI polls them at 30 Hz. A `VibrationSnapshot` struct (per axis + Σ: running RMS, peak, plus the profile values) is published through a seqlock, or via a set of atomics with a version counter, so all values in one GUI frame are consistent. @@ -178,7 +184,7 @@ A profile sets the defaults for weighting, quantity, filters, detectors, k-facto | Building – structural (DIN 4150-3) | v | band 1–315 Hz | 0.5 Hz | — | PPV per axis + f_dom | Guideline lines | | Custom | any | any | any | any | — | — | -Implementation (step 9, `Source/Vibration/Profiles.h`): the profile is stored as the *base* profile (`UIState/Accel` `profile`); applying it writes its settings, RMS τ (0.125 s for structure-borne and both building profiles, 1 s otherwise), main value and display unit (dB for structure-borne, linear otherwise). "Custom (based on …)" is derived by comparing the current settings with the base profile (the display unit does not count). The main value (`MainValue`: max axis RMS, max k·axis RMS, Σ RMS, max axis peak since reset) is computed into every snapshot and log entry, shown in the panel header and written to the CSV `vib_main`; `vib_profile` holds the profile key, e.g. `custom(hand-arm)`. It can also be chosen freely in the Inputs and Sensors window. Until step 10 the profiles whose main value needs accumulating detectors use the closest running value: health and hand-arm use running RMS instead of a_w,rms / A(8), building perception uses KB_F(t) instead of KB_Fmax / KB_FTr, structural PPV is already the maximum |v| since reset (f_dom follows). +Implementation (step 9, `Source/Vibration/Profiles.h`): the profile is stored as the *base* profile (`UIState/Accel` `profile`); applying it writes its settings, RMS τ (0.125 s for structure-borne and both building profiles, 1 s otherwise), main value and display unit (dB for structure-borne, linear otherwise). "Custom (based on …)" is derived by comparing the current settings with the base profile (the display unit does not count). The main value (`MainValue`: max axis RMS, max k·axis RMS, Σ RMS, max axis peak since reset) is computed into every snapshot and log entry, shown in the panel header and written to the CSV `vib_main`; `vib_profile` holds the profile key, e.g. `custom(hand-arm)`. It can also be chosen freely in the Inputs and Sensors window. Since step 10 the main values use the accumulating detectors (§5.3). ## 7. UI From 43fbaa4cd3abbf08d4f070427cc3e0c5c4c74f84 Mon Sep 17 00:00:00 2001 From: Philipp Paul Klose Date: Thu, 12 Nov 2026 21:52:56 +0100 Subject: [PATCH 18/30] docs: vibration spec status table and step 11 plan Co-Authored-By: Claude Opus 5.5 --- docs/VIBRATION_SPEC.md | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/docs/VIBRATION_SPEC.md b/docs/VIBRATION_SPEC.md index 04f0712..23f930b 100644 --- a/docs/VIBRATION_SPEC.md +++ b/docs/VIBRATION_SPEC.md @@ -345,6 +345,30 @@ Manual verification: handheld calibrator per axis; compare a short machinery and 12. HTML report (§9) with inline SVG charts. 13. README + user documentation; version bump to **v3.6.0** (CMakeLists.txt, SPLMeter.jucer, JucePluginDefines.h, PluginEditor version label). +### Status (2026-11-12) + +| Step | State | Commit | +|---|---|---| +| 0 Regression safety net, CI | done | — | +| 1 Channel model | done | 69b15b8 | +| 2 Per-input FFT, FFT source selector | done | f58964e | +| 3 Accelerometer DSP | done | e6cb7db | +| 4 Engine + detectors | done | da37f54 | +| 5 Inputs and Sensors window, calibration | done | c147269 | +| 6 Vibration panel | done | c2ce553 | +| 7 Timeline, CSV, JSON | done | 214b85e | +| 8 Multichannel WAV, role-aware playback | done | 364de64 | +| Fix: standalone up to 32 inputs, unmuted inputs listed | done | 4ec51b0 | +| 9 Profiles | done | 2141ed9 | +| 10 Accumulating detectors, engine settling | done | 9a84337 | +| 11 Assessment + status dot | **next** | | +| 12 HTML report | open | | +| 13 Docs, v3.6.0 bump, PR to main | open | | + +**Step 11 plan.** `Source/Vibration/Assessment.h` (no JUCE, unit-tested): status None / Ok / Warning / Exceeded with a short text, one evaluator per profile following §9.3 — health (A(8) and VDV against EU action/limit values, Germany preset), hand-arm (A(8)), comfort (informational band), machinery (zones A–D by group and foundation), DIN 4150-2 (zone, day/night, KB_Fmax/A_u/A_o then KB_FTr/A_r), DIN 4150-3 (line, foundation with frequency interpolation via f_dom or top floor, short-/long-term). Limits as editable defaults in `UIState/AccelLimits` (included in JSON export/import), edited in an "Assessment" group of the Inputs and Sensors window. The Vibration panel header gets the status dot and text. Tests cover each evaluator at its boundaries, the DIN 4150-3 interpolation and the DIN 4150-2 decision flow. The ⚠ items of §13 are resolved before release. + +Open small items: Vib X colour close to the dBA trace; weighting names truncated in the Inputs window; `.gitignore` for build folders; devices opening more than 32 inputs. + ### Later - iPad layout for the Vibration panel. From b1ed461ef53a7e55422cb5051acf4d9885db8bad Mon Sep 17 00:00:00 2001 From: Philipp Paul Klose Date: Fri, 13 Nov 2026 10:32:06 +0100 Subject: [PATCH 19/30] Vibration: distinct axis colours, short weighting labels, ignore build dirs - X brown, Y mint, Z slate (old orange/cyan/violet collided with SPL traces) - weighting combos show short labels, full name as tooltip - .gitignore: build-*/ and stray Vendor:asiosdk:common/ Co-Authored-By: Claude Opus 5.5 --- .gitignore | 6 ++++++ Source/InputsComponent.h | 27 ++++++++++++++++++++++++++- Source/LogComponent.cpp | 6 +++--- Source/LogComponent.h | 2 +- Source/VibrationPanel.h | 6 +++--- docs/VIBRATION_SPEC.md | 2 +- 6 files changed, 40 insertions(+), 9 deletions(-) diff --git a/.gitignore b/.gitignore index 5dd061a..2692bdc 100644 --- a/.gitignore +++ b/.gitignore @@ -23,3 +23,9 @@ Vendor/asiosdk/ *.a *.d *.dia + +# Local CMake build trees +build-*/ + +# Stray artefact of a mis-quoted path (Vendor:asiosdk:common) +Vendor:asiosdk:common/ diff --git a/Source/InputsComponent.h b/Source/InputsComponent.h index 4af393e..6a21d3d 100644 --- a/Source/InputsComponent.h +++ b/Source/InputsComponent.h @@ -86,6 +86,27 @@ inline juce::String weightingName (vib::Weighting w) return {}; } +// Short form for the combo box text; the full name goes into the tooltip. +inline juce::String weightingShortName (vib::Weighting w) +{ + switch (w) + { + case vib::Weighting::None: return "Unweighted"; + case vib::Weighting::BandLimit: return "Band limit"; + case vib::Weighting::Wb: return "Wb rail"; + case vib::Weighting::Wc: return "Wc seat back"; + case vib::Weighting::Wd: return "Wd body x/y"; + case vib::Weighting::We: return "We rotational"; + case vib::Weighting::Wf: return "Wf sickness"; + case vib::Weighting::Wh: return "Wh hand-arm"; + case vib::Weighting::Wj: return "Wj head"; + case vib::Weighting::Wk: return "Wk body z"; + case vib::Weighting::Wm: return "Wm buildings"; + case vib::Weighting::KB: return "KB DIN 4150-2"; + } + return {}; +} + inline juce::String formatAccel (double ms2) { if (ms2 <= 0.0) return U ("0 m/s²"); @@ -769,9 +790,10 @@ class InputsComponent : public juce::Component, { setupLabel (weightingLabels_[a], axisNames[a]); for (int w = 0; w <= (int) vib::Weighting::KB; ++w) - weightingCombos_[a].addItem (weightingName ((vib::Weighting) w), w + 1); + weightingCombos_[a].addItem (weightingShortName ((vib::Weighting) w), w + 1); weightingCombos_[a].onChange = [this, a] { auto s = processor_.getVibrationSettings(); s.weighting[a] = (vib::Weighting) (weightingCombos_[a].getSelectedId() - 1); + weightingCombos_[a].setTooltip (weightingName (s.weighting[a])); processor_.setVibrationSettings (s); }; addAndMakeVisible (weightingCombos_[a]); @@ -1027,7 +1049,10 @@ class InputsComponent : public juce::Component, for (int a = 0; a < 3; ++a) { if (! weightingCombos_[a].isPopupActive()) + { weightingCombos_[a].setSelectedId ((int) s.weighting[a] + 1, juce::dontSendNotification); + weightingCombos_[a].setTooltip (weightingName (s.weighting[a])); + } if (! kFields_[a].isBeingEdited()) kFields_[a].setValue (s.k[a]); anyBand = anyBand || s.weighting[a] == vib::Weighting::BandLimit; } diff --git a/Source/LogComponent.cpp b/Source/LogComponent.cpp index 2fbf75a..95f9abf 100644 --- a/Source/LogComponent.cpp +++ b/Source/LogComponent.cpp @@ -24,9 +24,9 @@ const juce::Colour LogComponent::colTonality { 0xff30d158 }; // lime gree const juce::Colour LogComponent::colBassComfort { 0xff7d5fff }; // indigo const juce::Colour LogComponent::colFftIn1 { 0xff34c759 }; // green const juce::Colour LogComponent::colFftIn2 { 0xffff453a }; // red -const juce::Colour LogComponent::colVib[3] { juce::Colour (0xffff9f0a), // X orange - juce::Colour (0xff5ac8fa), // Y cyan - juce::Colour (0xffbf5af2) }; // Z violet +const juce::Colour LogComponent::colVib[3] { juce::Colour (0xffac8e68), // X brown + juce::Colour (0xff63e6be), // Y mint + juce::Colour (0xff8fa8c8) }; // Z slate namespace { diff --git a/Source/LogComponent.h b/Source/LogComponent.h index e506bbc..4e5cfd4 100644 --- a/Source/LogComponent.h +++ b/Source/LogComponent.h @@ -66,7 +66,7 @@ class LogComponent : public juce::Component, juce::ToggleButton vibVisButtons_[4]; bool vibAvailable_ = false; bool vibUniaxial_ = false; - static const juce::Colour colVib[3]; // X orange, Y cyan, Z violet (Σ: text colour) + static const juce::Colour colVib[3]; // X brown, Y mint, Z slate (Σ: text colour) // FFT static constexpr int kMaxFftOrder = 19; // 2^19 = 524288, matches PluginProcessor::kFftCircBufSize diff --git a/Source/VibrationPanel.h b/Source/VibrationPanel.h index d4e851d..3ff31f0 100644 --- a/Source/VibrationPanel.h +++ b/Source/VibrationPanel.h @@ -250,7 +250,7 @@ class VibrationPanel : public juce::Component vib::Quantity quantity() const noexcept { return (vib::Quantity) state_.snap.quantity; } - // Axis colours as in the timeline (spec §7.3): X orange, Y cyan, Z violet, Σ neutral + // Axis colours as in the timeline (spec §7.3): X brown, Y mint, Z slate, Σ neutral (keep in sync with LogComponent::colVib) std::vector rows() const { std::vector r; @@ -258,10 +258,10 @@ class VibrationPanel : public juce::Component if (s.uniaxial) { const char* sym[3] = { "a", "v", "d" }; - r.push_back ({ vib::AxisX, sym[juce::jlimit (0, 2, s.quantity)], juce::Colour (0xffff9f0a) }); + r.push_back ({ vib::AxisX, sym[juce::jlimit (0, 2, s.quantity)], juce::Colour (0xffac8e68) }); return r; } - const juce::Colour cols[3] = { juce::Colour (0xffff9f0a), juce::Colour (0xff5ac8fa), juce::Colour (0xffbf5af2) }; + const juce::Colour cols[3] = { juce::Colour (0xffac8e68), juce::Colour (0xff63e6be), juce::Colour (0xff8fa8c8) }; const char* names[3] = { "X", "Y", "Z" }; int axes = 0; for (int a = 0; a < 3; ++a) diff --git a/docs/VIBRATION_SPEC.md b/docs/VIBRATION_SPEC.md index 23f930b..3c0417b 100644 --- a/docs/VIBRATION_SPEC.md +++ b/docs/VIBRATION_SPEC.md @@ -220,7 +220,7 @@ The Settings window has a fixed size and no free space, so the inputs table live - `LogEntry` has a `VibrationLog` block: per slot (X, Y, Z, Σ) running RMS and interval peak in SI units, plus quantity, axis mask and uniaxial flag; `valid` only for live accelerometer readings (not in file mode). The profile's main value follows with step 9. - New toggles in the 4th column of the "Left axis" row: **Vib X · Y · Z · Σ** (persisted as `logShowVib*`; Z and Σ on by default; uniaxial shows a single "Vib" toggle). They appear only with a valid accelerometer configuration. - Vibration traces use the **right y-axis** with an automatic range in `displayUnit` (linear: 0 … 1/2/5·10ⁿ above the maximum; dB: 10 dB steps, ≥ 20 dB span). If a psychoacoustic metric is shown at the same time, the vibration trace takes the right-axis labels and the metric keeps its own unlabelled scale. Traces have gaps where an entry has no live reading. -- Colours: X orange, Y cyan, Z violet, Σ white/black (colourblind-safe against the mic's green/red Dual FFT colours). +- Colours: X brown, Y mint, Z slate, Σ white/black — distinct from all SPL, psychoacoustic and Dual FFT trace colours (the original orange/cyan/violet collided with peak dBA, peak SPL and RMS dBA). ### 7.4 FFT and spectrogram From 02353a1b97b7f0ab73b6b27d42561833d762b5f6 Mon Sep 17 00:00:00 2001 From: Philipp Paul Klose Date: Fri, 13 Nov 2026 11:25:59 +0100 Subject: [PATCH 20/30] Vibration step 11: assessment engine, limits, panel status dot - Source/Vibration/Assessment.h: verdicts per profile (EU/Germany whole-body A(8)/VDV, hand-arm, ISO 2631-1 comfort band, ISO 20816-3 zones, DIN 4150-2 decision flow, DIN 4150-3 PPV with frequency interpolation and locations) - KB_FTr = KB_FTm * sqrt(T_e / T_r); detector value renamed to kbFTm - editable limits in UIState/AccelLimits, JSON accel.limits - Assessment card in Inputs and Sensors, status dot in the Vibration panel - verified the open standard values (spec 9.3, 13, 14) - tests: VibrationAssessmentTests + limits persistence Co-Authored-By: Claude Opus 5.5 --- CMakeLists.txt | 1 + Source/InputsComponent.h | 254 +++++++++++++++++++- Source/PluginEditor.cpp | 3 + Source/PluginProcessor.cpp | 89 +++++++ Source/PluginProcessor.h | 6 + Source/Vibration/Assessment.h | 362 +++++++++++++++++++++++++++++ Source/Vibration/Detectors.h | 4 +- Source/Vibration/Profiles.h | 4 +- Source/Vibration/VibrationEngine.h | 2 +- Source/VibrationPanel.h | 42 +++- Tests/VibrationAssessmentTests.cpp | 291 +++++++++++++++++++++++ Tests/VibrationDspTests.cpp | 8 +- Tests/VibrationProcessorTests.cpp | 44 ++++ docs/VIBRATION_SPEC.md | 57 +++-- 14 files changed, 1129 insertions(+), 38 deletions(-) create mode 100644 Source/Vibration/Assessment.h create mode 100644 Tests/VibrationAssessmentTests.cpp diff --git a/CMakeLists.txt b/CMakeLists.txt index 36b83e7..9d93959 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -318,6 +318,7 @@ if(SPLMETER_BUILD_TESTS) Tests/MarkerTests.cpp Tests/LeqTests.cpp Tests/VibrationDspTests.cpp + Tests/VibrationAssessmentTests.cpp ) target_include_directories(SPLMeterTests PRIVATE Source) diff --git a/Source/InputsComponent.h b/Source/InputsComponent.h index 6a21d3d..65fb3c6 100644 --- a/Source/InputsComponent.h +++ b/Source/InputsComponent.h @@ -829,6 +829,49 @@ class InputsComponent : public juce::Component, addAndMakeVisible (lowerLimit_); addAndMakeVisible (upperLimit_); + // --- Assessment group (spec §9.3): the controls depend on the profile --- + setupLabel (assessTitle_, "ASSESSMENT", 11.0f, true); + setupLabel (assessDesc_, {}, 11.5f); + for (int i = 0; i < kAssessCombos; ++i) + { + setupLabel (assessComboLabels_[i], {}); + assessCombos_[i].onChange = [this, i] + { + if (assessCombos_[i].getSelectedId() <= 0 || i >= (int) comboSetters_.size()) return; + auto l = processor_.getAssessmentLimits(); + comboSetters_[(size_t) i] (l, assessCombos_[i].getSelectedId() - 1); + processor_.setAssessmentLimits (l); + loadAssessment(); + }; + addAndMakeVisible (assessCombos_[i]); + } + for (int i = 0; i < kAssessFields; ++i) + { + setupLabel (assessFieldLabels_[i], {}); + assessFields_[i].onValueChange = [this, i] (double v) + { + if (i >= (int) fieldMembers_.size()) return; + auto l = processor_.getAssessmentLimits(); + l.*fieldMembers_[(size_t) i] = v; + processor_.setAssessmentLimits (l); + }; + addAndMakeVisible (assessFields_[i]); + } + assessDefaults_.setTooltip ("Reload the reference values of the selected standard, group, zone or line"); + assessDefaults_.onClick = [this] + { + auto l = processor_.getAssessmentLimits(); + vib::applyWholeBodyPreset (l, l.wbPreset); + vib::applyMachineryPreset (l, l.machGroup, l.machFoundation); + vib::applyDin4150_2Preset (l, l.din2Zone, l.din2Night); + vib::applyDin4150_3Preset (l, l.din3Line, l.din3Location, l.din3LongTerm); + const auto d = vib::defaultAssessmentLimits(); + l.haAction = d.haAction; l.haLimit = d.haLimit; + processor_.setAssessmentLimits (l); + loadAssessment(); + }; + addAndMakeVisible (assessDefaults_); + setLightMode (light); loadAccelSettings(); rebuildRows(); @@ -863,6 +906,14 @@ class InputsComponent : public juce::Component, for (auto* c : { &profileCombo_, &mainCombo_, &quantityCombo_, &tauCombo_, &weightingCombos_[0], &weightingCombos_[1], &weightingCombos_[2] }) pal_.style (*c); + assessTitle_.setColour (juce::Label::textColourId, pal_.subtext); + assessDesc_.setColour (juce::Label::textColourId, pal_.subtext.withAlpha (0.85f)); + for (auto& l : assessComboLabels_) l.setColour (juce::Label::textColourId, pal_.text); + for (auto& l : assessFieldLabels_) l.setColour (juce::Label::textColourId, pal_.text); + for (auto& c : assessCombos_) pal_.style (c); + for (auto& f : assessFields_) f.style (pal_); + assessDefaults_.setColour (juce::TextButton::buttonColourId, pal_.field); + assessDefaults_.setColour (juce::TextButton::textColourOffId, pal_.text); serialEditor_.setColour (juce::TextEditor::backgroundColourId, pal_.field); serialEditor_.setColour (juce::TextEditor::textColourId, pal_.text); serialEditor_.setColour (juce::TextEditor::outlineColourId, pal_.border); @@ -874,7 +925,7 @@ class InputsComponent : public juce::Component, void paint (juce::Graphics& g) override { g.fillAll (pal_.bg); - for (auto* b : { &inputsCard_, &accelCard_ }) + for (auto* b : { &inputsCard_, &accelCard_, &assessCard_ }) { if (b->isEmpty()) continue; g.setColour (pal_.card); @@ -889,10 +940,40 @@ class InputsComponent : public juce::Component, constexpr int margin = 16, pad = 14, rowH = 30; auto page = getLocalBounds().reduced (margin); - // Accelerometer card at the bottom (fixed height), inputs card fills the rest + // Accelerometer and assessment cards at the bottom (fixed height), inputs card fills the rest accelCard_ = {}; + assessCard_ = {}; if (accelVisible_) { + assessCard_ = page.removeFromBottom (pad * 2 + 16 + 3 + 16 + 10 + 3 * 28 + 2 * 6); + page.removeFromBottom (16); + { + auto c = assessCard_.reduced (pad); + auto titleRow = c.removeFromTop (16); + assessDefaults_.setBounds (titleRow.removeFromRight (90).withHeight (22).translated (0, -2)); + assessTitle_.setBounds (titleRow); + c.removeFromTop (3); + assessDesc_.setBounds (c.removeFromTop (16)); + c.removeFromTop (10); + const int colW = c.getWidth() / 3; + auto cell = [&] (juce::Rectangle row, int col, juce::Label& label, juce::Component& comp) + { + auto r = row.withX (row.getX() + col * colW).withWidth (colW - 12); + label.setBounds (r.removeFromLeft (128)); + comp.setBounds (r.reduced (0, 2)); + }; + auto row = c.removeFromTop (28); + for (int i = 0; i < kAssessCombos; ++i) + cell (row, i, assessComboLabels_[i], assessCombos_[i]); + for (int r = 0; r < 2; ++r) + { + c.removeFromTop (6); + row = c.removeFromTop (28); + for (int i = 0; i < 3; ++i) + cell (row, i, assessFieldLabels_[r * 3 + i], assessFields_[r * 3 + i]); + } + } + accelCard_ = page.removeFromBottom (pad * 2 + 16 + 3 + 16 + 10 + 6 * 28 + 5 * 6); page.removeFromBottom (16); auto c = accelCard_.reduced (pad); @@ -1143,6 +1224,10 @@ class InputsComponent : public juce::Component, uniaxial_ = uniaxial; for (juce::Component* comp : accelComponents()) comp->setVisible (anyAccel); + assessKey_ = -1; // loadAssessment() re-applies the per-profile visibility + for (int i = 0; i < kAssessCombos; ++i) { assessComboLabels_[i].setVisible (false); assessCombos_[i].setVisible (false); } + for (int i = 0; i < kAssessFields; ++i) { assessFieldLabels_[i].setVisible (false); assessFields_[i].setVisible (false); } + assessDefaults_.setVisible (false); // Uniaxial: one weighting, no vector sum weightingLabels_[0].setText (uniaxial ? "Weighting" : "Weighting X", juce::dontSendNotification); for (int a = 1; a < 3; ++a) @@ -1159,7 +1244,153 @@ class InputsComponent : public juce::Component, repaint(); } if (anyAccel) + { loadAccelSettings(); + loadAssessment(); + } + } + + //========================================================================== + // Assessment group: which controls a profile uses (spec §9.3) + using Limits = vib::AssessmentLimits; + using Setter = std::function; + + struct AssessLayout + { + juce::String desc; + std::vector> combos; // label, items + std::vector setters; + std::vector> fields; // label, member + }; + + static AssessLayout assessLayout (vib::Profile p, const Limits& l) + { + AssessLayout a; + switch (p) + { + case vib::Profile::WholeBodyHealth: + a.desc = U ("A(8) of the highest k·" "a_w, or the daily VDV; exposure time from the accelerometer group."); + a.combos = { { "Standard", { "EU 2002/44/EC", U ("Germany (LärmVibrationsArbSchV)") } }, + { "Criterion", { "A(8)", "VDV" } } }; + a.setters = { [] (Limits& x, int v) { vib::applyWholeBodyPreset (x, (vib::WholeBodyPreset) v); }, + [] (Limits& x, int v) { x.wbCriterion = (vib::WholeBodyCriterion) v; } }; + a.fields = { { U ("Action (m/s²)"), &Limits::wbAction }, + { U ("Limit X/Y (m/s²)"), &Limits::wbLimitXY }, + { U ("Limit Z (m/s²)"), &Limits::wbLimitZ }, + { "VDV action", &Limits::wbVdvAction }, + { "VDV limit", &Limits::wbVdvLimit } }; + break; + case vib::Profile::HandArm: + a.desc = "A(8) of a_hv against the EU 2002/44/EC action and limit values."; + a.fields = { { U ("Action (m/s²)"), &Limits::haAction }, + { U ("Limit (m/s²)"), &Limits::haLimit } }; + break; + case vib::Profile::WholeBodyComfort: + a.desc = "ISO 2631-1 Annex C comfort scale for a_v (informative, no limit values)."; + break; + case vib::Profile::MachineryIso20816: + case vib::Profile::MachineryLowSpeed: + a.desc = U ("Largest axis v_rms over the measurement → zones A–" "D (ISO 10816-3 / 20816-3)."); + a.combos = { { "Machine group", { U ("Group 1 (> 300 kW)"), U ("Group 2 (15–" "300 kW)") } }, + { "Foundation", { "Rigid", "Flexible" } } }; + a.setters = { [] (Limits& x, int v) { vib::applyMachineryPreset (x, (vib::MachineGroup) v, x.machFoundation); }, + [] (Limits& x, int v) { vib::applyMachineryPreset (x, x.machGroup, (vib::Foundation) v); } }; + a.fields = { { "A/B (mm/s)", &Limits::machAB }, { "B/C (mm/s)", &Limits::machBC }, { "C/D (mm/s)", &Limits::machCD } }; + break; + case vib::Profile::BuildingPerception: + a.desc = U ("DIN 4150-2: KB_Fmax against A_u / A_o, then KB_FTr = KB_FTm · sqrt(T_e / T_r) against A_r."); + a.combos = { { "Zone", { "Industrial (GI)", "Commercial (GE)", "Mixed (MI, MD, MK)", + "Residential (WR, WA)", "Hospitals, spa (SO)" } }, + { "Period", { U ("Day (T_r 16 h)"), U ("Night (T_r 8 h)") } } }; + a.setters = { [] (Limits& x, int v) { vib::applyDin4150_2Preset (x, (vib::Din4150Zone) v, x.din2Night); }, + [] (Limits& x, int v) { vib::applyDin4150_2Preset (x, x.din2Zone, v == 1); } }; + a.fields = { { "A_u", &Limits::din2Au }, { "A_o", &Limits::din2Ao }, { "A_r", &Limits::din2Ar }, + { "T_e exposure (h)", &Limits::din2ExposureHours } }; + break; + case vib::Profile::BuildingStructural: + a.desc = l.din3Location == vib::Din4150Location::Foundation + ? U ("DIN 4150-3: PPV per axis against the value at its dominant frequency (linear between 10, 50 and 100 Hz).") + : U ("DIN 4150-3: PPV against one value for all frequencies (top floor: X/Y, floor slab: Z)."); + a.combos = { { "Building", { "Line 1 commercial", "Line 2 residential", "Line 3 sensitive" } }, + { "Duration", { "Short-term", "Long-term" } }, + { "Location", { "Foundation", "Top floor, horizontal", "Floor slab, vertical" } } }; + a.setters = { [] (Limits& x, int v) { vib::applyDin4150_3Preset (x, (vib::Din4150Line) v, x.din3Location, x.din3LongTerm); }, + [] (Limits& x, int v) { vib::applyDin4150_3Preset (x, x.din3Line, x.din3Location, v == 1); }, + [] (Limits& x, int v) { vib::applyDin4150_3Preset (x, x.din3Line, (vib::Din4150Location) v, x.din3LongTerm); } }; + if (l.din3Location == vib::Din4150Location::Foundation) + a.fields = { { U ("1–" "10 Hz (mm/s)"), &Limits::din3At10 }, + { "50 Hz (mm/s)", &Limits::din3At50 }, + { "100 Hz (mm/s)", &Limits::din3At100 } }; + else + a.fields = { { "Guideline (mm/s)", &Limits::din3Single } }; + break; + case vib::Profile::Custom: + case vib::Profile::StructureBorne: + case vib::Profile::NumProfiles: + a.desc = "No assessment for this profile."; + break; + } + return a; + } + + static int comboValue (vib::Profile p, const Limits& l, int i) + { + switch (p) + { + case vib::Profile::WholeBodyHealth: return i == 0 ? (int) l.wbPreset : (int) l.wbCriterion; + case vib::Profile::MachineryIso20816: + case vib::Profile::MachineryLowSpeed: return i == 0 ? (int) l.machGroup : (int) l.machFoundation; + case vib::Profile::BuildingPerception: return i == 0 ? (int) l.din2Zone : (l.din2Night ? 1 : 0); + case vib::Profile::BuildingStructural: return i == 0 ? (int) l.din3Line : i == 1 ? (l.din3LongTerm ? 1 : 0) + : (int) l.din3Location; + default: break; + } + return 0; + } + + void loadAssessment() + { + const auto p = processor_.getVibrationProfile(); + const auto l = processor_.getAssessmentLimits(); + const int key = (int) p * 16 + (int) l.din3Location; + if (key != assessKey_) + { + assessKey_ = key; + const auto a = assessLayout (p, l); + assessDesc_.setText (a.desc, juce::dontSendNotification); + comboSetters_ = a.setters; + for (int i = 0; i < kAssessCombos; ++i) + { + const bool used = i < (int) a.combos.size(); + assessCombos_[i].clear (juce::dontSendNotification); + if (used) + { + assessComboLabels_[i].setText (a.combos[(size_t) i].first, juce::dontSendNotification); + assessCombos_[i].addItemList (a.combos[(size_t) i].second, 1); + } + assessComboLabels_[i].setVisible (accelVisible_ && used); + assessCombos_[i].setVisible (accelVisible_ && used); + } + fieldMembers_.clear(); + for (int i = 0; i < kAssessFields; ++i) + { + const bool used = i < (int) a.fields.size(); + if (used) + { + assessFieldLabels_[i].setText (a.fields[(size_t) i].first, juce::dontSendNotification); + fieldMembers_.push_back (a.fields[(size_t) i].second); + } + assessFieldLabels_[i].setVisible (accelVisible_ && used); + assessFields_[i].setVisible (accelVisible_ && used); + } + assessDefaults_.setVisible (accelVisible_ && (! a.fields.empty())); + } + for (int i = 0; i < (int) comboSetters_.size(); ++i) + if (! assessCombos_[i].isPopupActive()) + assessCombos_[i].setSelectedId (comboValue (p, l, i) + 1, juce::dontSendNotification); + for (int i = 0; i < (int) fieldMembers_.size(); ++i) + if (! assessFields_[i].isBeingEdited()) + assessFields_[i].setValue (l.*fieldMembers_[(size_t) i]); } std::vector accelComponents() @@ -1168,7 +1399,8 @@ class InputsComponent : public juce::Component, &mainLabel_, &mainCombo_, &quantityLabel_, &quantityCombo_, &highPassLabel_, &highPass_, &tauLabel_, &tauCombo_, &bandLabel_, &bandLow_, &bandHigh_, &serialLabel_, &serialEditor_, - &rangeLabel_, &lowerLimit_, &upperLimit_, &exposureLabel_, &exposure_ }; + &rangeLabel_, &lowerLimit_, &upperLimit_, &exposureLabel_, &exposure_, + &assessTitle_, &assessDesc_ }; for (int a = 0; a < 3; ++a) { v.push_back (&weightingLabels_[a]); v.push_back (&weightingCombos_[a]); @@ -1206,6 +1438,18 @@ class InputsComponent : public juce::Component, juce::Label exposureLabel_; NumberField exposure_ { 0.01, 24.0, 2, "h" }; + static constexpr int kAssessCombos = 3, kAssessFields = 6; + juce::Rectangle assessCard_; + juce::Label assessTitle_, assessDesc_; + juce::Label assessComboLabels_[kAssessCombos], assessFieldLabels_[kAssessFields]; + juce::ComboBox assessCombos_[kAssessCombos]; + NumberField assessFields_[kAssessFields] { { 0.0, 1000.0, 2 }, { 0.0, 1000.0, 2 }, { 0.0, 1000.0, 2 }, + { 0.0, 1000.0, 2 }, { 0.0, 1000.0, 2 }, { 0.0, 1000.0, 2 } }; + juce::TextButton assessDefaults_ { "Defaults" }; + std::vector comboSetters_; + std::vector fieldMembers_; + int assessKey_ = -1; // profile + DIN 4150-3 location the controls are laid out for + JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (InputsComponent) }; @@ -1218,10 +1462,10 @@ class InputsWindow : public juce::DocumentWindow { setUsingNativeTitleBar (false); content_ = new InputsComponent (p, light); - content_->setSize (960, 720); + content_->setSize (960, 880); setContentOwned (content_, true); setResizable (true, false); - setResizeLimits (860, 420, 1600, 1400); + setResizeLimits (860, 640, 1600, 1400); } void setLightMode (bool light) { content_->setLightMode (light); } diff --git a/Source/PluginEditor.cpp b/Source/PluginEditor.cpp index 8848894..aa2a61f 100644 --- a/Source/PluginEditor.cpp +++ b/Source/PluginEditor.cpp @@ -574,6 +574,7 @@ bool SPLMeterAudioProcessorEditor::updateVibrationPanel() for (int a = 0; a < 3; ++a) st.k[a] = settings.k[a]; st.exposureHours = audioProcessor.getAccelSensorInfo().exposureHours; + st.limits = audioProcessor.getAssessmentLimits(); const auto missingText = missing.isEmpty() ? juce::String() : missing.joinIntoString (", ") + (missing.size() == 1 ? " is" : " are") + " not available on this input"; @@ -654,6 +655,8 @@ bool SPLMeterAudioProcessorEditor::updateVibrationPanel() else if (missingText.isNotEmpty()) st.note = missingText; } + if (st.kind == Kind::Running) + st.assessment = vib::assess (audioProcessor.getVibrationProfile(), st.snap, st.k, st.exposureHours, st.limits); vibPanel.setState (st); vibPanel.setVisible (st.kind != Kind::Hidden); return vibPanel.preferredHeight() != heightBefore; diff --git a/Source/PluginProcessor.cpp b/Source/PluginProcessor.cpp index 523a965..d7c6dea 100644 --- a/Source/PluginProcessor.cpp +++ b/Source/PluginProcessor.cpp @@ -1214,6 +1214,33 @@ void SPLMeterAudioProcessor::setVibrationDisplayUnit (vib::DisplayUnit unit) namespace { + const juce::Identifier kLimitsNode ("AccelLimits"); + + // Numeric assessment limits: key + member (enums and flags are handled separately) + struct LimitKey { const char* key; double vib::AssessmentLimits::* member; double lo, hi; }; + const LimitKey kLimitKeys[] = { + { "wbAction", &vib::AssessmentLimits::wbAction, 0.01, 100.0 }, + { "wbLimitXY", &vib::AssessmentLimits::wbLimitXY, 0.01, 100.0 }, + { "wbLimitZ", &vib::AssessmentLimits::wbLimitZ, 0.01, 100.0 }, + { "wbVdvAction", &vib::AssessmentLimits::wbVdvAction, 0.01, 1000.0 }, + { "wbVdvLimit", &vib::AssessmentLimits::wbVdvLimit, 0.01, 1000.0 }, + { "haAction", &vib::AssessmentLimits::haAction, 0.01, 100.0 }, + { "haLimit", &vib::AssessmentLimits::haLimit, 0.01, 100.0 }, + { "machAB", &vib::AssessmentLimits::machAB, 0.01, 1000.0 }, + { "machBC", &vib::AssessmentLimits::machBC, 0.01, 1000.0 }, + { "machCD", &vib::AssessmentLimits::machCD, 0.01, 1000.0 }, + { "din2Au", &vib::AssessmentLimits::din2Au, 0.001, 100.0 }, + { "din2Ao", &vib::AssessmentLimits::din2Ao, 0.001, 100.0 }, + { "din2Ar", &vib::AssessmentLimits::din2Ar, 0.001, 100.0 }, + { "din2ExposureHours", &vib::AssessmentLimits::din2ExposureHours, 0.0, 16.0 }, + { "din3At10", &vib::AssessmentLimits::din3At10, 0.01, 1000.0 }, + { "din3At50", &vib::AssessmentLimits::din3At50, 0.01, 1000.0 }, + { "din3At100", &vib::AssessmentLimits::din3At100, 0.01, 1000.0 }, + { "din3Single", &vib::AssessmentLimits::din3Single, 0.01, 1000.0 }, + }; + const char* const kLimitEnumKeys[] = { "wbPreset", "wbCriterion", "machGroup", "machFoundation", + "din2Zone", "din2Night", "din3Line", "din3Location", "din3LongTerm" }; + // Keys of UIState/Accel exchanged with JSON settings files const char* const kAccelJsonKeys[] = { "highPassHz", "quantity", "weightingX", "weightingY", "weightingZ", "kx", "ky", "kz", "bandLowHz", "bandHighHz", "tauSec", @@ -1221,6 +1248,50 @@ namespace "mainValue", "profile", "exposureHours" }; } +vib::AssessmentLimits SPLMeterAudioProcessor::getAssessmentLimits() const +{ + auto l = vib::defaultAssessmentLimits(); + const auto node = apvts.state.getChildWithName ("UIState").getChildWithName (kLimitsNode); + if (! node.isValid()) + return l; + for (const auto& k : kLimitKeys) + l.*k.member = juce::jlimit (k.lo, k.hi, (double) node.getProperty (k.key, l.*k.member)); + auto e = [&] (const char* key, int current, int maxV) { return juce::jlimit (0, maxV, (int) node.getProperty (key, current)); }; + l.wbPreset = (vib::WholeBodyPreset) e ("wbPreset", (int) l.wbPreset, 1); + l.wbCriterion = (vib::WholeBodyCriterion) e ("wbCriterion", (int) l.wbCriterion, 1); + l.machGroup = (vib::MachineGroup) e ("machGroup", (int) l.machGroup, 1); + l.machFoundation = (vib::Foundation) e ("machFoundation", (int) l.machFoundation, 1); + l.din2Zone = (vib::Din4150Zone) e ("din2Zone", (int) l.din2Zone, 4); + l.din2Night = e ("din2Night", l.din2Night ? 1 : 0, 1) != 0; + l.din3Line = (vib::Din4150Line) e ("din3Line", (int) l.din3Line, 2); + l.din3Location = (vib::Din4150Location) e ("din3Location", (int) l.din3Location, 2); + l.din3LongTerm = e ("din3LongTerm", l.din3LongTerm ? 1 : 0, 1) != 0; + return l; +} + +void SPLMeterAudioProcessor::setAssessmentLimits (const vib::AssessmentLimits& l) +{ + auto node = getUiState().getOrCreateChildWithName (kLimitsNode, nullptr); + for (const auto& k : kLimitKeys) + node.setProperty (k.key, l.*k.member, nullptr); + node.setProperty ("wbPreset", (int) l.wbPreset, nullptr); + node.setProperty ("wbCriterion", (int) l.wbCriterion, nullptr); + node.setProperty ("machGroup", (int) l.machGroup, nullptr); + node.setProperty ("machFoundation", (int) l.machFoundation, nullptr); + node.setProperty ("din2Zone", (int) l.din2Zone, nullptr); + node.setProperty ("din2Night", l.din2Night ? 1 : 0, nullptr); + node.setProperty ("din3Line", (int) l.din3Line, nullptr); + node.setProperty ("din3Location", (int) l.din3Location, nullptr); + node.setProperty ("din3LongTerm", l.din3LongTerm ? 1 : 0, nullptr); +} + +vib::Assessment SPLMeterAudioProcessor::getVibrationAssessment() const +{ + const auto s = getVibrationSettings(); + return vib::assess (getVibrationProfile(), getVibrationSnapshot(), s.k, + getAccelSensorInfo().exposureHours, getAssessmentLimits()); +} + juce::var SPLMeterAudioProcessor::getInputsJson() const { juce::Array list; @@ -1249,6 +1320,14 @@ juce::var SPLMeterAudioProcessor::getAccelJson() const for (auto* key : kAccelJsonKeys) if (node.hasProperty (key)) o->setProperty (key, node.getProperty (key)); + const auto limits = apvts.state.getChildWithName ("UIState").getChildWithName (kLimitsNode); + if (limits.isValid()) + { + auto* l = new juce::DynamicObject(); + for (int i = 0; i < limits.getNumProperties(); ++i) + l->setProperty (limits.getPropertyName (i), limits.getProperty (limits.getPropertyName (i))); + o->setProperty ("limits", juce::var (l)); + } return juce::var (o); } @@ -1282,6 +1361,16 @@ void SPLMeterAudioProcessor::setInputsAndAccelFromJson (const juce::var& inputs, for (auto* key : kAccelJsonKeys) if (obj->hasProperty (key)) node.setProperty (key, obj->getProperty (key), nullptr); + if (auto* lim = obj->getProperty ("limits").getDynamicObject()) + { + auto ln = getUiState().getOrCreateChildWithName (kLimitsNode, nullptr); + for (const auto& k : kLimitKeys) + if (lim->hasProperty (k.key)) + ln.setProperty (k.key, lim->getProperty (k.key), nullptr); + for (auto* key : kLimitEnumKeys) + if (lim->hasProperty (key)) + ln.setProperty (key, lim->getProperty (key), nullptr); + } } rebuildVibrationEngine(); // getters clamp every value } diff --git a/Source/PluginProcessor.h b/Source/PluginProcessor.h index 09cbd44..6e170f6 100644 --- a/Source/PluginProcessor.h +++ b/Source/PluginProcessor.h @@ -13,6 +13,7 @@ #include "Vibration/CalibratorMeasurement.h" #include "Vibration/Units.h" #include "Vibration/Profiles.h" +#include "Vibration/Assessment.h" #include "RtHandover.h" #include "WavRecording.h" #include @@ -370,6 +371,11 @@ class SPLMeterAudioProcessor : public juce::AudioProcessor juce::String getVibrationProfileKey() const; // CSV/JSON: "hand-arm" or "custom(hand-arm)" juce::String getVibrationMainLabel() const; // e.g. "a_w" + // Assessment reference values (spec §9.3, UIState/AccelLimits); defaults from the standards + vib::AssessmentLimits getAssessmentLimits() const; + void setAssessmentLimits (const vib::AssessmentLimits& limits); + vib::Assessment getVibrationAssessment() const; // of the latest snapshot for the current profile + // Display unit of the vibration readout (UIState/Accel "displayUnit") vib::DisplayUnit getVibrationDisplayUnit() const; void setVibrationDisplayUnit (vib::DisplayUnit unit); diff --git a/Source/Vibration/Assessment.h b/Source/Vibration/Assessment.h new file mode 100644 index 0000000..5d09c09 --- /dev/null +++ b/Source/Vibration/Assessment.h @@ -0,0 +1,362 @@ +#pragma once +#include "Profiles.h" +#include +#include +#include +#include + +namespace vib +{ +//============================================================================== +// Assessment of a measurement against reference values (vibration spec §9.3). +// All limits are editable; the presets below fill them from the standards. +// No JUCE: unit-tested in Tests/VibrationAssessmentTests.cpp. + +enum class Verdict : int +{ + None = 0, // no assessment (profile without one, no data, wrong quantity) + Info, // informative only (ISO 2631-1 comfort scale) + Ok, + Warning, // action value exceeded, zone C + Exceeded // limit value exceeded, zone D, guideline value not met +}; + +struct Assessment +{ + Verdict verdict = Verdict::None; + std::string text; // short, for the panel header (UTF-8) +}; + +// Values are persisted — only append new entries. +enum class WholeBodyPreset : int { Eu = 0, Germany }; +enum class WholeBodyCriterion : int { A8 = 0, Vdv }; +enum class MachineGroup : int { Group1 = 0, Group2 }; +enum class Foundation : int { Rigid = 0, Flexible }; +enum class Din4150Zone : int { Industrial = 0, Commercial, Mixed, Residential, Sensitive }; +enum class Din4150Line : int { Line1 = 0, Line2, Line3 }; +enum class Din4150Location : int { Foundation = 0, TopFloorHorizontal, FloorVertical }; + +struct AssessmentLimits +{ + // Whole-body health: EU 2002/44/EC, Germany LärmVibrationsArbSchV §9 (m/s², m/s^1.75) + WholeBodyPreset wbPreset = WholeBodyPreset::Eu; + WholeBodyCriterion wbCriterion = WholeBodyCriterion::A8; + double wbAction = 0.5, wbLimitXY = 1.15, wbLimitZ = 1.15; + double wbVdvAction = 9.1, wbVdvLimit = 21.0; + + // Hand-arm: EU 2002/44/EC (m/s²) + double haAction = 2.5, haLimit = 5.0; + + // Machinery: ISO 10816-3 / 20816-3 zone boundaries A/B, B/C, C/D (mm/s RMS) + MachineGroup machGroup = MachineGroup::Group2; + Foundation machFoundation = Foundation::Rigid; + double machAB = 1.4, machBC = 2.8, machCD = 4.5; + + // Building perception: DIN 4150-2 Table 1 (KB values), exposure time within T_r + Din4150Zone din2Zone = Din4150Zone::Residential; + bool din2Night = false; + double din2Au = 0.15, din2Ao = 3.0, din2Ar = 0.07; + double din2ExposureHours = 16.0; // T_e; clamped to T_r (day 16 h, night 8 h) + + // Building structural: DIN 4150-3 Tables 1 and 3 (PPV, mm/s) + Din4150Line din3Line = Din4150Line::Line2; + Din4150Location din3Location = Din4150Location::Foundation; + bool din3LongTerm = false; + double din3At10 = 5.0, din3At50 = 15.0, din3At100 = 20.0; // foundation: 1–10 Hz, 50 Hz, 100 Hz + double din3Single = 15.0; // top floor / floor slab, all frequencies +}; + +//============================================================================== +// Presets (sources: spec §14) +inline void applyWholeBodyPreset (AssessmentLimits& l, WholeBodyPreset p) noexcept +{ + l.wbPreset = p; + l.wbAction = 0.5; + l.wbLimitXY = 1.15; + l.wbLimitZ = p == WholeBodyPreset::Germany ? 0.8 : 1.15; + l.wbVdvAction = 9.1; + l.wbVdvLimit = 21.0; +} + +inline void applyMachineryPreset (AssessmentLimits& l, MachineGroup g, Foundation f) noexcept +{ + static const double t[2][2][3] = { { { 2.3, 4.5, 7.1 }, { 3.5, 7.1, 11.0 } }, // group 1: rigid, flexible + { { 1.4, 2.8, 4.5 }, { 2.3, 4.5, 7.1 } } }; // group 2 + l.machGroup = g; + l.machFoundation = f; + const auto& v = t[(int) g == 0 ? 0 : 1][(int) f == 0 ? 0 : 1]; + l.machAB = v[0]; l.machBC = v[1]; l.machCD = v[2]; +} + +inline void applyDin4150_2Preset (AssessmentLimits& l, Din4150Zone z, bool night) noexcept +{ + static const double day[5][3] = { { 0.4, 6, 0.2 }, { 0.3, 6, 0.15 }, { 0.2, 5, 0.1 }, { 0.15, 3, 0.07 }, { 0.1, 3, 0.05 } }; + static const double nightT[5][3] = { { 0.3, 0.6, 0.15 }, { 0.2, 0.4, 0.1 }, { 0.15, 0.3, 0.07 }, { 0.1, 0.2, 0.05 }, { 0.1, 0.15, 0.05 } }; + const int i = std::clamp ((int) z, 0, 4); + const auto& v = night ? nightT[i] : day[i]; + l.din2Zone = (Din4150Zone) i; + l.din2Night = night; + l.din2Au = v[0]; l.din2Ao = v[1]; l.din2Ar = v[2]; + l.din2ExposureHours = night ? 8.0 : 16.0; +} + +inline void applyDin4150_3Preset (AssessmentLimits& l, Din4150Line line, Din4150Location loc, bool longTerm) noexcept +{ + const int i = std::clamp ((int) line, 0, 2); + static const double fdn[3][3] = { { 20, 40, 50 }, { 5, 15, 20 }, { 3, 8, 10 } }; // Table 1: 1–10 Hz, 50 Hz, 100 Hz + static const double topShort[3] = { 40, 15, 8 }; // Table 1, top floor horizontal + static const double topLong[3] = { 10, 5, 2.5 }; // Table 3, top floor horizontal + l.din3Line = (Din4150Line) i; + l.din3Location = loc; + l.din3LongTerm = longTerm; + l.din3At10 = fdn[i][0]; l.din3At50 = fdn[i][1]; l.din3At100 = fdn[i][2]; + switch (loc) + { + case Din4150Location::TopFloorHorizontal: l.din3Single = longTerm ? topLong[i] : topShort[i]; break; + case Din4150Location::FloorVertical: l.din3Single = longTerm ? 10.0 : 20.0; break; // all lines + case Din4150Location::Foundation: l.din3Single = topShort[i]; break; + } +} + +inline AssessmentLimits defaultAssessmentLimits() noexcept +{ + AssessmentLimits l; + applyWholeBodyPreset (l, l.wbPreset); + applyMachineryPreset (l, l.machGroup, l.machFoundation); + applyDin4150_2Preset (l, l.din2Zone, l.din2Night); + applyDin4150_3Preset (l, l.din3Line, l.din3Location, l.din3LongTerm); + return l; +} + +//============================================================================== +// Helpers (also used by the report) + +// DIN 4150-3 Table 1, foundation: constant up to 10 Hz, linear 10–50 and +// 50–100 Hz, the 100 Hz value above. Unknown frequency (≤ 0): the 1–10 Hz value. +inline double din4150_3FoundationLimit (const AssessmentLimits& l, double fHz) noexcept +{ + if (fHz <= 10.0) return l.din3At10; + if (fHz <= 50.0) return l.din3At10 + (l.din3At50 - l.din3At10) * (fHz - 10.0) / 40.0; + if (fHz <= 100.0) return l.din3At50 + (l.din3At100 - l.din3At50) * (fHz - 50.0) / 50.0; + return l.din3At100; +} + +// DIN 4150-2: KB_FTr = KB_FTm · √(T_e / T_r), T_r = 16 h (day) or 8 h (night) +inline double din4150_2RatingHours (bool night) noexcept { return night ? 8.0 : 16.0; } + +inline double kbFTr (double kbFTm, const AssessmentLimits& l) noexcept +{ + const double tr = din4150_2RatingHours (l.din2Night); + return kbFTm * std::sqrt (std::clamp (l.din2ExposureHours, 0.0, tr) / tr); +} + +// ISO 2631-1 Annex C (informative): the bands overlap, overlaps get both names +inline const char* comfortBand (double av) noexcept +{ + if (av < 0.315) return "Not uncomfortable"; + if (av < 0.5) return "A little uncomfortable"; + if (av < 0.63) return "A little to fairly uncomfortable"; + if (av < 0.8) return "Fairly uncomfortable"; + if (av < 1.0) return "Fairly uncomfortable to uncomfortable"; + if (av < 1.25) return "Uncomfortable"; + if (av < 1.6) return "Uncomfortable to very uncomfortable"; + if (av < 2.0) return "Very uncomfortable"; + if (av < 2.5) return "Very to extremely uncomfortable"; + return "Extremely uncomfortable"; +} + +// Daily VDV from a measurement of `measuredSec`: VDV · (T_exp / T_meas)^¼ (ISO 2631-1 §6.3.2) +inline double dailyVdv (double vdv, double measuredSec, double exposureHours) noexcept +{ + if (measuredSec <= 0.0) return vdv; + return vdv * std::pow (std::max (0.0, exposureHours) * 3600.0 / measuredSec, 0.25); +} + +namespace detail +{ + inline std::string num (double v) + { + char b[32]; + std::snprintf (b, sizeof (b), "%g", std::round (v * 1000.0) / 1000.0); + return b; + } + // v > limit, with a relative tolerance: snapshot values are floats, so a value + // on the boundary must not count as exceeded + inline bool above (double v, double limit) noexcept { return v > limit * (1.0 + 1.0e-6); } + + inline const char* axisName (int a) noexcept { static const char* n[3] = { "X", "Y", "Z" }; return n[a]; } + inline bool hasAxis (const VibrationSnapshot& s, int a) noexcept { return (s.axisMask & (1 << a)) != 0; } + inline int numAxes (const VibrationSnapshot& s) noexcept + { + return (int) hasAxis (s, 0) + (int) hasAxis (s, 1) + (int) hasAxis (s, 2); + } + // Σ a_w over the measurement, or the single axis + inline double sumAw (const VibrationSnapshot& s) noexcept + { + if (numAxes (s) > 1 && ! s.uniaxial) return s.axis[AxisSum].awRms; + for (int a = 0; a < 3; ++a) if (hasAxis (s, a)) return s.axis[a].awRms; + return 0.0; + } +} + +//============================================================================== +// The evaluators. `s` holds SI values (m/s², m/s); k are the vector-sum factors. + +inline Assessment assessWholeBodyHealth (const VibrationSnapshot& s, const double (&k)[3], + double exposureHours, const AssessmentLimits& l) +{ + using detail::num; + if (l.wbCriterion == WholeBodyCriterion::Vdv) + { + double vdv = 0.0; + for (int a = 0; a < 3; ++a) + if (detail::hasAxis (s, a)) + vdv = std::max (vdv, k[a] * s.axis[a].vdv); + vdv = dailyVdv (vdv, s.seconds, exposureHours); + if (detail::above (vdv, l.wbVdvLimit)) return { Verdict::Exceeded, "VDV limit value " + num (l.wbVdvLimit) + " exceeded" }; + if (detail::above (vdv, l.wbVdvAction)) return { Verdict::Warning, "VDV action value " + num (l.wbVdvAction) + " exceeded" }; + return { Verdict::Ok, "VDV below action value " + num (l.wbVdvAction) }; + } + + // A(8) of the highest k-weighted axis; the limit can differ for Z (Germany) + double maxA8 = 0.0; + int over = -1; + for (int a = 0; a < 3; ++a) + { + if (! detail::hasAxis (s, a)) continue; + const double a8 = dailyExposureA8 (k[a] * s.axis[a].awRms, exposureHours); + maxA8 = std::max (maxA8, a8); + // A uniaxial sensor uses slot X with X's weighting and k, so the X/Y limit + if (detail::above (a8, a == 2 ? l.wbLimitZ : l.wbLimitXY) && over < 0) + over = a; + } + if (over >= 0) + { + const double lim = over == 2 ? l.wbLimitZ : l.wbLimitXY; + return { Verdict::Exceeded, "Limit value " + num (lim) + " m/s\xc2\xb2 exceeded (" + + (s.uniaxial ? std::string ("axis") : std::string (detail::axisName (over))) + ")" }; + } + if (detail::above (maxA8, l.wbAction)) + return { Verdict::Warning, "Action value " + num (l.wbAction) + " m/s\xc2\xb2 exceeded" }; + return { Verdict::Ok, "Below action value " + num (l.wbAction) + " m/s\xc2\xb2" }; +} + +inline Assessment assessHandArm (const VibrationSnapshot& s, double exposureHours, const AssessmentLimits& l) +{ + using detail::num; + const double a8 = dailyExposureA8 (detail::sumAw (s), exposureHours); + if (detail::above (a8, l.haLimit)) return { Verdict::Exceeded, "Limit value " + num (l.haLimit) + " m/s\xc2\xb2 exceeded" }; + if (detail::above (a8, l.haAction)) return { Verdict::Warning, "Action value " + num (l.haAction) + " m/s\xc2\xb2 exceeded" }; + return { Verdict::Ok, "Below action value " + num (l.haAction) + " m/s\xc2\xb2" }; +} + +inline Assessment assessComfort (const VibrationSnapshot& s) +{ + return { Verdict::Info, comfortBand (detail::sumAw (s)) }; +} + +// Largest axis RMS over the measurement against zones A–D +inline Assessment assessMachinery (const VibrationSnapshot& s, const AssessmentLimits& l) +{ + double v = 0.0; + for (int a = 0; a < 3; ++a) + if (detail::hasAxis (s, a)) + v = std::max (v, (double) s.axis[a].awRms); + v *= 1000.0; // mm/s + if (detail::above (v, l.machCD)) return { Verdict::Exceeded, "Zone D" }; + if (detail::above (v, l.machBC)) return { Verdict::Warning, "Zone C" }; + if (detail::above (v, l.machAB)) return { Verdict::Ok, "Zone B" }; + return { Verdict::Ok, "Zone A" }; +} + +// KB_Fmax ≤ A_u → met; KB_Fmax > A_o → not met; otherwise KB_FTr ≤ A_r → met +inline Assessment assessDin4150_2 (const VibrationSnapshot& s, const AssessmentLimits& l) +{ + double fmax = 0.0, ftm = 0.0; + for (int a = 0; a < 3; ++a) + if (detail::hasAxis (s, a)) + { + fmax = std::max (fmax, (double) s.axis[a].kbFmax); + ftm = std::max (ftm, (double) s.axis[a].kbFTm); + } + fmax *= 1000.0; // KB values are numerically mm/s + const double ftr = kbFTr (ftm * 1000.0, l); + auto le = [] (double v, double limit) { return ! detail::above (v, limit); }; + if (le (fmax, l.din2Au)) return { Verdict::Ok, "KB_Fmax \xe2\x89\xa4 A_u: met" }; + if (! le (fmax, l.din2Ao)) return { Verdict::Exceeded, "KB_Fmax > A_o: not met" }; + if (le (ftr, l.din2Ar)) return { Verdict::Ok, "KB_FTr \xe2\x89\xa4 A_r: met" }; + return { Verdict::Exceeded, "KB_FTr > A_r: not met" }; +} + +// PPV per axis (peak since reset) against the guideline value for the location +inline Assessment assessDin4150_3 (const VibrationSnapshot& s, const AssessmentLimits& l) +{ + using detail::num; + if (l.din3LongTerm && l.din3Location == Din4150Location::Foundation) + return { Verdict::None, "Long-term: measure on the top floor or a floor slab" }; + + double worstRatio = 0.0, worstLimit = 0.0, worstF = 0.0; + int worstAxis = -1; + for (int a = 0; a < 3; ++a) + { + if (! detail::hasAxis (s, a)) continue; + // Top floor: horizontal axes; floor slab: vertical axis; uniaxial: its own axis + if (! s.uniaxial) + { + if (l.din3Location == Din4150Location::TopFloorHorizontal && a == 2) continue; + if (l.din3Location == Din4150Location::FloorVertical && a != 2) continue; + } + const double ppv = s.axis[a].peakMax * 1000.0; // mm/s + const double lim = l.din3Location == Din4150Location::Foundation + ? din4150_3FoundationLimit (l, s.axis[a].fDom) : l.din3Single; + if (lim <= 0.0) continue; + if (ppv / lim > worstRatio || worstAxis < 0) + { + worstRatio = ppv / lim; worstLimit = lim; worstF = s.axis[a].fDom; worstAxis = a; + } + } + if (worstAxis < 0) + return { Verdict::None, "No axis for this location" }; + std::string where = s.uniaxial ? std::string() : std::string (" (") + detail::axisName (worstAxis); + if (l.din3Location == Din4150Location::Foundation) + where += (where.empty() ? " (" : ", ") + (worstF > 0.0 ? num (worstF) + " Hz" : std::string ("f unknown")); + if (! where.empty()) where += ")"; + if (detail::above (worstRatio, 1.0)) + return { Verdict::Exceeded, "Guideline value " + num (worstLimit) + " mm/s exceeded" + where }; + return { Verdict::Ok, "Below guideline value " + num (worstLimit) + " mm/s" + where }; +} + +//============================================================================== +// Assessment for a profile. Profiles without one, an invalid snapshot, no +// measured time yet or a quantity that does not match give Verdict::None. +inline Assessment assess (Profile base, const VibrationSnapshot& s, const double (&k)[3], + double exposureHours, const AssessmentLimits& l) +{ + if (! s.valid || s.axisMask == 0 || s.seconds <= 0.0f) + return {}; + auto needs = [&] (Quantity q) { return s.quantity == (int) q; }; + switch (base) + { + case Profile::WholeBodyHealth: + return needs (Quantity::Acceleration) ? assessWholeBodyHealth (s, k, exposureHours, l) + : Assessment { Verdict::None, "Needs acceleration" }; + case Profile::WholeBodyComfort: + return needs (Quantity::Acceleration) ? assessComfort (s) : Assessment { Verdict::None, "Needs acceleration" }; + case Profile::HandArm: + return needs (Quantity::Acceleration) ? assessHandArm (s, exposureHours, l) + : Assessment { Verdict::None, "Needs acceleration" }; + case Profile::MachineryIso20816: + case Profile::MachineryLowSpeed: + return needs (Quantity::Velocity) ? assessMachinery (s, l) : Assessment { Verdict::None, "Needs velocity" }; + case Profile::BuildingPerception: + return needs (Quantity::Velocity) ? assessDin4150_2 (s, l) : Assessment { Verdict::None, "Needs velocity" }; + case Profile::BuildingStructural: + return needs (Quantity::Velocity) ? assessDin4150_3 (s, l) : Assessment { Verdict::None, "Needs velocity" }; + case Profile::Custom: + case Profile::StructureBorne: + case Profile::NumProfiles: + break; + } + return {}; +} +} // namespace vib diff --git a/Source/Vibration/Detectors.h b/Source/Vibration/Detectors.h index 926984d..f7ac029 100644 --- a/Source/Vibration/Detectors.h +++ b/Source/Vibration/Detectors.h @@ -24,7 +24,7 @@ struct AxisValues float crest = 0.0f; // peakMax / awRms float fDom = 0.0f; // dominant frequency at peakMax (Hz; half-period between zero crossings) float kbFmax = 0.0f; // max of the running RMS with τ = 0.125 s (KB_Fmax) - float kbFTr = 0.0f; // √(mean of the squared 30 s cycle maxima) (KB_FTr) + float kbFTm = 0.0f; // √(mean of the squared 30 s cycle maxima) (KB_FTm; KB_FTr = KB_FTm · √(T_e / T_r)) }; // Published every snapshot interval (125 ms). Units follow the quantity: @@ -205,7 +205,7 @@ class AxisDetector v.kbFmax = (float) std::sqrt (kbFmax_); // Completed cycles; before the first one completes, the running cycle const double ftr2 = cycleCount_ > 0 ? cycleSumSq_ / (double) cycleCount_ : cycleMax_; - v.kbFTr = (float) std::sqrt (ftr2); + v.kbFTm = (float) std::sqrt (ftr2); return v; } diff --git a/Source/Vibration/Profiles.h b/Source/Vibration/Profiles.h index b2236fb..32ce3bc 100644 --- a/Source/Vibration/Profiles.h +++ b/Source/Vibration/Profiles.h @@ -140,7 +140,7 @@ struct MeasurementSummary float vdv = 0.0f; // Σ: VDV_total, max axis: max k·VDV float mtvv = 0.0f; // Σ or max k·MTVV float crest = 0.0f; // largest axis crest factor - float kbFTr = 0.0f; // largest axis KB_FTr + float kbFTm = 0.0f; // largest axis KB_FTm (KB_FTr: vib::kbFTr) float ppv = 0.0f; // largest axis peak since reset float fDom = 0.0f; // dominant frequency at that peak int ppvAxis = -1; // axis of ppv (0–2) @@ -158,7 +158,7 @@ inline MeasurementSummary summarize (const VibrationSnapshot& s, MainValue m, co r.vdv = std::max (r.vdv, (float) k[a] * v.vdv); r.mtvv = std::max (r.mtvv, (float) k[a] * v.mtvv); r.crest = std::max (r.crest, v.crest); - r.kbFTr = std::max (r.kbFTr, v.kbFTr); + r.kbFTm = std::max (r.kbFTm, v.kbFTm); if (v.peakMax > r.ppv) { r.ppv = v.peakMax; r.fDom = v.fDom; r.ppvAxis = a; } } if ((m == MainValue::SumAw || m == MainValue::SumRms) && axes > 1 && ! s.uniaxial) diff --git a/Source/Vibration/VibrationEngine.h b/Source/Vibration/VibrationEngine.h index 13dbe14..b1389a0 100644 --- a/Source/Vibration/VibrationEngine.h +++ b/Source/Vibration/VibrationEngine.h @@ -212,7 +212,7 @@ class VibrationEngine sum.vdv = (float) std::pow (sumVdv4, 0.25); sum.crest = sum.awRms > 0.0f ? sum.peakMax / sum.awRms : 0.0f; sum.fDom = 0.0f; - sum.kbFmax = sum.kbFTr = 0.0f; // DIN 4150-2 assesses single axes + sum.kbFmax = sum.kbFTm = 0.0f; // DIN 4150-2 assesses single axes out.mainKind = static_cast (settings_.main); out.main = computeMainValue (settings_.main, out, settings_.k); } diff --git a/Source/VibrationPanel.h b/Source/VibrationPanel.h index 3ff31f0..ac6656f 100644 --- a/Source/VibrationPanel.h +++ b/Source/VibrationPanel.h @@ -3,6 +3,7 @@ #include "Vibration/Detectors.h" #include "Vibration/Units.h" #include "Vibration/Profiles.h" +#include "Vibration/Assessment.h" //============================================================================== // Vibration readout below the SPL meter (vibration spec §7.2): one row per axis @@ -25,6 +26,8 @@ class VibrationPanel : public juce::Component juce::String mainLabel; // symbol of snap.main, e.g. "a_w" double k[3] { 1.0, 1.0, 1.0 }; double exposureHours = 8.0; // for A(8) + vib::AssessmentLimits limits; // KB_FTr needs T_e / T_r + vib::Assessment assessment; // status dot + text (spec §9.3) }; std::function onUnitChange; @@ -132,10 +135,27 @@ class VibrationPanel : public juce::Component if (state_.kind == State::Kind::Running) { + auto results = content.removeFromTop (kResultsH).withTrimmedLeft (90); + const auto& a = state_.assessment; + if (a.verdict != vib::Verdict::None && a.text.size() > 0) + { + // Assessment status, right-aligned: dot + text + const juce::Font f (juce::FontOptions().withHeight (13.0f).withStyle ("Bold")); + const auto text = juce::String::fromUTF8 (a.text.c_str()); + const int w = juce::jmin (results.getWidth() / 2, + (int) std::ceil (juce::GlyphArrangement::getStringWidth (f, text)) + 22); + auto area = results.removeFromRight (w); + auto dot = area.removeFromLeft (16).toFloat().withSizeKeepingCentre (10.0f, 10.0f); + g.setColour (verdictColour (a.verdict, textSec)); + g.fillEllipse (dot); + g.setColour (textPri); + g.setFont (f); + g.drawText (text, area.withTrimmedLeft (4), juce::Justification::centredLeft, true); + results.removeFromRight (12); + } g.setColour (textSec); g.setFont (juce::Font (juce::FontOptions().withHeight (13.0f))); - g.drawText (resultsLine(), content.removeFromTop (kResultsH).withTrimmedLeft (90), - juce::Justification::centredLeft, true); + g.drawText (resultsLine(), results, juce::Justification::centredLeft, true); } if (state_.kind == State::Kind::Message) @@ -235,7 +255,10 @@ class VibrationPanel : public juce::Component } else if (m == vib::MainValue::MaxAxisKbFmax) { - text << dot << "KB_FTr " << value (sum.kbFTr); + const double tr = vib::din4150_2RatingHours (state_.limits.din2Night); + text << dot << "KB_FTr " << juce::String (vib::kbFTr (sum.kbFTm * 1000.0, state_.limits), 3) + << " (T_e " << juce::String (juce::jmin (state_.limits.din2ExposureHours, tr), 1) + << " h / T_r " << juce::String (tr, 0) << " h)"; } else if (m == vib::MainValue::MaxAxisPeakMax && sum.ppvAxis >= 0) { @@ -246,6 +269,19 @@ class VibrationPanel : public juce::Component return text; } + juce::Colour verdictColour (vib::Verdict v, juce::Colour neutral) const + { + switch (v) + { + case vib::Verdict::Ok: return light_ ? juce::Colour (0xff248a3d) : juce::Colour (0xff34c759); + case vib::Verdict::Warning: return light_ ? juce::Colour (0xffc93400) : juce::Colour (0xffff9f0a); + case vib::Verdict::Exceeded: return light_ ? juce::Colour (0xffd70015) : juce::Colour (0xffff453a); + case vib::Verdict::Info: return light_ ? juce::Colour (0xff007aff) : juce::Colour (0xff5ac8fa); + case vib::Verdict::None: break; + } + return neutral; + } + struct Row { int slot; juce::String label; juce::Colour colour; }; vib::Quantity quantity() const noexcept { return (vib::Quantity) state_.snap.quantity; } diff --git a/Tests/VibrationAssessmentTests.cpp b/Tests/VibrationAssessmentTests.cpp new file mode 100644 index 0000000..9ded4b1 --- /dev/null +++ b/Tests/VibrationAssessmentTests.cpp @@ -0,0 +1,291 @@ +#include +#include +#include "Vibration/Assessment.h" + +#include +#include + +// Vibration spec §9.3: assessment of a measurement against the reference values +// of EU 2002/44/EC, ISO 2631-1, ISO 10816-3 / 20816-3, DIN 4150-2 and DIN 4150-3. + +using Catch::Approx; +using namespace vib; + +namespace +{ +const double kOne[3] { 1.0, 1.0, 1.0 }; +const double kHealth[3] { 1.4, 1.4, 1.0 }; + +VibrationSnapshot snap (Quantity q, double seconds = 3600.0) +{ + VibrationSnapshot s; + s.valid = true; + s.axisMask = 7; + s.quantity = (int) q; + s.seconds = seconds; + return s; +} + +bool contains (const std::string& s, const char* part) { return s.find (part) != std::string::npos; } +} + +TEST_CASE ("Assessment: default limits are the standards' values", "[vibration][assessment]") +{ + const auto l = defaultAssessmentLimits(); + CHECK (l.wbAction == 0.5); + CHECK (l.wbLimitXY == 1.15); + CHECK (l.wbLimitZ == 1.15); + CHECK (l.haAction == 2.5); + CHECK (l.haLimit == 5.0); + CHECK (l.machAB == 1.4); // group 2, rigid + CHECK (l.machCD == 4.5); + CHECK (l.din2Au == 0.15); // residential, day + CHECK (l.din2Ao == 3.0); + CHECK (l.din2Ar == 0.07); + CHECK (l.din2ExposureHours == 16.0); + CHECK (l.din3At10 == 5.0); // line 2, foundation + CHECK (l.din3At50 == 15.0); + CHECK (l.din3At100 == 20.0); +} + +TEST_CASE ("Assessment: whole-body health A(8), EU and Germany", "[vibration][assessment]") +{ + auto l = defaultAssessmentLimits(); + auto s = snap (Quantity::Acceleration); + + // Z only: A(8) = a_wz at T = 8 h + s.axis[AxisZ].awRms = 0.49f; + CHECK (assess (Profile::WholeBodyHealth, s, kHealth, 8.0, l).verdict == Verdict::Ok); + s.axis[AxisZ].awRms = 0.51f; + CHECK (assess (Profile::WholeBodyHealth, s, kHealth, 8.0, l).verdict == Verdict::Warning); + s.axis[AxisZ].awRms = 1.0f; + CHECK (assess (Profile::WholeBodyHealth, s, kHealth, 8.0, l).verdict == Verdict::Warning); + // T = 2 h halves A(8) + s.axis[AxisZ].awRms = 0.9f; + CHECK (assess (Profile::WholeBodyHealth, s, kHealth, 2.0, l).verdict == Verdict::Ok); + + // Germany: Z limit 0.8, X/Y 1.15 + applyWholeBodyPreset (l, WholeBodyPreset::Germany); + CHECK (l.wbLimitZ == 0.8); + s.axis[AxisZ].awRms = 0.81f; + auto a = assess (Profile::WholeBodyHealth, s, kHealth, 8.0, l); + CHECK (a.verdict == Verdict::Exceeded); + CHECK (contains (a.text, "(Z)")); + + // X with k = 1.4: 0.8 · 1.4 = 1.12 < 1.15, 0.83 · 1.4 = 1.162 > 1.15 + s.axis[AxisZ].awRms = 0.0f; + s.axis[AxisX].awRms = 0.80f; + CHECK (assess (Profile::WholeBodyHealth, s, kHealth, 8.0, l).verdict == Verdict::Warning); + s.axis[AxisX].awRms = 0.83f; + a = assess (Profile::WholeBodyHealth, s, kHealth, 8.0, l); + CHECK (a.verdict == Verdict::Exceeded); + CHECK (contains (a.text, "(X)")); +} + +TEST_CASE ("Assessment: whole-body health VDV, scaled to the daily exposure", "[vibration][assessment]") +{ + auto l = defaultAssessmentLimits(); + l.wbCriterion = WholeBodyCriterion::Vdv; + auto s = snap (Quantity::Acceleration, 3600.0); + + // 1 h measured, 16 h exposure: factor 16^¼ = 2 + CHECK (dailyVdv (5.0, 3600.0, 16.0) == Approx (10.0)); + s.axis[AxisZ].vdv = 4.5f; // → 9.0 + CHECK (assess (Profile::WholeBodyHealth, s, kHealth, 16.0, l).verdict == Verdict::Ok); + s.axis[AxisZ].vdv = 4.6f; // → 9.2 + CHECK (assess (Profile::WholeBodyHealth, s, kHealth, 16.0, l).verdict == Verdict::Warning); + s.axis[AxisZ].vdv = 10.6f; // → 21.2 + CHECK (assess (Profile::WholeBodyHealth, s, kHealth, 16.0, l).verdict == Verdict::Exceeded); +} + +TEST_CASE ("Assessment: hand-arm A(8) of a_hv", "[vibration][assessment]") +{ + const auto l = defaultAssessmentLimits(); + auto s = snap (Quantity::Acceleration); + s.axis[AxisSum].awRms = 2.4f; + CHECK (assess (Profile::HandArm, s, kOne, 8.0, l).verdict == Verdict::Ok); + s.axis[AxisSum].awRms = 2.6f; + CHECK (assess (Profile::HandArm, s, kOne, 8.0, l).verdict == Verdict::Warning); + s.axis[AxisSum].awRms = 5.1f; + CHECK (assess (Profile::HandArm, s, kOne, 8.0, l).verdict == Verdict::Exceeded); + // 10 m/s² for 2 h: A(8) = 5.0 → not above the limit + s.axis[AxisSum].awRms = 10.0f; + CHECK (assess (Profile::HandArm, s, kOne, 2.0, l).verdict == Verdict::Warning); +} + +TEST_CASE ("Assessment: ISO 2631-1 comfort bands are informative", "[vibration][assessment]") +{ + const auto l = defaultAssessmentLimits(); + auto s = snap (Quantity::Acceleration); + s.axis[AxisSum].awRms = 0.2f; + auto a = assess (Profile::WholeBodyComfort, s, kOne, 8.0, l); + CHECK (a.verdict == Verdict::Info); + CHECK (a.text == "Not uncomfortable"); + CHECK (std::string (comfortBand (0.4)) == "A little uncomfortable"); + CHECK (std::string (comfortBand (0.55)) == "A little to fairly uncomfortable"); + CHECK (std::string (comfortBand (1.1)) == "Uncomfortable"); + CHECK (std::string (comfortBand (1.8)) == "Very uncomfortable"); + CHECK (std::string (comfortBand (3.0)) == "Extremely uncomfortable"); +} + +TEST_CASE ("Assessment: machinery zones A-D", "[vibration][assessment]") +{ + auto l = defaultAssessmentLimits(); + auto s = snap (Quantity::Velocity); + auto zone = [&] (double mms) { s.axis[AxisY].awRms = (float) (mms * 1.0e-3); return assess (Profile::MachineryIso20816, s, kOne, 8.0, l); }; + CHECK (zone (1.3).text == "Zone A"); + CHECK (zone (1.5).text == "Zone B"); + CHECK (zone (1.5).verdict == Verdict::Ok); + CHECK (zone (3.0).text == "Zone C"); + CHECK (zone (3.0).verdict == Verdict::Warning); + CHECK (zone (4.6).verdict == Verdict::Exceeded); + + applyMachineryPreset (l, MachineGroup::Group1, Foundation::Flexible); + CHECK (l.machAB == 3.5); + CHECK (l.machBC == 7.1); + CHECK (l.machCD == 11.0); + CHECK (zone (4.6).text == "Zone B"); + CHECK (assess (Profile::MachineryLowSpeed, s, kOne, 8.0, l).text == "Zone B"); +} + +TEST_CASE ("Assessment: DIN 4150-2 decision flow", "[vibration][assessment]") +{ + auto l = defaultAssessmentLimits(); // residential, day: A_u 0.15, A_o 3, A_r 0.07 + auto s = snap (Quantity::Velocity); + auto run = [&] (double fmax, double ftm) + { + s.axis[AxisZ].kbFmax = (float) (fmax * 1.0e-3); + s.axis[AxisZ].kbFTm = (float) (ftm * 1.0e-3); + return assess (Profile::BuildingPerception, s, kOne, 8.0, l); + }; + CHECK (run (0.15, 0.1).verdict == Verdict::Ok); // ≤ A_u + CHECK (contains (run (0.15, 0.1).text, "A_u")); + CHECK (run (3.1, 0.01).verdict == Verdict::Exceeded); // > A_o + CHECK (contains (run (3.1, 0.01).text, "A_o")); + CHECK (run (1.0, 0.07).verdict == Verdict::Ok); // KB_FTr = KB_FTm with T_e = T_r + CHECK (run (1.0, 0.08).verdict == Verdict::Exceeded); + CHECK (contains (run (1.0, 0.08).text, "A_r")); + + // KB_FTr = KB_FTm · √(T_e / T_r): 4 h of 16 h halves it + l.din2ExposureHours = 4.0; + CHECK (kbFTr (0.1, l) == Approx (0.05)); + CHECK (run (1.0, 0.12).verdict == Verdict::Ok); + // T_e is capped at T_r + l.din2ExposureHours = 24.0; + CHECK (kbFTr (0.1, l) == Approx (0.1)); + + // Night preset + applyDin4150_2Preset (l, Din4150Zone::Residential, true); + CHECK (l.din2Au == 0.1); + CHECK (l.din2Ao == 0.2); + CHECK (l.din2Ar == 0.05); + CHECK (l.din2ExposureHours == 8.0); + CHECK (run (0.3, 0.01).verdict == Verdict::Exceeded); + applyDin4150_2Preset (l, Din4150Zone::Industrial, false); + CHECK (l.din2Au == 0.4); + CHECK (l.din2Ao == 6.0); +} + +TEST_CASE ("Assessment: DIN 4150-3 frequency-dependent foundation values", "[vibration][assessment]") +{ + auto l = defaultAssessmentLimits(); // line 2: 5 / 5–15 / 15–20 + CHECK (din4150_3FoundationLimit (l, 0.0) == Approx (5.0)); // unknown → lowest + CHECK (din4150_3FoundationLimit (l, 4.0) == Approx (5.0)); + CHECK (din4150_3FoundationLimit (l, 10.0) == Approx (5.0)); + CHECK (din4150_3FoundationLimit (l, 30.0) == Approx (10.0)); + CHECK (din4150_3FoundationLimit (l, 50.0) == Approx (15.0)); + CHECK (din4150_3FoundationLimit (l, 75.0) == Approx (17.5)); + CHECK (din4150_3FoundationLimit (l, 100.0) == Approx (20.0)); + CHECK (din4150_3FoundationLimit (l, 250.0) == Approx (20.0)); + + applyDin4150_3Preset (l, Din4150Line::Line1, Din4150Location::Foundation, false); + CHECK (din4150_3FoundationLimit (l, 30.0) == Approx (30.0)); + applyDin4150_3Preset (l, Din4150Line::Line3, Din4150Location::Foundation, false); + CHECK (din4150_3FoundationLimit (l, 75.0) == Approx (9.0)); +} + +TEST_CASE ("Assessment: DIN 4150-3 PPV per axis and location", "[vibration][assessment]") +{ + auto l = defaultAssessmentLimits(); + auto s = snap (Quantity::Velocity); + // X: 8 mm/s at 30 Hz (limit 10) → ok; Y: 6 mm/s at 8 Hz (limit 5) → exceeded + s.axis[AxisX].peakMax = 8.0e-3f; s.axis[AxisX].fDom = 30.0f; + s.axis[AxisY].peakMax = 6.0e-3f; s.axis[AxisY].fDom = 8.0f; + auto a = assess (Profile::BuildingStructural, s, kOne, 8.0, l); + CHECK (a.verdict == Verdict::Exceeded); + CHECK (contains (a.text, "(Y, 8 Hz)")); + s.axis[AxisY].fDom = 40.0f; // limit 12.5 + CHECK (assess (Profile::BuildingStructural, s, kOne, 8.0, l).verdict == Verdict::Ok); + + // Top floor, horizontal: X/Y against one value; Z is ignored + applyDin4150_3Preset (l, Din4150Line::Line2, Din4150Location::TopFloorHorizontal, false); + CHECK (l.din3Single == 15.0); + s.axis[AxisZ].peakMax = 30.0e-3f; + CHECK (assess (Profile::BuildingStructural, s, kOne, 8.0, l).verdict == Verdict::Ok); + applyDin4150_3Preset (l, Din4150Line::Line2, Din4150Location::TopFloorHorizontal, true); + CHECK (l.din3Single == 5.0); + CHECK (assess (Profile::BuildingStructural, s, kOne, 8.0, l).verdict == Verdict::Exceeded); + applyDin4150_3Preset (l, Din4150Line::Line3, Din4150Location::TopFloorHorizontal, true); + CHECK (l.din3Single == 2.5); + applyDin4150_3Preset (l, Din4150Line::Line1, Din4150Location::TopFloorHorizontal, true); + CHECK (l.din3Single == 10.0); + + // Floor slab, vertical: Z only; 20 short-term, 10 long-term for all lines + applyDin4150_3Preset (l, Din4150Line::Line3, Din4150Location::FloorVertical, false); + CHECK (l.din3Single == 20.0); + s.axis[AxisZ].peakMax = 19.0e-3f; + CHECK (assess (Profile::BuildingStructural, s, kOne, 8.0, l).verdict == Verdict::Ok); + applyDin4150_3Preset (l, Din4150Line::Line3, Din4150Location::FloorVertical, true); + CHECK (l.din3Single == 10.0); + CHECK (assess (Profile::BuildingStructural, s, kOne, 8.0, l).verdict == Verdict::Exceeded); + + // Long-term values are not defined at the foundation + applyDin4150_3Preset (l, Din4150Line::Line2, Din4150Location::Foundation, true); + CHECK (assess (Profile::BuildingStructural, s, kOne, 8.0, l).verdict == Verdict::None); +} + +TEST_CASE ("Assessment: no verdict without data, profile or matching quantity", "[vibration][assessment]") +{ + const auto l = defaultAssessmentLimits(); + auto s = snap (Quantity::Acceleration); + s.axis[AxisSum].awRms = 10.0f; + CHECK (assess (Profile::StructureBorne, s, kOne, 8.0, l).verdict == Verdict::None); + CHECK (assess (Profile::Custom, s, kOne, 8.0, l).verdict == Verdict::None); + CHECK (assess (Profile::MachineryIso20816, s, kOne, 8.0, l).verdict == Verdict::None); // needs velocity + s.seconds = 0.0; + CHECK (assess (Profile::HandArm, s, kOne, 8.0, l).verdict == Verdict::None); + s.seconds = 10.0; + s.valid = false; + CHECK (assess (Profile::HandArm, s, kOne, 8.0, l).verdict == Verdict::None); +} + +TEST_CASE ("Assessment: uniaxial sensor uses its single axis", "[vibration][assessment]") +{ + auto l = defaultAssessmentLimits(); + applyWholeBodyPreset (l, WholeBodyPreset::Germany); + auto s = snap (Quantity::Acceleration); + s.axisMask = 1; + s.uniaxial = true; + // Slot X with its weighting and k: 0.8 · 1.4 = 1.12 → below the X/Y limit 1.15 (not Z's 0.8) + s.axis[AxisX].awRms = 0.8f; + CHECK (assess (Profile::WholeBodyHealth, s, kHealth, 8.0, l).verdict == Verdict::Warning); + s.axis[AxisX].awRms = 0.83f; + const auto a = assess (Profile::WholeBodyHealth, s, kHealth, 8.0, l); + CHECK (a.verdict == Verdict::Exceeded); + CHECK (contains (a.text, "(axis)")); + s.axis[AxisX].awRms = 2.4f; + CHECK (assess (Profile::HandArm, s, kOne, 8.0, l).verdict == Verdict::Ok); // Σ absent: the axis +} + +TEST_CASE ("Assessment: a value on the boundary is not exceeded", "[vibration][assessment]") +{ + const auto l = defaultAssessmentLimits(); + auto s = snap (Quantity::Velocity); + s.axis[AxisX].awRms = 1.4e-3f; // zone A/B boundary + CHECK (assess (Profile::MachineryIso20816, s, kOne, 8.0, l).text == "Zone A"); + s.axis[AxisX].peakMax = 5.0e-3f; s.axis[AxisX].fDom = 5.0f; // DIN 4150-3 line 2: 5 mm/s + CHECK (assess (Profile::BuildingStructural, s, kOne, 8.0, l).verdict == Verdict::Ok); + auto a = snap (Quantity::Acceleration); + a.axis[AxisSum].awRms = 2.5f; + CHECK (assess (Profile::HandArm, a, kOne, 8.0, l).verdict == Verdict::Ok); +} diff --git a/Tests/VibrationDspTests.cpp b/Tests/VibrationDspTests.cpp index 87439af..8ae602b 100644 --- a/Tests/VibrationDspTests.cpp +++ b/Tests/VibrationDspTests.cpp @@ -539,7 +539,7 @@ TEST_CASE ("Vibration accumulating detectors: PPV with dominant frequency", "[vi } } -TEST_CASE ("Vibration accumulating detectors: KB_Fmax and KB_FTr over 30 s cycles", "[vibration][detectors]") +TEST_CASE ("Vibration accumulating detectors: KB_Fmax and KB_FTm over 30 s cycles", "[vibration][detectors]") { const double twoPi = 2.0 * kPi, fs = 2000.0; // Cycle 1: 0.5 mm/s peak, cycle 2: 1 mm/s, cycle 3: 2 mm/s (rising, so no cycle @@ -552,11 +552,11 @@ TEST_CASE ("Vibration accumulating detectors: KB_Fmax and KB_FTr over 30 s cycle const double r = 1.0 / std::sqrt (2.0); CHECK (v.kbFmax == Approx (2.0e-3 * r).epsilon (0.01)); - CHECK (v.kbFTr == Approx (r * 1.0e-3 * std::sqrt ((0.25 + 1.0 + 4.0) / 3.0)).epsilon (0.01)); + CHECK (v.kbFTm == Approx (r * 1.0e-3 * std::sqrt ((0.25 + 1.0 + 4.0) / 3.0)).epsilon (0.01)); - // Before the first cycle completes, KB_FTr is the running cycle's maximum + // Before the first cycle completes, KB_FTm is the running cycle's maximum const auto early = runDetector (fs, 10.0, [&] (double t) { return 1.0e-3 * std::sin (twoPi * 100.0 * t); }, 1.0); - CHECK (early.kbFTr == Approx (1.0e-3 * r).epsilon (0.01)); + CHECK (early.kbFTm == Approx (1.0e-3 * r).epsilon (0.01)); } TEST_CASE ("Vibration engine: vector sum of the accumulated values", "[vibration][detectors]") diff --git a/Tests/VibrationProcessorTests.cpp b/Tests/VibrationProcessorTests.cpp index 1019389..a2e3ce7 100644 --- a/Tests/VibrationProcessorTests.cpp +++ b/Tests/VibrationProcessorTests.cpp @@ -752,3 +752,47 @@ TEST_CASE ("Input bus: standalone takes up to 32 inputs, plugins 1-8", "[vibrati standalone->setChannelRole (12, SensorRole::AccelUniaxial); CHECK (standalone->getSensorValidity() == SensorConfig::Validity::Uniaxial); } + +TEST_CASE ("Vibration in processor: assessment limits persist and travel in JSON", "[vibration][processor][state]") +{ + juce::ScopedJuceInitialiser_GUI juceInit; + + auto src = std::make_unique(); + auto l = src->getAssessmentLimits(); + CHECK (l.din2Au == Approx (0.15)); // defaults without a stored node + vib::applyDin4150_2Preset (l, vib::Din4150Zone::Mixed, true); + vib::applyWholeBodyPreset (l, vib::WholeBodyPreset::Germany); + l.wbCriterion = vib::WholeBodyCriterion::Vdv; + l.haLimit = 4.2; + vib::applyDin4150_3Preset (l, vib::Din4150Line::Line3, vib::Din4150Location::TopFloorHorizontal, true); + src->setAssessmentLimits (l); + + auto check = [] (const vib::AssessmentLimits& r) + { + CHECK (r.din2Zone == vib::Din4150Zone::Mixed); + CHECK (r.din2Night); + CHECK (r.din2Ao == Approx (0.3)); + CHECK (r.din2ExposureHours == Approx (8.0)); + CHECK (r.wbPreset == vib::WholeBodyPreset::Germany); + CHECK (r.wbCriterion == vib::WholeBodyCriterion::Vdv); + CHECK (r.wbLimitZ == Approx (0.8)); + CHECK (r.haLimit == Approx (4.2)); + CHECK (r.din3Line == vib::Din4150Line::Line3); + CHECK (r.din3Location == vib::Din4150Location::TopFloorHorizontal); + CHECK (r.din3LongTerm); + CHECK (r.din3Single == Approx (2.5)); + }; + + // Plugin state + juce::MemoryBlock blob; + src->getStateInformation (blob); + auto restored = std::make_unique(); + restored->setStateInformation (blob.getData(), (int) blob.getSize()); + check (restored->getAssessmentLimits()); + + // JSON settings file: nested in "accel" + const auto parsed = juce::JSON::parse (juce::JSON::toString (src->getAccelJson())); + auto dst = std::make_unique(); + dst->setInputsAndAccelFromJson (juce::var(), parsed); + check (dst->getAssessmentLimits()); +} diff --git a/docs/VIBRATION_SPEC.md b/docs/VIBRATION_SPEC.md index 3c0417b..8c5a3b5 100644 --- a/docs/VIBRATION_SPEC.md +++ b/docs/VIBRATION_SPEC.md @@ -152,13 +152,13 @@ Unit tests (`Tests/VibrationDspTests.cpp`): | PPV | max \|v(t)\| per axis, plus the **dominant frequency** at the peak (zero-crossing half-period around the peak, cross-checked with the FFT) | DIN 4150-3 | | KB_F(t) | running RMS of KB-weighted velocity, τ = 0.125 s | DIN 4150-2 | | KB_Fmax | max KB_F(t) | DIN 4150-2 | -| KB_FTm / KB_FTr | max of KB_F per 30 s cycle; `KB_FTr = √(1/N · Σ KB_FTi²)` | DIN 4150-2 | +| KB_FTm / KB_FTr | max of KB_F per 30 s cycle; `KB_FTm = √(1/N · Σ KB_FTi²)`, `KB_FTr = KB_FTm · √(T_e / T_r)` (T_r = 16 h day, 8 h night) | DIN 4150-2 | **Vector sum**: `a_v = √(kx²·ax² + ky²·ay² + kz²·az²)`, computed from the per-axis detectors (RMS-type values) or sample-wise (VDV, peak). The vector sum is labelled Σ. Accumulating detectors (a_w,rms, MTVV, VDV, PPV, KB_FTr) reset together with the existing session reset (the same button that resets `sessionPeakDBCSPL_`). They pause during DAW-sync pauses, like the log. -Implementation (step 10, `Source/Vibration/Detectors.h`): every axis detector accumulates a_w,rms (linear), MTVV (exponential τ = 1 s, independent of the running-RMS τ), VDV, crest factor (peak since reset / a_w,rms), KB_Fmax and KB_FTr (τ = 0.125 s; completed 30 s cycles, the running cycle until the first one completes) and the dominant frequency at the PPV (interpolated zero crossings around the peak; for a peak in the first half-cycle of an event, the following half-cycle). Σ combines the axes with the k-factors: a_w,rms and MTVV as √Σ k²·x², VDV_total = (Σ (k·VDV)⁴)^¼ (ISO 2631-1). A(8) = a_w · √(T / 8 h) with the daily exposure time T (`exposureHours`, default 8 h, in the accelerometer group). +Implementation (step 10, `Source/Vibration/Detectors.h`): every axis detector accumulates a_w,rms (linear), MTVV (exponential τ = 1 s, independent of the running-RMS τ), VDV, crest factor (peak since reset / a_w,rms), KB_Fmax and KB_FTm (τ = 0.125 s; completed 30 s cycles, the running cycle until the first one completes; the assessment derives KB_FTr from it, step 11) and the dominant frequency at the PPV (interpolated zero crossings around the peak; for a peak in the first half-cycle of an event, the following half-cycle). Σ combines the axes with the k-factors: a_w,rms and MTVV as √Σ k²·x², VDV_total = (Σ (k·VDV)⁴)^¼ (ISO 2631-1). A(8) = a_w · √(T / 8 h) with the daily exposure time T (`exposureHours`, default 8 h, in the accelerometer group). Settling: after an engine is built (start, settings or role change) the filters run for `0.8 s / highPassHz` (0.5 … 10 s) before the detectors start, so the start-up transient of the high-pass, integrators and weightings does not reach PPV, MTVV, KB_Fmax or the crest factor. The readout shows "--" meanwhile. A session reset does not need settling. @@ -268,9 +268,9 @@ File playback reads that metadata: Mic tracks feed the SPL mix (all tracks for f All limit values ship as **editable defaults** in Settings; the report lists the values actually used. Status markers refer to the sources in §14. - **EU 2002/44/EC** ✔ [E][O]: hand-arm A(8) action 2.5 m/s², limit 5.0 m/s²; whole-body A(8) action 0.5 m/s², limit 1.15 m/s²; alternative whole-body VDV action 9.1, limit 21 m/s^1.75. - **Germany** (LärmVibrationsArbSchV) ⚠ [D] only: whole-body limit 0.8 m/s² in Z, 1.15 m/s² in X/Y. Offered as a "Germany" preset; check the legal text before release. + **Germany** (LärmVibrationsArbSchV §9) ✔ [D][J]: whole-body limit 0.8 m/s² in Z, 1.15 m/s² in X/Y; action value 0.5 m/s²; hand-arm as EU. Offered as the "Germany" preset. A(8) = a · √(T / 8 h), where *a* is the highest axis value with k-factors applied (whole-body) or a_hv (hand-arm). T is entered by the user (default: measurement duration). -- **ISO 2631-1 comfort scale** (unverified, from memory): < 0.315 not uncomfortable · 0.315–0.63 a little · 0.5–1 fairly · 0.8–1.6 uncomfortable · 1.25–2.5 very · > 2 m/s² extremely uncomfortable. Informational only, no pass/fail. +- **ISO 2631-1 Annex C comfort scale** (informative annex) ✔ [C], two secondary sources agree except for the top band: < 0.315 not uncomfortable · 0.315–0.63 a little · 0.5–1 fairly · 0.8–1.6 uncomfortable · 1.25–2.5 very · > 2 m/s² extremely uncomfortable (one source: > 2.5). Overlapping ranges are shown with both names ("Uncomfortable to very uncomfortable"). Informative only, no pass/fail. - **ISO 10816-3 / 20816-3** ✔ [M] (velocity RMS, mm/s), zone boundaries A/B, B/C, C/D: | | Rigid | Flexible | |---|---|---| @@ -278,13 +278,13 @@ All limit values ship as **editable defaults** in Settings; the report lists the | Group 2 (15–300 kW, or shaft height 160–315 mm) | 1.4 / 2.8 / 4.5 | 2.3 / 4.5 / 7.1 | The user selects the group and foundation. ISO 20816-3 keeps the same values. - **DIN 4150-3**, short-term vibration ✔ [H][G][L] (PPV in mm/s at the foundation, for 1–10 Hz / 10–50 Hz / 50–100 Hz, linearly interpolated within each band; last column is the top floor, horizontal, all frequencies): - | Line | Building type | 1–10 | 10–50 | 50–100 | Top floor | - |---|---|---|---|---|---| - | 1 | Commercial / industrial | 20 | 20–40 | 40–50 | 40 | - | 2 | Residential | 5 | 5–15 | 15–20 | 15 | - | 3 | Particularly sensitive / heritage-protected | 3 | 3–8 | 8–10 | 8 | - Above 100 Hz, the 100 Hz values apply. - **Long-term vibration** (top floor, horizontal): line 3 = 2.5 mm/s ✔ [T]; lines 1 = 10 and 2 = 5 mm/s ⚠ from memory, verify. + | Line | Building type | 1–10 | 10–50 | 50–100 | Top floor | Floor slab, vertical | + |---|---|---|---|---|---|---| + | 1 | Commercial / industrial | 20 | 20–40 | 40–50 | 40 | 20 | + | 2 | Residential | 5 | 5–15 | 15–20 | 15 | 20 | + | 3 | Particularly sensitive / heritage-protected | 3 | 3–8 | 8–10 | 8 | 20 | + Above 100 Hz, at least the 100 Hz values apply. + **Long-term vibration** (DIN 4150-3:2016 Table 3) ✔ [T][P]: top floor, horizontal: line 1 = 10, line 2 = 5, line 3 = 2.5 mm/s; floor slab, vertical: 10 mm/s for all lines. No foundation values for long-term vibration. - **DIN 4150-2** ✔ [L] plus consistent values in several expert reports (KB values, dimensionless): | Zone | Day A_u / A_o / A_r | Night A_u / A_o / A_r | |---|---|---| @@ -293,8 +293,19 @@ All limit values ship as **editable defaults** in Settings; the report lists the | Mixed / village / core (MI, MD, MK) | 0.2 / 5 / 0.1 | 0.15 / 0.3 / 0.07 | | Residential (WR, WA) | 0.15 / 3 / 0.07 | 0.1 / 0.2 / 0.05 | | Hospitals, spa areas (SO) | 0.1 / 3 / 0.05 | 0.1 / 0.15 / 0.05 | - Values are from the 1999 edition. Special rules (e.g. a different A_o at night for rail traffic, construction-site tables) are not modelled; the user edits the values in such cases. - Assessment logic: KB_Fmax ≤ A_u → requirement met; KB_Fmax > A_o → not met; otherwise KB_FTr ≤ A_r → met. + Values are from the 1999 edition ✔ [P]; the 2025-08 edition keeps Table 1 and the procedure essentially unchanged [A]. Special rules (rail factor α_Zug and the separate night A_o for new rail lines in 2025, the construction-site Table 2) are not modelled; the user edits the values in such cases. + Assessment logic ✔ [P]: KB_Fmax ≤ A_u → requirement met; KB_Fmax > A_o → not met; otherwise KB_FTr ≤ A_r → met. KB weighting ✔ [K]: high-pass `1/√(1 + (f₀/f)²)`, f₀ = 5.6 Hz, KB_F(t) with τ = 0.125 s. + +**Implementation (step 11, `Source/Vibration/Assessment.h`).** `vib::assess (profile, snapshot, k, exposureHours, limits)` returns a verdict (None, Info, Ok, Warning, Exceeded) and a short text; the base profile decides the evaluator, so "Custom (based on …)" keeps its assessment. The quantity must match (acceleration for human exposure, velocity for machinery and buildings), otherwise there is none. +- Whole-body health: A(8) of the highest k·a_w,rms against action (warning) and limit (exceeded); the limit is per axis (Z vs. X/Y). Criterion VDV: the largest k·VDV scaled to the daily exposure, `VDV · (T_exp / T_meas)^¼`. A uniaxial sensor is slot X with X's weighting and k, so the X/Y limit applies. +- Hand-arm: A(8) of a_hv (Σ a_w,rms, or the single axis). +- Comfort: the band of a_v (Info). +- Machinery: the largest axis linear RMS over the measurement → zone A/B (ok), C (warning), D (exceeded). +- DIN 4150-2: largest axis KB_Fmax and KB_FTm; KB_FTr = KB_FTm · √(T_e / T_r), T_e defaults to T_r (16 h / 8 h) and is clamped to it. +- DIN 4150-3: PPV (peak since reset) per axis; foundation: all axes against the value at the axis' f_dom (unknown f_dom → the 1–10 Hz value); top floor: X/Y; floor slab: Z; long-term at the foundation gives no verdict. +- A value on a limit is not "exceeded" (relative tolerance 1e-6 for the float snapshot). +- Limits live in `UIState/AccelLimits` (enums as ints) and travel in the JSON settings file as `accel.limits`. Presets fill the editable values: whole-body EU / Germany, machine group + foundation, DIN 4150-2 zone + day/night, DIN 4150-3 line + duration + location. The **Assessment** card of the Inputs and Sensors window shows only the controls of the current profile, with a **Defaults** button that reloads the values of the selected presets. +- The Vibration panel shows a coloured dot and the text on the right of the results line (green ok, amber warning, red exceeded, blue info). ### 9.4 Disclaimer (fixed text) @@ -361,13 +372,14 @@ Manual verification: handheld calibrator per axis; compare a short machinery and | Fix: standalone up to 32 inputs, unmuted inputs listed | done | 4ec51b0 | | 9 Profiles | done | 2141ed9 | | 10 Accumulating detectors, engine settling | done | 9a84337 | -| 11 Assessment + status dot | **next** | | -| 12 HTML report | open | | +| Fix: distinct axis colours, short weighting labels, .gitignore | done | b1ed461 | +| 11 Assessment + status dot, verified ⚠ values | done | | +| 12 HTML report | **next** | | | 13 Docs, v3.6.0 bump, PR to main | open | | **Step 11 plan.** `Source/Vibration/Assessment.h` (no JUCE, unit-tested): status None / Ok / Warning / Exceeded with a short text, one evaluator per profile following §9.3 — health (A(8) and VDV against EU action/limit values, Germany preset), hand-arm (A(8)), comfort (informational band), machinery (zones A–D by group and foundation), DIN 4150-2 (zone, day/night, KB_Fmax/A_u/A_o then KB_FTr/A_r), DIN 4150-3 (line, foundation with frequency interpolation via f_dom or top floor, short-/long-term). Limits as editable defaults in `UIState/AccelLimits` (included in JSON export/import), edited in an "Assessment" group of the Inputs and Sensors window. The Vibration panel header gets the status dot and text. Tests cover each evaluator at its boundaries, the DIN 4150-3 interpolation and the DIN 4150-2 decision flow. The ⚠ items of §13 are resolved before release. -Open small items: Vib X colour close to the dBA trace; weighting names truncated in the Inputs window; `.gitignore` for build folders; devices opening more than 32 inputs. +Open small items: devices opening more than 32 inputs still fall back to one input. ### Later @@ -384,12 +396,10 @@ Decided (2026-11-12): 3. Parameters and limits were cross-checked against public sources (§14). 4. DIN 4150-2 zone values ship as editable defaults. -Remaining ⚠ items to check before release: -- DIN 4150-3 long-term values for lines 1 and 2 (10 / 5 mm/s). -- The German whole-body Z limit of 0.8 m/s² (LärmVibrationsArbSchV legal text). -- The ISO 2631-1 comfort scale bands. +Checked on 2026-11-13 (step 11): DIN 4150-3 long-term values [P], the German Z limit [J], the ISO 2631-1 comfort bands [C] (informative; top band > 2 vs. > 2.5 differs between sources), the KB weighting [K] and the DIN 4150-2 flow [P]. This found that KB_FTr needs the factor √(T_e / T_r); the detector value is now called KB_FTm. + +Remaining ⚠ item: - The Wb gain K = 1.024 and the Wm/Wb parameters (single source [V]). The unit-test tables will catch any inconsistency between parameters and response. -- The KB weighting definition (f0 = 5.6 Hz) and the DIN 4150-2 assessment flow; neither has been cross-checked against a public source yet. ## 14. Sources @@ -405,3 +415,8 @@ Remaining ⚠ items to check before release: - [H] HLNUG, Einwirkungen auf Bauwerke: https://www.hlnug.de/themen/erschuetterungen/beurteilung/einwirkungen-auf-bauwerke - [G] Bundesverband Geothermie, Schadensgrenze: https://www.geothermie.de/bibliothek/lexikon-der-geothermie/s/schadensgrenze-erschuetterungen - [T] terrana Geophysik, Regelwerke DIN 4150 und LAI: https://www.terrana-geophysik.de/images/Methode_Erschuetterung.htm +- [J] LärmVibrationsArbSchV §9 (legal text): https://www.gesetze-im-internet.de/l_rmvibrationsarbschv/__9.html +- [P] Erschütterungsabschätzung Isar/Altheim (Regierung von Niederbayern, 2024), quoting DIN 4150-2 Table 1 and the KB_FTr formula and DIN 4150-3:2016 Tables 1 and 3: https://regierung.niederbayern.bayern.de/mam/service/planfeststellungsverfahren/aktuell/20240923_isar_altheim/u_08_03__8.3_erschütterungsabschätzung.pdf +- [A] DAGA 2026, Wie wirkt sich die neue DIN 4150-2 auf die Beurteilung … aus: https://pub.dega-akustik.de/DAGA_2026/files/upload/paper/038.pdf +- [K] LUBW, Messung und Beurteilung von Erschütterungsimmissionen (KB weighting): https://www.lubw.baden-wuerttemberg.de/documents/10184/84452/erschuetterungen.pdf/7727cac7-304a-4bb4-83de-44398f1f980f +- [C] ISO 2631-1 comfort tables in J. Anim. Sci. (2021) https://pmc.ncbi.nlm.nih.gov/articles/PMC7904064/table/T3 and Sensors 21 (2021) 3127 https://pmc.ncbi.nlm.nih.gov/articles/PMC8125624/table/sensors-21-03127-t003 From 10602fc7aebc8c931f2c8dcfe7dd7ef8813f66b7 Mon Sep 17 00:00:00 2001 From: Philipp Paul Klose Date: Fri, 13 Nov 2026 11:38:19 +0100 Subject: [PATCH 21/30] Vibration step 12: HTML vibration report, 1/3-octave spectrum - Source/VibrationReport.h: self-contained HTML (inline CSS + SVG): header, setup, results, assessment with the values used, time history, 1/3-octave spectrum, DIN 4150-3 PPV chart, events, mic summary, disclaimer - Ex-/Import: Save Vibration Report... with metadata dialog (UIState/Report) - Source/Vibration/ThirdOctave.h: multirate 1/3-octave bank (1 Hz - 1250 Hz) in the engine, published in the snapshot - tests: report string checks, band accuracy and selectivity Co-Authored-By: Claude Opus 5.5 --- CMakeLists.txt | 1 + Source/PluginEditor.cpp | 148 +++++- Source/PluginEditor.h | 2 + Source/Vibration/Detectors.h | 4 + Source/Vibration/ThirdOctave.h | 143 ++++++ Source/Vibration/VibrationEngine.h | 16 + Source/VibrationReport.h | 786 +++++++++++++++++++++++++++++ Tests/VibrationDspTests.cpp | 54 ++ Tests/VibrationReportTests.cpp | 183 +++++++ docs/VIBRATION_SPEC.md | 16 +- 10 files changed, 1349 insertions(+), 4 deletions(-) create mode 100644 Source/Vibration/ThirdOctave.h create mode 100644 Source/VibrationReport.h create mode 100644 Tests/VibrationReportTests.cpp diff --git a/CMakeLists.txt b/CMakeLists.txt index 9d93959..f2cb683 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -344,6 +344,7 @@ if(SPLMETER_BUILD_TESTS) Tests/SensorRoleTests.cpp Tests/FftSourceTests.cpp Tests/VibrationProcessorTests.cpp + Tests/VibrationReportTests.cpp ) target_link_libraries(SPLMeterProcessorTests PRIVATE SPLMeter diff --git a/Source/PluginEditor.cpp b/Source/PluginEditor.cpp index aa2a61f..3136a26 100644 --- a/Source/PluginEditor.cpp +++ b/Source/PluginEditor.cpp @@ -1,5 +1,9 @@ #include "PluginEditor.h" #include "VibrationCsv.h" +#include "VibrationReport.h" +#if JucePlugin_Build_Standalone + #include +#endif #include static juce::File splmeterLastFolder() { return UserPrefs::lastUsedFolder(); } @@ -76,7 +80,7 @@ SPLMeterAudioProcessorEditor::SPLMeterAudioProcessorEditor (SPLMeterAudioProcess saveMenuButton.setColour (juce::TextButton::buttonColourId, juce::Colour (0xff3a3a3c)); saveMenuButton.setColour (juce::TextButton::textColourOffId, juce::Colours::white); - saveMenuButton.setTooltip ("Save CSV log, WAV recording, or screenshot"); + saveMenuButton.setTooltip ("Save CSV log, WAV recording, screenshot or vibration report; save or load settings"); saveMenuButton.onClick = [this] { juce::PopupMenu menu; @@ -86,6 +90,8 @@ SPLMeterAudioProcessorEditor::SPLMeterAudioProcessorEditor (SPLMeterAudioProcess menu.addSeparator(); menu.addItem (4, "Save All..."); menu.addSeparator(); + menu.addItem (7, "Save Vibration Report...", canSaveVibrationReport()); + menu.addSeparator(); menu.addItem (5, "Save Settings..."); menu.addItem (6, "Load Settings..."); menu.showMenuAsync ( @@ -100,6 +106,7 @@ SPLMeterAudioProcessorEditor::SPLMeterAudioProcessorEditor (SPLMeterAudioProcess case 4: doSaveAll(); break; case 5: doSaveSettingsJson(); break; case 6: doLoadSettingsJson(); break; + case 7: doSaveVibrationReport(); break; default: break; } }); @@ -825,6 +832,145 @@ void SPLMeterAudioProcessorEditor::doSaveCsv() }); } +//============================================================================== +// Vibration report (spec §9): metadata dialog → file chooser → HTML +bool SPLMeterAudioProcessorEditor::canSaveVibrationReport() const +{ + const auto s = audioProcessor.getVibrationSnapshot(); + return s.valid && s.seconds > 0.0; +} + +namespace +{ + juce::String reportDeviceName (SPLMeterAudioProcessor& p) + { + #if JucePlugin_Build_Standalone + if (juce::JUCEApplicationBase::isStandaloneApp()) + if (auto* holder = juce::StandalonePluginHolder::getInstance()) + if (auto* dev = holder->deviceManager.getCurrentAudioDevice()) + return dev->getName() + " (" + dev->getTypeName() + ")"; + #endif + juce::ignoreUnused (p); + return juce::String ("Plugin in ") + juce::PluginHostType().getHostDescription(); + } + + juce::String reportRoleName (SensorRole r) + { + switch (r) + { + case SensorRole::Mic: return "Mic"; + case SensorRole::AccelX: return "Accel X"; + case SensorRole::AccelY: return "Accel Y"; + case SensorRole::AccelZ: return "Accel Z"; + case SensorRole::AccelUniaxial: return "Accel (uniaxial)"; + case SensorRole::Off: return "Off"; + } + return {}; + } + + const char* const kReportKeys[5] = { "project", "location", "operator", "mounting", "notes" }; +} + +void SPLMeterAudioProcessorEditor::doSaveVibrationReport() +{ + if (! canSaveVibrationReport()) + return; + + auto stored = audioProcessor.getUiState().getOrCreateChildWithName ("Report", nullptr); + auto* aw = new juce::AlertWindow ("Save Vibration Report", + "Details for the report header (remembered for the next report):", + juce::MessageBoxIconType::NoIcon); + const char* labels[5] = { "Project:", "Location / measurement point:", "Operator:", "Sensor mounting:", "Notes:" }; + for (int i = 0; i < 5; ++i) + aw->addTextEditor (kReportKeys[i], stored.getProperty (kReportKeys[i], juce::String()).toString(), labels[i]); + aw->addButton ("Continue", 1, juce::KeyPress (juce::KeyPress::returnKey)); + aw->addButton ("Cancel", 0, juce::KeyPress (juce::KeyPress::escapeKey)); + + aw->enterModalState (true, juce::ModalCallbackFunction::create ([this, aw] (int result) + { + std::unique_ptr owner (aw); + if (result != 1) + return; + + auto node = audioProcessor.getUiState().getOrCreateChildWithName ("Report", nullptr); + for (auto* key : kReportKeys) + node.setProperty (key, aw->getTextEditorContents (key).trim(), nullptr); + + // Collect everything now; the file chooser is asynchronous + VibrationReport::Input in; + in.meta = { aw->getTextEditorContents ("project").trim(), aw->getTextEditorContents ("location").trim(), + aw->getTextEditorContents ("operator").trim(), aw->getTextEditorContents ("mounting").trim(), + aw->getTextEditorContents ("notes").trim() }; + in.version = JucePlugin_VersionString; + in.created = juce::Time::getCurrentTime(); + in.device = reportDeviceName (audioProcessor); + in.sampleRate = audioProcessor.getSampleRate(); + const auto info = audioProcessor.getAccelSensorInfo(); + in.serial = info.serial; + in.lowerLimitHz = info.lowerLimitHz; + in.upperLimitHz = info.upperLimitHz; + in.exposureHours = info.exposureHours; + in.profile = audioProcessor.getVibrationProfile(); + in.profileLabel = audioProcessor.getVibrationProfileLabel(); + in.mainLabel = audioProcessor.getVibrationMainLabel(); + in.settings = audioProcessor.getVibrationSettings(); + in.unit = audioProcessor.getVibrationDisplayUnit(); + in.snap = audioProcessor.getVibrationSnapshot(); + in.limits = audioProcessor.getAssessmentLimits(); + in.log = audioProcessor.copyLog(); + in.timeWeighting = audioProcessor.apvts.getRawParameterValue ("splTimeWeight")->load() > 0.5f ? "S" : "F"; + + if (audioProcessor.isFileModeActive() && audioProcessor.fileHasAccelerometer()) + { + for (const auto& t : audioProcessor.getFileTracks()) + { + in.channels.push_back ({ t.name.isNotEmpty() ? t.name : "Track " + juce::String (t.input + 1), + reportRoleName (t.role), t.calDb, "from the recording", + SensorConfig::isAccel (t.role) }); + in.hasMic = in.hasMic || t.role == SensorRole::Mic; + } + in.device = "File playback"; + } + else + { + const int numInputs = juce::jmin (audioProcessor.getTotalNumInputChannels(), SensorConfig::kMaxInputs); + for (int ch = 0; ch < numInputs; ++ch) + { + const auto role = audioProcessor.getChannelRole (ch); + const bool muted = audioProcessor.apvts.getRawParameterValue ("channelMute" + juce::String (ch))->load() > 0.5f; + if (muted && role == SensorRole::Mic) + continue; + const bool accel = SensorConfig::isAccel (role); + in.channels.push_back ({ audioProcessor.getChannelName (ch), reportRoleName (role), + accel ? audioProcessor.getAccelCalDb (ch) : 0.0, + accel ? audioProcessor.getAccelCalInfo (ch) : juce::String(), accel }); + in.hasMic = in.hasMic || (role == SensorRole::Mic && ! muted); + } + } + for (const auto& m : markerEvents_) + in.events.push_back ({ m.timestampMs, 0, m.text, false }); + for (const auto& p : pauseEvents_) + in.events.push_back ({ p.startMs, p.durationMs, {}, true }); + + fileChooser = std::make_unique ( + "Save vibration report", splmeterLastFolder().getChildFile (VibrationReport::suggestedFileName (in)), "*.html"); + fileChooser->launchAsync ( + juce::FileBrowserComponent::saveMode | juce::FileBrowserComponent::canSelectFiles + | juce::FileBrowserComponent::warnAboutOverwriting, + [in] (const juce::FileChooser& fc) + { + auto file = fc.getResult(); + if (file == juce::File{}) return; + if (! file.hasFileExtension ("html;htm")) + file = file.withFileExtension ("html"); + splmeterSaveLastFolder (file); + if (! file.replaceWithText (VibrationReport::generateHtml (in), false, false, "\n")) + juce::AlertWindow::showMessageBoxAsync (juce::MessageBoxIconType::WarningIcon, + "Save Vibration Report", "Could not write " + file.getFullPathName()); + }); + }), false); +} + void SPLMeterAudioProcessorEditor::doSaveWav() { fileChooser = std::make_unique ( diff --git a/Source/PluginEditor.h b/Source/PluginEditor.h index 4176cad..1a07438 100644 --- a/Source/PluginEditor.h +++ b/Source/PluginEditor.h @@ -276,6 +276,8 @@ class SPLMeterAudioProcessorEditor : public juce::AudioProcessorEditor, void doSaveJpg(); void doSaveAll(); void doSaveSettingsJson(); + void doSaveVibrationReport(); + bool canSaveVibrationReport() const; void doLoadSettingsJson(); static void writeCsvRows (juce::OutputStream&, const std::vector&, const std::vector&, vib::DisplayUnit, diff --git a/Source/Vibration/Detectors.h b/Source/Vibration/Detectors.h index f7ac029..3117395 100644 --- a/Source/Vibration/Detectors.h +++ b/Source/Vibration/Detectors.h @@ -10,6 +10,8 @@ namespace vib // Axis slots of the vibration readout. A uniaxial sensor uses slot X. enum Axis : int { AxisX = 0, AxisY = 1, AxisZ = 2, AxisSum = 3, kNumAxisSlots = 4 }; +constexpr int kNumThirdOctaveBands = 32; // 1 Hz … 1250 Hz (ThirdOctaveBank) + struct AxisValues { float rms = 0.0f; // running RMS (exponential, time constant τ) @@ -40,6 +42,8 @@ struct VibrationSnapshot AxisValues axis[kNumAxisSlots]; int mainKind = 0; // vib::MainValue of the profile float main = 0.0f; // the profile's main value (SI units) + int numBands = 0; // 1/3-octave bands from 1 Hz (ThirdOctaveBank::exactCentre) + float bandRms[3][kNumThirdOctaveBands] {}; // per axis, linear RMS since the last reset }; static_assert (std::is_trivially_copyable_v); diff --git a/Source/Vibration/ThirdOctave.h b/Source/Vibration/ThirdOctave.h new file mode 100644 index 0000000..120e1af --- /dev/null +++ b/Source/Vibration/ThirdOctave.h @@ -0,0 +1,143 @@ +#pragma once +#include "Biquad.h" +#include "Detectors.h" +#include +#include + +namespace vib +{ +//============================================================================== +// 1/3-octave band spectrum of one axis (vibration spec §9.2: linear average over +// the measurement). Base-10 bands (IEC 61260-1): exact centre 10^(i/10) Hz, so +// band 0 is 1 Hz and band 31 is 1250 Hz (nominal). Bands go up to fs/8. +// +// Each band is a 6th-order Butterworth band-pass (3 biquads, band edges +// prewarped). The bank is multirate: every octave down the signal is low-passed +// (6th-order Butterworth at 0.15·rate) and decimated by 2, so each band runs at +// 8–16 times its centre frequency and the 1 Hz band stays well conditioned. +class ThirdOctaveBank +{ +public: + static constexpr int kMaxBands = kNumThirdOctaveBands; + static constexpr int kMaxStages = 14; + + static double exactCentre (int band) noexcept { return std::pow (10.0, band / 10.0); } + + // Nominal centre frequency label (IEC 61260-1 Annex E) + static const char* nominalLabel (int band) noexcept + { + static const char* names[kMaxBands] = { + "1", "1.25", "1.6", "2", "2.5", "3.15", "4", "5", "6.3", "8", + "10", "12.5", "16", "20", "25", "31.5", "40", "50", "63", "80", + "100", "125", "160", "200", "250", "315", "400", "500", "630", "800", + "1000", "1250" }; + return (band >= 0 && band < kMaxBands) ? names[band] : ""; + } + + // 6th-order Butterworth band-pass for edges f1 < f2 at fs: LP→BP transform of + // the 3rd-order prototype, unity gain at the centre + static BiquadCascade<3> bandPass (double f1, double f2, double fs) + { + const double K = 2.0 * fs; + const double w1 = K * std::tan (kPi * f1 / fs); + const double w2 = K * std::tan (kPi * f2 / fs); + const double w0sq = w1 * w2, B = w2 - w1; + + BiquadCascade<3> c; + c.add (Biquad::fromAnalog (0.0, B, 0.0, w0sq, B, 1.0, fs, 0.0)); // prototype pole −1 + const std::complex p (-0.5, std::sqrt (3.0) / 2.0); // pole pair −½ ± j√3/2 + const auto disc = std::sqrt (p * p * B * B - 4.0 * w0sq); + for (const auto& s : { (p * B + disc) * 0.5, (p * B - disc) * 0.5 }) + c.add (Biquad::fromAnalog (0.0, B, 0.0, std::norm (s), -2.0 * s.real(), 1.0, fs, 0.0)); + + const double f0 = fs / kPi * std::atan (std::sqrt (w0sq) / K); // digital centre + c.gain = 1.0 / std::abs (c.response (f0, fs)); + return c; + } + + void prepare (double fs) + { + fs_ = fs; + numBands_ = 0; + while (numBands_ < kMaxBands && exactCentre (numBands_) * 8.0 <= fs) + ++numBands_; + + numStages_ = 1; + for (int b = 0; b < numBands_; ++b) + { + const double fc = exactCentre (b); + int s = (int) std::floor (std::log2 (fs / (8.0 * fc))); + s = std::clamp (s, 0, kMaxStages - 1); + stage_[b] = s; + numStages_ = std::max (numStages_, s + 1); + const double rate = fs / std::pow (2.0, s); + band_[b] = bandPass (fc * std::pow (10.0, -0.05), fc * std::pow (10.0, 0.05), rate); + } + static const double q[3] = { 0.51763809, 0.70710678, 1.93185165 }; // 6th-order Butterworth + for (int s = 0; s + 1 < numStages_; ++s) + { + const double rate = fs / std::pow (2.0, s); + antiAlias_[s].clear(); + for (double qi : q) + antiAlias_[s].add (Biquad::lowPass (0.15 * rate, qi, rate)); + } + resetFilters(); + resetSums(); + } + + void resetFilters() noexcept + { + for (int b = 0; b < numBands_; ++b) band_[b].reset(); + for (int s = 0; s < numStages_; ++s) { antiAlias_[s].reset(); phase_[s] = false; } + } + + void resetSums() noexcept + { + std::fill (std::begin (sumSq_), std::end (sumSq_), 0.0); + std::fill (std::begin (count_), std::end (count_), 0LL); + } + + // One sample at fs; accumulate == false keeps the filters running only + void process (double x, bool accumulate) noexcept + { + double v = x; + for (int s = 0; s < numStages_; ++s) + { + for (int b = 0; b < numBands_; ++b) + if (stage_[b] == s) + { + const double y = band_[b].process (v); + if (accumulate) sumSq_[b] += y * y; + } + if (accumulate) ++count_[s]; + if (s + 1 == numStages_) + break; + const double lp = antiAlias_[s].process (v); + phase_[s] = ! phase_[s]; + if (! phase_[s]) + break; // decimate by 2: every second sample goes down one octave + v = lp; + } + } + + int numBands() const noexcept { return numBands_; } + + // Linear RMS of the band over the accumulated time (0 before any sample) + double bandRms (int band) const noexcept + { + if (band < 0 || band >= numBands_) return 0.0; + const auto n = count_[stage_[band]]; + return n > 0 ? std::sqrt (sumSq_[band] / (double) n) : 0.0; + } + +private: + double fs_ = 12000.0; + int numBands_ = 0, numStages_ = 1; + int stage_[kMaxBands] {}; + BiquadCascade<3> band_[kMaxBands]; + BiquadCascade<3> antiAlias_[kMaxStages]; + bool phase_[kMaxStages] {}; + double sumSq_[kMaxBands] {}; + long long count_[kMaxStages] {}; +}; +} // namespace vib diff --git a/Source/Vibration/VibrationEngine.h b/Source/Vibration/VibrationEngine.h index b1389a0..846f574 100644 --- a/Source/Vibration/VibrationEngine.h +++ b/Source/Vibration/VibrationEngine.h @@ -1,6 +1,7 @@ #pragma once #include "AccelChannel.h" #include "Detectors.h" +#include "ThirdOctave.h" namespace vib { @@ -102,6 +103,7 @@ class VibrationEngine cfg.bandHighHz = settings.bandHighHz; channel_[a].prepare (fs, cfg); fsd_ = channel_[a].decimatedRate(); + bands_[a].prepare (fsd_); axisMask_ |= 1 << a; ++numAxes_; } @@ -124,6 +126,7 @@ class VibrationEngine if (resetPending_) { for (auto& d : detector_) d.reset(); + for (auto& b : bands_) b.resetSums(); meteredSamples_ = 0; mtvvSumSq_ = 0.0; resetPending_ = false; @@ -143,6 +146,10 @@ class VibrationEngine } if (! produced) continue; + const bool accumulate = settleRemaining_ == 0 && metering; + for (int a = 0; a < 3; ++a) + if (input_[a] >= 0) + bands_[a].process (decimated[a], accumulate); if (settleRemaining_ > 0) { --settleRemaining_; // filters run, detectors wait (snapshot stays invalid) @@ -213,6 +220,14 @@ class VibrationEngine sum.crest = sum.awRms > 0.0f ? sum.peakMax / sum.awRms : 0.0f; sum.fDom = 0.0f; sum.kbFmax = sum.kbFTm = 0.0f; // DIN 4150-2 assesses single axes + out.numBands = 0; + for (int a = 0; a < 3; ++a) + { + if (input_[a] < 0) continue; + out.numBands = bands_[a].numBands(); + for (int b = 0; b < kNumThirdOctaveBands; ++b) + out.bandRms[a][b] = (float) bands_[a].bandRms (b); + } out.mainKind = static_cast (settings_.main); out.main = computeMainValue (settings_.main, out, settings_.k); } @@ -222,6 +237,7 @@ class VibrationEngine AccelChannel channel_[3]; int input_[3] { -1, -1, -1 }; AxisDetector detector_[kNumAxisSlots]; + ThirdOctaveBank bands_[3]; int axisMask_ = 0, numAxes_ = 0; double fsd_ = 12000.0; int intervalSamples_ = 1500, intervalCount_ = 0; diff --git a/Source/VibrationReport.h b/Source/VibrationReport.h new file mode 100644 index 0000000..f25c47d --- /dev/null +++ b/Source/VibrationReport.h @@ -0,0 +1,786 @@ +#pragma once +#include +#include "PluginProcessor.h" +#include "Vibration/Assessment.h" +#include "Vibration/ThirdOctave.h" +#include "Vibration/Units.h" + +//============================================================================== +// Vibration report (vibration spec §9): one self-contained HTML file with inline +// CSS and SVG charts, no external resources, printable to PDF from a browser. +// generateHtml() is pure (no files, no processor), unit-tested in +// Tests/VibrationReportTests.cpp; the editor collects the Input. +namespace VibrationReport +{ +//============================================================================== +// All visible text in one place, so a German version can be added (spec §9.1) +struct Text +{ + const char* title = "Vibration measurement report"; + const char* measurement = "Measurement"; + const char* setup = "Setup"; + const char* results = "Results"; + const char* assessment = "Assessment"; + const char* timeHistory = "Time history"; + const char* spectrum = "1/3-octave spectrum (linear average over the measurement)"; + const char* ppvChart = "PPV and dominant frequency (DIN 4150-3)"; + const char* events = "Events"; + const char* micSummary = "Sound level (microphone)"; + const char* disclaimer = "Disclaimer"; + const char* project = "Project"; + const char* location = "Location / measurement point"; + const char* operatorName = "Operator"; + const char* mounting = "Sensor mounting"; + const char* notes = "Notes"; + const char* created = "Report created"; + const char* measuredTime = "Measured time"; + const char* logWindow = "Time history covers"; + const char* software = "Software"; + const char* interface = "Audio interface / host"; + const char* sampleRate = "Sample rate"; + const char* sensor = "Sensor serial"; + const char* usableRange = "Usable range (datasheet)"; + const char* channels = "Input channels"; + const char* profile = "Profile"; + const char* quantity = "Quantity"; + const char* highPass = "High-pass"; + const char* weighting = "Frequency weighting"; + const char* bandLimit = "Band limit"; + const char* kFactors = "k-factors"; + const char* timeConstant = "RMS time constant"; + const char* exposure = "Daily exposure time T"; + const char* mainValue = "Main value"; + const char* noAssessment = "No assessment for this profile."; + const char* noEvents = "No markers or pauses."; + const char* limitsUsed = "Reference values used"; + const char* verdict = "Result"; + const char* outsideRange = "Shaded: outside the sensor's usable range or below the high-pass."; + const char* pauseLabel = "Pause"; + const char* markerLabel = "Marker"; + const char* disclaimerText = + "Measured with SPLMeter v%VERSION% using a general-purpose audio interface. The measurement chain " + "has not been type-tested to ISO 8041-1 / DIN 45669-1. Results are indicative and do not replace a " + "measurement with a certified instrument for legal or contractual assessments."; + + static const Text& english() { static const Text t; return t; } +}; + +struct Meta +{ + juce::String project, location, operatorName, mounting, notes; +}; + +struct ChannelInfo +{ + juce::String name; // e.g. "IN 2" + juce::String role; // "Accel X", "Mic" + double calDb = 0.0; + juce::String calInfo; // "2026-11-12 · calibrator" + bool accel = false; +}; + +struct Event +{ + juce::int64 timeMs = 0; // analysis time (as the log entries) + juce::int64 durationMs = 0; // pauses + juce::String text; + bool pause = false; +}; + +struct Input +{ + Meta meta; + juce::String version; // "3.6.0" + juce::Time created; + juce::String device; + double sampleRate = 48000.0; + juce::String serial; + double lowerLimitHz = 0.5, upperLimitHz = 10000.0; + double exposureHours = 8.0; + std::vector channels; + vib::Profile profile = vib::Profile::Custom; + juce::String profileLabel, mainLabel; + vib::VibrationSettings settings; + vib::DisplayUnit unit = vib::DisplayUnit::Linear; + vib::VibrationSnapshot snap; + vib::AssessmentLimits limits; + std::vector log; + std::vector events; + bool hasMic = false; + juce::String timeWeighting = "F"; // F or S (LAFmax / LASmax) +}; + +//============================================================================== +namespace detail +{ + inline juce::String U (const char* s) { return juce::String::fromUTF8 (s); } + + inline juce::String esc (const juce::String& s) + { + return s.replace ("&", "&").replace ("<", "<").replace (">", ">").replace ("\"", """); + } + + inline juce::String num (double v, int sig = 3) + { + if (! std::isfinite (v)) return "--"; + const double a = std::abs (v); + const int dec = a == 0.0 ? 0 : juce::jlimit (0, 6, sig - 1 - (int) std::floor (std::log10 (a))); + return juce::String (v, dec); + } + + inline vib::Quantity quantity (const Input& in) { return (vib::Quantity) in.snap.quantity; } + + inline juce::String unitLabel (const Input& in) { return U (vib::units::label (in.unit, quantity (in))); } + + inline juce::String value (const Input& in, double si) + { + return U (vib::units::format (si, in.unit, quantity (in)).c_str()); + } + + inline bool hasAxis (const vib::VibrationSnapshot& s, int a) { return (s.axisMask & (1 << a)) != 0; } + + inline bool hasSum (const vib::VibrationSnapshot& s) + { + int n = 0; + for (int a = 0; a < 3; ++a) n += hasAxis (s, a) ? 1 : 0; + return n > 1 && ! s.uniaxial; + } + + inline juce::String axisName (const vib::VibrationSnapshot& s, int slot) + { + if (s.uniaxial) return "Axis"; + if (slot == vib::AxisSum) return U ("\xce\xa3"); + const char* n[3] = { "X", "Y", "Z" }; + return n[slot]; + } + + // Axis colours for print (darker than the app's, same hues) + inline const char* axisColour (int slot) + { + static const char* c[4] = { "#8a6d45", "#2fa889", "#5878a8", "#222222" }; + return c[juce::jlimit (0, 3, slot)]; + } + + inline juce::String weightingName (int w) + { + const char* names[] = { "Unweighted", "Band limit", "Wb", "Wc", "Wd", "We", "Wf", "Wh", "Wj", "Wk", "Wm", "KB" }; + return (w >= 0 && w < (int) std::size (names)) ? juce::String (names[w]) : juce::String(); + } + + inline juce::String duration (double seconds) + { + if (seconds < 60.0) return juce::String (seconds, 1) + " s"; + const int s = (int) std::lround (seconds); + if (s < 3600) return juce::String (s / 60) + " min " + juce::String (s % 60) + " s"; + return juce::String (s / 3600) + " h " + juce::String ((s % 3600) / 60) + " min"; + } + + inline juce::String row (const juce::String& k, const juce::String& v) + { + return "" + k + "" + v + "\n"; + } + + // "Nice" tick step for about n ticks over a range + inline double niceStep (double range, int n) + { + if (range <= 0.0) return 1.0; + const double raw = range / std::max (1, n); + const double mag = std::pow (10.0, std::floor (std::log10 (raw))); + const double r = raw / mag; + return (r < 1.5 ? 1.0 : r < 3.5 ? 2.0 : r < 7.5 ? 5.0 : 10.0) * mag; + } + + // Tick label: as many decimals as the step needs, no trailing zeros + inline juce::String tick (double v, double step) + { + const int dec = juce::jlimit (0, 6, (int) std::ceil (-std::log10 (step) - 1.0e-9)); + return juce::String (std::abs (v) < step * 1.0e-6 ? 0.0 : v, dec); + } + + //========================================================================== + // Minimal SVG plot: frame, ticks, polylines + struct Plot + { + double x0, x1, y0, y1; + bool logX = false, logY = false; + int w = 900, h = 320, L = 72, R = 16, T = 14, B = 44; + juce::String svg; + + double px (double x) const + { + const double t = logX ? (std::log10 (x) - std::log10 (x0)) / (std::log10 (x1) - std::log10 (x0)) + : (x - x0) / (x1 - x0); + return L + t * (w - L - R); + } + double py (double y) const + { + const double t = logY ? (std::log10 (std::max (y, 1.0e-12)) - std::log10 (y0)) / (std::log10 (y1) - std::log10 (y0)) + : (y - y0) / (y1 - y0); + return h - B - juce::jlimit (-0.02, 1.02, t) * (h - T - B); + } + + void begin (const juce::String& xLabel, const juce::String& yLabel) + { + svg << "\n" + << "\n"; + // X ticks + std::vector xt; + if (logX) + { + for (double d = std::pow (10.0, std::floor (std::log10 (x0))); d <= x1 * 1.0001; d *= 10.0) + for (double m : { 1.0, 2.0, 5.0 }) + if (d * m >= x0 * 0.9999 && d * m <= x1 * 1.0001) xt.push_back (d * m); + } + else + { + const double st = niceStep (x1 - x0, 8); + for (double v = std::ceil (x0 / st) * st; v <= x1 + 1e-9; v += st) xt.push_back (v); + } + for (double v : xt) + { + const double x = px (v); + svg << "\n" << tick (v, logX ? v : niceStep (x1 - x0, 8)) << "\n"; + } + // Y ticks + std::vector yt; + if (logY) + { + for (double d = std::pow (10.0, std::floor (std::log10 (y0))); d <= y1 * 1.0001; d *= 10.0) + for (double m : { 1.0, 2.0, 5.0 }) + if (d * m >= y0 * 0.9999 && d * m <= y1 * 1.0001) yt.push_back (d * m); + } + else + { + const double st = niceStep (y1 - y0, 6); + for (double v = std::ceil (y0 / st) * st; v <= y1 + 1e-9; v += st) yt.push_back (v); + } + for (double v : yt) + { + const double y = py (v); + svg << "\n" << tick (v, logY ? v : niceStep (y1 - y0, 6)) << "\n"; + } + svg << "" + << esc (xLabel) << "\n" + << "" + << esc (yLabel) << "\n"; + } + + void polyline (const std::vector>& pts, const char* colour, double width = 1.5, + const char* dash = nullptr) + { + if (pts.size() < 2) return; + svg << "\n"; + } + + void legend (const std::vector>& items) + { + double x = L + 10; + for (const auto& it : items) + { + svg << "" + << "" << esc (it.first) << "\n"; + x += 30 + 8 * it.first.length(); + } + } + + juce::String end() { return svg + "\n"; } + }; + + //========================================================================== + inline juce::String timeHistoryChart (const Input& in) + { + const auto q = quantity (in); + std::vector rows; + for (const auto& e : in.log) + if (e.vib.valid) rows.push_back (&e); + if (rows.size() < 2) + return {}; + const auto t0 = rows.front()->timestampMs; + const double tEnd = (rows.back()->timestampMs - t0) / 1000.0; + + const int slots = hasSum (in.snap) ? 4 : 3; + double lo = 1e300, hi = -1e300; + for (auto* e : rows) + for (int s = 0; s < slots; ++s) + if (s == vib::AxisSum || hasAxis (in.snap, s)) + { + const double v = vib::units::convert (e->vib.rms[s], in.unit, q); + lo = std::min (lo, v); hi = std::max (hi, v); + } + const bool db = vib::units::effective (in.unit, q) == vib::DisplayUnit::Db; + if (db) { lo = std::floor (lo / 10.0) * 10.0; hi = std::max (lo + 20.0, std::ceil (hi / 10.0) * 10.0); } + else { lo = 0.0; hi = hi > 0.0 ? hi * 1.1 : 1.0; } + + Plot p { 0.0, std::max (tEnd, 1.0), lo, hi }; + p.begin ("Time (s)", "RMS (" + unitLabel (in) + ")"); + + // Events: pauses (grey) and markers (red) as vertical lines + for (const auto& ev : in.events) + { + const double t = (ev.timeMs - t0) / 1000.0; + if (t < 0.0 || t > tEnd) continue; + const double x = p.px (t); + p.svg << "\n"; + const auto label = ev.pause ? juce::String (Text::english().pauseLabel) : ev.text; + if (label.isNotEmpty()) + p.svg << "" << esc (label) << "\n"; + } + + std::vector> legend; + for (int s = 0; s < slots; ++s) + { + if (s != vib::AxisSum && ! hasAxis (in.snap, s)) continue; + std::vector> pts; + for (auto* e : rows) + pts.push_back ({ (e->timestampMs - t0) / 1000.0, vib::units::convert (e->vib.rms[s], in.unit, q) }); + p.polyline (pts, axisColour (s), s == vib::AxisSum ? 1.2 : 1.5, s == vib::AxisSum ? "5 3" : nullptr); + legend.push_back ({ axisName (in.snap, s), axisColour (s) }); + } + p.legend (legend); + return p.end(); + } + + inline juce::String spectrumChart (const Input& in) + { + const auto& s = in.snap; + const int nb = std::min (s.numBands, vib::kNumThirdOctaveBands); + if (nb < 2) return {}; + const auto q = quantity (in); + double lo = 1e300, hi = -1e300; + for (int a = 0; a < 3; ++a) + if (hasAxis (s, a)) + for (int b = 0; b < nb; ++b) + if (s.bandRms[a][b] > 0.0f) + { + const double d = vib::units::levelDb (s.bandRms[a][b], q); + lo = std::min (lo, d); hi = std::max (hi, d); + } + if (hi < lo) return {}; + hi = std::ceil (hi / 10.0) * 10.0; + lo = std::max (std::floor (lo / 10.0) * 10.0, hi - 80.0); + if (hi - lo < 20.0) lo = hi - 20.0; + + const double f0 = vib::ThirdOctaveBank::exactCentre (0) / 1.12, f1 = vib::ThirdOctaveBank::exactCentre (nb - 1) * 1.12; + Plot p { f0, f1, lo, hi }; + p.logX = true; + p.begin ("Frequency (Hz)", U (vib::units::label (vib::DisplayUnit::Db, q))); + + // Shade below max (high-pass, lower usable limit) and above the upper usable limit + auto shade = [&] (double fa, double fb) + { + fa = std::max (fa, f0); fb = std::min (fb, f1); + if (fb <= fa) return; + p.svg << "\n"; + }; + shade (f0, std::max (in.settings.highPassHz, in.lowerLimitHz)); + shade (in.upperLimitHz, f1); + + std::vector> legend; + for (int a = 0; a < 3; ++a) + { + if (! hasAxis (s, a)) continue; + std::vector> pts; + for (int b = 0; b < nb; ++b) + pts.push_back ({ vib::ThirdOctaveBank::exactCentre (b), vib::units::levelDb (s.bandRms[a][b], q) }); + p.polyline (pts, axisColour (a)); + for (const auto& pt : pts) + p.svg << "\n"; + legend.push_back ({ axisName (s, a), axisColour (a) }); + } + p.legend (legend); + return p.end(); + } + + inline juce::String ppvChart (const Input& in) + { + const auto& s = in.snap; + Plot p { 1.0, 300.0, 1.0, 100.0 }; + p.logX = p.logY = true; + p.begin ("Dominant frequency (Hz)", "PPV (mm/s)"); + // Foundation lines 1–3 of DIN 4150-3 Table 1 (dashed), the values used (solid) + for (int line = 0; line < 3; ++line) + { + vib::AssessmentLimits l; + vib::applyDin4150_3Preset (l, (vib::Din4150Line) line, vib::Din4150Location::Foundation, false); + std::vector> pts; + for (double f : { 1.0, 10.0, 50.0, 100.0, 300.0 }) + pts.push_back ({ f, vib::din4150_3FoundationLimit (l, f) }); + p.polyline (pts, "#bbb", 1.0, "5 4"); + p.svg << "Line " << (line + 1) << "\n"; + } + std::vector> used; + if (in.limits.din3Location == vib::Din4150Location::Foundation) + for (double f : { 1.0, 10.0, 50.0, 100.0, 300.0 }) + used.push_back ({ f, vib::din4150_3FoundationLimit (in.limits, f) }); + else + used = { { 1.0, in.limits.din3Single }, { 300.0, in.limits.din3Single } }; + p.polyline (used, "#d70015", 2.0); + + std::vector> legend; + for (int a = 0; a < 3; ++a) + { + if (! hasAxis (s, a) || s.axis[a].peakMax <= 0.0f) continue; + const double f = s.axis[a].fDom > 0.0f ? (double) s.axis[a].fDom : 1.0; + p.svg << "\n"; + legend.push_back ({ axisName (s, a), axisColour (a) }); + } + legend.push_back ({ "Values used", "#d70015" }); + p.legend (legend); + return p.end(); + } + + //========================================================================== + inline juce::String resultsTable (const Input& in) + { + const auto& s = in.snap; + const auto q = quantity (in); + std::vector slots; + for (int a = 0; a < 3; ++a) if (hasAxis (s, a)) slots.push_back (a); + if (hasSum (s)) slots.push_back (vib::AxisSum); + + bool kb = false; + for (int a = 0; a < 3; ++a) kb = kb || (hasAxis (s, a) && s.weighting[a] == (int) vib::Weighting::KB); + const auto unit = unitLabel (in); + + juce::String h = ""; + for (int sl : slots) h << ""; + h << "\n"; + auto line = [&] (const juce::String& name, const juce::String& u, std::function f) + { + h << ""; + for (int sl : slots) h << ""; + h << "\n"; + }; + line ("RMS over the measurement", unit, [&] (int sl) { return value (in, s.axis[sl].awRms); }); + line (U ("Running RMS at the end (\xcf\x84 ") + num (in.settings.tauSec) + " s)", unit, + [&] (int sl) { return value (in, s.axis[sl].rms); }); + line (q == vib::Quantity::Velocity ? "Peak since reset (PPV)" : "Peak since reset", unit, + [&] (int sl) { return value (in, s.axis[sl].peakMax); }); + line ("Crest factor", "", [&] (int sl) { return num (s.axis[sl].crest); }); + if (q == vib::Quantity::Acceleration) + { + line ("MTVV", unit, [&] (int sl) { return value (in, s.axis[sl].mtvv); }); + line ("VDV", U ("m/s1.75"), [&] (int sl) { return num (s.axis[sl].vdv); }); + } + if (q == vib::Quantity::Velocity) + line ("Dominant frequency at the peak", "Hz", [&] (int sl) + { return sl == vib::AxisSum || s.axis[sl].fDom <= 0.0f ? juce::String ("--") : num (s.axis[sl].fDom); }); + if (kb) + { + line ("KBFmax", "", [&] (int sl) { return sl == vib::AxisSum ? juce::String ("--") : num (s.axis[sl].kbFmax * 1000.0); }); + line ("KBFTm", "", [&] (int sl) { return sl == vib::AxisSum ? juce::String ("--") : num (s.axis[sl].kbFTm * 1000.0); }); + line ("KBFTr", "", [&] (int sl) + { return sl == vib::AxisSum ? juce::String ("--") : num (vib::kbFTr (s.axis[sl].kbFTm * 1000.0, in.limits)); }); + } + h << "
" << axisName (s, sl) << "Unit
" << name << "" << f (sl) << "" << u << "
\n"; + if (in.profileLabel.isNotEmpty() && in.mainLabel.isNotEmpty()) + h << "

" << Text::english().mainValue << " (" << esc (in.profileLabel) << "): " << esc (in.mainLabel) + << " = " << value (in, s.main) << " " << unit << "

\n"; + return h; + } + + inline const char* verdictClass (vib::Verdict v) + { + switch (v) + { + case vib::Verdict::Ok: return "ok"; + case vib::Verdict::Warning: return "warn"; + case vib::Verdict::Exceeded: return "bad"; + case vib::Verdict::Info: return "info"; + case vib::Verdict::None: break; + } + return "none"; + } + + inline juce::String assessmentSection (const Input& in) + { + const auto& t = Text::english(); + const auto& s = in.snap; + const auto& l = in.limits; + const auto a = vib::assess (in.profile, s, in.settings.k, in.exposureHours, l); + juce::String h; + juce::String standard, params, values; + + switch (in.profile) + { + case vib::Profile::WholeBodyHealth: + { + standard = l.wbPreset == vib::WholeBodyPreset::Germany + ? U ("LärmVibrationsArbSchV \xc2\xa7" "9 (Germany), ISO 2631-1") : "Directive 2002/44/EC, ISO 2631-1"; + params = U ("Criterion: ") + (l.wbCriterion == vib::WholeBodyCriterion::A8 ? "A(8)" : "VDV") + + U (" \xc2\xb7 T = ") + num (in.exposureHours) + " h"; + if (l.wbCriterion == vib::WholeBodyCriterion::A8) + { + for (int ax = 0; ax < 3; ++ax) + if (hasAxis (s, ax)) + values << row ("A(8) " + axisName (s, ax) + U (" (k = ") + num (in.settings.k[ax]) + ")", + num (vib::dailyExposureA8 (in.settings.k[ax] * s.axis[ax].awRms, in.exposureHours)) + + U (" m/s\xc2\xb2")); + values << row ("Action value", num (l.wbAction) + U (" m/s\xc2\xb2")) + << row ("Limit value X/Y", num (l.wbLimitXY) + U (" m/s\xc2\xb2")) + << row ("Limit value Z", num (l.wbLimitZ) + U (" m/s\xc2\xb2")); + } + else + { + double vdv = 0.0; + for (int ax = 0; ax < 3; ++ax) + if (hasAxis (s, ax)) vdv = std::max (vdv, in.settings.k[ax] * s.axis[ax].vdv); + values << row ("VDV measured (max k" + U ("\xc2\xb7") + "VDV)", num (vdv) + U (" m/s1.75")) + << row ("VDV daily exposure", num (vib::dailyVdv (vdv, s.seconds, in.exposureHours)) + U (" m/s1.75")) + << row ("Action value", num (l.wbVdvAction) + U (" m/s1.75")) + << row ("Limit value", num (l.wbVdvLimit) + U (" m/s1.75")); + } + break; + } + case vib::Profile::HandArm: + { + standard = "Directive 2002/44/EC, ISO 5349-1"; + const double ahv = hasSum (s) ? s.axis[vib::AxisSum].awRms : s.axis[0].awRms; + params = U ("T = ") + num (in.exposureHours) + " h"; + values << row ("ahv", num (ahv) + U (" m/s\xc2\xb2")) + << row ("A(8)", num (vib::dailyExposureA8 (ahv, in.exposureHours)) + U (" m/s\xc2\xb2")) + << row ("Action value", num (l.haAction) + U (" m/s\xc2\xb2")) + << row ("Limit value", num (l.haLimit) + U (" m/s\xc2\xb2")); + break; + } + case vib::Profile::WholeBodyComfort: + { + standard = "ISO 2631-1 Annex C (informative)"; + const double av = hasSum (s) ? s.axis[vib::AxisSum].awRms : s.axis[0].awRms; + values << row ("av", num (av) + U (" m/s\xc2\xb2")) + << row ("Comfort scale", U ("< 0.315 not uncomfortable \xc2\xb7 0.315\xe2\x80\x93" "0.63 a little \xc2\xb7 " + "0.5\xe2\x80\x93" "1 fairly \xc2\xb7 0.8\xe2\x80\x93" "1.6 uncomfortable \xc2\xb7 " + "1.25\xe2\x80\x93" "2.5 very \xc2\xb7 > 2 m/s\xc2\xb2 extremely uncomfortable")); + break; + } + case vib::Profile::MachineryIso20816: + case vib::Profile::MachineryLowSpeed: + { + standard = "ISO 10816-3 / ISO 20816-3"; + params = juce::String (l.machGroup == vib::MachineGroup::Group1 ? "Group 1" : "Group 2") + + U (" \xc2\xb7 ") + (l.machFoundation == vib::Foundation::Rigid ? "rigid" : "flexible") + " foundation"; + double v = 0.0; + for (int ax = 0; ax < 3; ++ax) if (hasAxis (s, ax)) v = std::max (v, (double) s.axis[ax].awRms); + values << row ("vrms (largest axis, over the measurement)", num (v * 1000.0) + " mm/s") + << row ("Zone boundaries A/B, B/C, C/D", num (l.machAB) + " / " + num (l.machBC) + " / " + num (l.machCD) + " mm/s"); + break; + } + case vib::Profile::BuildingPerception: + { + standard = "DIN 4150-2"; + const char* zones[5] = { "Industrial (GI)", "Commercial (GE)", "Mixed (MI, MD, MK)", "Residential (WR, WA)", "Hospitals, spa (SO)" }; + const double tr = vib::din4150_2RatingHours (l.din2Night); + params = juce::String (zones[juce::jlimit (0, 4, (int) l.din2Zone)]) + U (" \xc2\xb7 ") + + (l.din2Night ? "night" : "day") + U (" \xc2\xb7 T_r = ") + num (tr) + U (" h \xc2\xb7 T_e = ") + + num (std::min (l.din2ExposureHours, tr)) + " h"; + double fmax = 0.0, ftm = 0.0; + for (int ax = 0; ax < 3; ++ax) + if (hasAxis (s, ax)) { fmax = std::max (fmax, (double) s.axis[ax].kbFmax); ftm = std::max (ftm, (double) s.axis[ax].kbFTm); } + values << row ("KBFmax", num (fmax * 1000.0)) + << row ("KBFTm", num (ftm * 1000.0)) + << row (U ("KBFTr = KBFTm \xc2\xb7 \xe2\x88\x9a(Te/Tr)"), + num (vib::kbFTr (ftm * 1000.0, l))) + << row ("Au / Ao / Ar", num (l.din2Au) + " / " + num (l.din2Ao) + " / " + num (l.din2Ar)); + break; + } + case vib::Profile::BuildingStructural: + { + standard = l.din3LongTerm ? "DIN 4150-3, long-term vibration (Table 3)" : "DIN 4150-3, short-term vibration (Table 1)"; + const char* locs[3] = { "foundation, all directions", "top floor, horizontal", "floor slab, vertical" }; + params = "Line " + juce::String ((int) l.din3Line + 1) + U (" \xc2\xb7 ") + locs[juce::jlimit (0, 2, (int) l.din3Location)]; + for (int ax = 0; ax < 3; ++ax) + if (hasAxis (s, ax)) + { + const double f = s.axis[ax].fDom; + const double lim = l.din3Location == vib::Din4150Location::Foundation + ? vib::din4150_3FoundationLimit (l, f) : l.din3Single; + values << row ("PPV " + axisName (s, ax), + num (s.axis[ax].peakMax * 1000.0) + " mm/s at " + (f > 0.0 ? num (f) + " Hz" : juce::String ("--")) + + U (" \xc2\xb7 value ") + num (lim) + " mm/s"); + } + if (l.din3Location == vib::Din4150Location::Foundation) + values << row (U ("Values 1\xe2\x80\x93" "10 Hz / 50 Hz / 100 Hz"), + num (l.din3At10) + " / " + num (l.din3At50) + " / " + num (l.din3At100) + " mm/s (linear between)"); + else + values << row ("Value, all frequencies", num (l.din3Single) + " mm/s"); + break; + } + case vib::Profile::Custom: + case vib::Profile::StructureBorne: + case vib::Profile::NumProfiles: + return "

" + juce::String (t.noAssessment) + "

\n"; + } + + h << "" << row ("Standard", esc (standard)); + if (params.isNotEmpty()) h << row ("Parameters", params); + h << "
\n

" << t.limitsUsed << "

\n" << values << "
\n"; + h << "

" << t.verdict << ": " + << esc (a.text.empty() ? juce::String ("--") : U (a.text.c_str())) << "

\n"; + return h; + } + + inline juce::String micSection (const Input& in) + { + double sumA = 0.0, sumC = 0.0, maxA = -999.0; + int n = 0; + for (const auto& e : in.log) + { + sumA += std::pow (10.0, e.rmsDBASPL / 10.0); + sumC += std::pow (10.0, e.rmsDBCSPL / 10.0); + maxA = std::max (maxA, (double) e.rmsDBASPL); + ++n; + } + if (n == 0) return {}; + juce::String h = ""; + h << row ("LAeq", juce::String (10.0 * std::log10 (sumA / n), 1) + " dB") + << row ("LCeq", juce::String (10.0 * std::log10 (sumC / n), 1) + " dB") + << row ("LA" + in.timeWeighting + "max", juce::String (maxA, 1) + " dB") + << "
\n

Over the time history period.

\n"; + return h; + } + + inline const char* css() + { + return + "body{font-family:-apple-system,Segoe UI,Helvetica,Arial,sans-serif;color:#1c1c1e;max-width:960px;margin:24px auto;padding:0 16px;font-size:14px}" + "h1{font-size:24px;margin-bottom:4px}h2{font-size:18px;border-bottom:1px solid #ccc;padding-bottom:4px;margin-top:28px}" + "h3{font-size:15px;margin:14px 0 6px}" + "table{border-collapse:collapse;margin:6px 0}th,td{padding:4px 10px;text-align:left;vertical-align:top}" + "table.kv th{font-weight:600;color:#555;width:260px}" + "table.grid th,table.grid td{border:1px solid #ddd}table.grid td{text-align:right;font-variant-numeric:tabular-nums}" + ".chart{width:100%;height:auto;font-size:11px;fill:#333}" + ".verdict{font-size:16px;padding:8px 12px;border-radius:6px;background:#f2f2f7}" + ".dot{display:inline-block;width:12px;height:12px;border-radius:6px;margin-right:8px;background:#999}" + ".ok .dot{background:#248a3d}.warn .dot{background:#c93400}.bad .dot{background:#d70015}.info .dot{background:#007aff}" + ".small{color:#666;font-size:12px}.disclaimer{color:#555;font-size:12px;border-top:1px solid #ccc;padding-top:8px}" + "@media print{body{margin:0;max-width:none}h2{break-after:avoid}svg,table{break-inside:avoid}}"; + } +} + +//============================================================================== +inline juce::String generateHtml (const Input& in) +{ + using namespace detail; + const auto& t = Text::english(); + const auto& s = in.snap; + const auto q = quantity (in); + const char* qNames[3] = { "Acceleration", "Velocity", "Displacement" }; + + juce::String h; + h << "\n\n" << t.title; + if (in.meta.project.isNotEmpty()) h << " - " << esc (in.meta.project); + h << "\n\n"; + h << "

" << t.title << "

\n"; + + // 1. Header + h << "

" << t.measurement << "

\n" + << row (t.project, esc (in.meta.project)) << row (t.location, esc (in.meta.location)) + << row (t.operatorName, esc (in.meta.operatorName)) + << row (t.created, in.created.formatted ("%Y-%m-%d %H:%M:%S")) + << row (t.measuredTime, duration (s.seconds)); + { + juce::int64 first = 0, last = 0; + for (const auto& e : in.log) + if (e.vib.valid) { if (first == 0) first = e.timestampMs; last = e.timestampMs; } + if (last > first) + h << row (t.logWindow, juce::Time (first).formatted ("%H:%M:%S") + U (" \xe2\x80\x93 ") + + juce::Time (last).formatted ("%H:%M:%S") + " (" + duration ((last - first) / 1000.0) + ")"); + } + h << row (t.software, "SPLMeter v" + esc (in.version)) << "
\n"; + + // 2. Setup + h << "

" << t.setup << "

\n" + << row (t.interface, esc (in.device)) << row (t.sampleRate, juce::String (in.sampleRate, 0) + " Hz") + << row (t.sensor, esc (in.serial)) << row (t.mounting, esc (in.meta.mounting)) + << row (t.usableRange, num (in.lowerLimitHz) + U ("\xe2\x80\x93") + num (in.upperLimitHz) + " Hz") + << row (t.profile, esc (in.profileLabel)) + << row (t.quantity, qNames[juce::jlimit (0, 2, (int) q)]) + << row (t.highPass, num (in.settings.highPassHz) + " Hz"); + { + juce::StringArray w; + for (int a = 0; a < 3; ++a) + if (hasAxis (s, a)) w.add (axisName (s, a) + ": " + weightingName ((int) in.settings.weighting[a])); + h << row (t.weighting, w.joinIntoString (U (" \xc2\xb7 "))); + bool band = false; + for (int a = 0; a < 3; ++a) band = band || (hasAxis (s, a) && in.settings.weighting[a] == vib::Weighting::BandLimit); + if (band) h << row (t.bandLimit, num (in.settings.bandLowHz) + U ("\xe2\x80\x93") + num (in.settings.bandHighHz) + " Hz"); + if (hasSum (s)) + h << row (t.kFactors, "x " + num (in.settings.k[0]) + ", y " + num (in.settings.k[1]) + ", z " + num (in.settings.k[2])); + } + h << row (t.timeConstant, num (in.settings.tauSec) + " s") << row (t.exposure, num (in.exposureHours) + " h"); + if (in.meta.notes.isNotEmpty()) h << row (t.notes, esc (in.meta.notes).replace ("\n", "
")); + h << "
\n

" << t.channels << "

\n" + << U ("\n"); + for (const auto& c : in.channels) + h << "\n"; + h << "
InputRoleCal (dB re 1 \xc2\xb5m/s\xc2\xb2 at 0 dBFS)Calibration
" << esc (c.name) << "" << esc (c.role) << "" + << (c.accel ? juce::String (c.calDb, 2) : juce::String ("--")) << "" + << esc (c.calInfo.isNotEmpty() ? c.calInfo : juce::String (c.accel ? "not recorded" : "")) << "
\n"; + + // 3. Results, 4. Assessment + h << "

" << t.results << "

\n" << resultsTable (in); + h << "

" << t.assessment << "

\n" << assessmentSection (in); + + // 5. Charts + const auto th = timeHistoryChart (in); + if (th.isNotEmpty()) h << "

" << t.timeHistory << "

\n" << th; + const auto sp = spectrumChart (in); + if (sp.isNotEmpty()) h << "

" << t.spectrum << "

\n" << sp << "

" << t.outsideRange << "

\n"; + if (in.profile == vib::Profile::BuildingStructural && q == vib::Quantity::Velocity) + h << "

" << t.ppvChart << "

\n" << ppvChart (in); + + // 6. Events + h << "

" << t.events << "

\n"; + if (in.events.empty()) + h << "

" << t.noEvents << "

\n"; + else + { + auto evs = in.events; + std::sort (evs.begin(), evs.end(), [] (const Event& a, const Event& b) { return a.timeMs < b.timeMs; }); + h << "\n"; + for (const auto& e : evs) + h << "\n"; + h << "
TimeEvent
" << juce::Time (e.timeMs).formatted ("%H:%M:%S") << "" + << (e.pause ? juce::String (t.pauseLabel) + " (" + duration (e.durationMs / 1000.0) + ")" + : juce::String (t.markerLabel) + (e.text.isNotEmpty() ? ": " + esc (e.text) : juce::String())) + << "
\n"; + } + + // 7. Mic summary + if (in.hasMic) + { + const auto mic = micSection (in); + if (mic.isNotEmpty()) h << "

" << t.micSummary << "

\n" << mic; + } + + // 8. Disclaimer + h << "

" << t.disclaimer << "

\n

" + << juce::String (t.disclaimerText).replace ("%VERSION%", esc (in.version)) << "

\n"; + h << "\n"; + return h; +} + +inline juce::String suggestedFileName (const Input& in) +{ + auto name = in.meta.project.trim().retainCharacters ("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789 -_") + .replaceCharacter (' ', '_'); + return "SPLMeter_Vibration_" + (name.isNotEmpty() ? name + "_" : juce::String()) + + in.created.formatted ("%Y-%m-%d_%H-%M") + ".html"; +} +} // namespace VibrationReport diff --git a/Tests/VibrationDspTests.cpp b/Tests/VibrationDspTests.cpp index 8ae602b..b1c27d8 100644 --- a/Tests/VibrationDspTests.cpp +++ b/Tests/VibrationDspTests.cpp @@ -603,3 +603,57 @@ TEST_CASE ("Vibration engine: vector sum of the accumulated values", "[vibration CHECK (summary.ppvAxis == AxisZ); CHECK (dailyExposureA8 (0.5, 2.0) == Approx (0.25)); } + +//============================================================================== +// 1/3-octave band spectrum (spec §9.2) +#include "Vibration/ThirdOctave.h" + +TEST_CASE ("Vibration 1/3-octave bank: band range and labels", "[vibration][thirdoctave]") +{ + ThirdOctaveBank bank; + bank.prepare (12000.0); + CHECK (bank.numBands() == 32); // 1250 Hz · 8 ≤ 12 kHz + bank.prepare (8000.0); + CHECK (bank.numBands() == 31); // up to 1000 Hz: 10^3 · 8 = 8000 ≤ 8000 + CHECK (std::string (ThirdOctaveBank::nominalLabel (0)) == "1"); + CHECK (std::string (ThirdOctaveBank::nominalLabel (15)) == "31.5"); + CHECK (ThirdOctaveBank::exactCentre (30) == Approx (1000.0)); +} + +TEST_CASE ("Vibration 1/3-octave bank: a sine reads its RMS in its own band", "[vibration][thirdoctave]") +{ + const double fs = 12000.0, twoPi = 2.0 * kPi; + for (int band : { 0, 5, 10, 17, 24, 30 }) // 1, 3.16, 10, 50, 251, 1000 Hz + { + const double f = ThirdOctaveBank::exactCentre (band); + ThirdOctaveBank bank; + bank.prepare (fs); + const double settle = std::max (4.0, 40.0 / f), measure = std::max (2.0, 60.0 / f); + const long n0 = (long) (settle * fs), n1 = (long) ((settle + measure) * fs); + for (long i = 0; i < n1; ++i) + bank.process (std::sin (twoPi * f * i / fs), i >= n0); + INFO ("band " << band << " (" << f << " Hz)"); + CHECK (dB (bank.bandRms (band) * std::sqrt (2.0)) == Approx (0.0).margin (0.2)); + // Neighbouring bands: a 6th-order Butterworth is ≥ 10 dB down one band away + // (at its edge it is −3 dB, at the next band centre about −13 dB) + if (band > 0) CHECK (dB (bank.bandRms (band - 1) / bank.bandRms (band)) < -10.0); + if (band < 31) CHECK (dB (bank.bandRms (band + 1) / bank.bandRms (band)) < -10.0); + // Two bands away: well below + if (band > 1) CHECK (dB (bank.bandRms (band - 2) / bank.bandRms (band)) < -30.0); + if (band < 30) CHECK (dB (bank.bandRms (band + 2) / bank.bandRms (band)) < -30.0); + } +} + +TEST_CASE ("Vibration 1/3-octave bank: reset clears the averages, not the filters", "[vibration][thirdoctave]") +{ + const double fs = 12000.0, twoPi = 2.0 * kPi; + ThirdOctaveBank bank; + bank.prepare (fs); + for (long i = 0; i < (long) (3 * fs); ++i) + bank.process (std::sin (twoPi * 100.0 * i / fs), true); + bank.resetSums(); + CHECK (bank.bandRms (20) == 0.0); + for (long i = 0; i < (long) (1 * fs); ++i) + bank.process (std::sin (twoPi * 100.0 * i / fs), true); + CHECK (dB (bank.bandRms (20) * std::sqrt (2.0)) == Approx (0.0).margin (0.2)); +} diff --git a/Tests/VibrationReportTests.cpp b/Tests/VibrationReportTests.cpp new file mode 100644 index 0000000..acb2b7c --- /dev/null +++ b/Tests/VibrationReportTests.cpp @@ -0,0 +1,183 @@ +#include +#include +#include "VibrationReport.h" + +// Vibration spec §9: the HTML report (self-contained, sections, values, assessment) + +using Catch::Approx; + +namespace +{ +VibrationReport::Input baseInput (vib::Profile profile) +{ + VibrationReport::Input in; + in.meta = { "Pump & B", "Basement", "PPK", "Stud, M5", "Line 1\nLine 2" }; + in.version = "9.9.9"; + in.created = juce::Time (2026, 10, 13, 14, 30); + in.device = "Test Interface (CoreAudio)"; + in.sampleRate = 48000.0; + in.serial = "SN 4711"; + in.profile = profile; + const auto& def = vib::profileDefinition (profile); + in.settings = def.settings; + in.profileLabel = juce::String::fromUTF8 (def.name); + in.mainLabel = juce::String::fromUTF8 (def.mainLabel); + in.limits = vib::defaultAssessmentLimits(); + in.channels = { { "IN 1", "Mic", 0.0, {}, false }, + { "IN 2", "Accel X", 151.5, juce::String::fromUTF8 ("2026-11-12 · calibrator"), true }, + { "IN 3", "Accel Y", 151.0, {}, true }, + { "IN 4", "Accel Z", 150.5, {}, true } }; + + auto& s = in.snap; + s.valid = true; + s.axisMask = 7; + s.quantity = (int) def.settings.quantity; + for (int a = 0; a < 3; ++a) s.weighting[a] = (int) def.settings.weighting[a]; + s.seconds = 600.0; + for (int a = 0; a < 4; ++a) + { + s.axis[a].rms = s.axis[a].awRms = 0.002f * (float) (a + 1); + s.axis[a].peakMax = 0.006f * (float) (a + 1); + s.axis[a].crest = 3.0f; + s.axis[a].fDom = 25.0f; + s.axis[a].kbFmax = 0.0002f; + s.axis[a].kbFTm = 0.00005f; + } + s.numBands = 32; + for (int a = 0; a < 3; ++a) + for (int b = 0; b < 32; ++b) + s.bandRms[a][b] = 1.0e-4f * (float) (b + 1); + + // 20 s of log, one marker, one pause + const juce::int64 t0 = 1'800'000'000'000LL; + for (int i = 0; i < 160; ++i) + { + LogEntry e; + e.timestampMs = t0 + i * 125; + e.rmsDBASPL = 60.0f; + e.rmsDBCSPL = 70.0f + (i == 50 ? 10.0f : 0.0f); + e.vib.valid = true; + e.vib.axisMask = 7; + e.vib.quantity = s.quantity; + for (int a = 0; a < 4; ++a) e.vib.rms[a] = 0.002f * (float) (a + 1); + in.log.push_back (e); + } + in.events = { { t0 + 5000, 0, "Start ", false }, { t0 + 10000, 3000, {}, true } }; + in.hasMic = true; + return in; +} + +bool has (const juce::String& h, const char* part) { return h.contains (juce::String::fromUTF8 (part)); } +} + +TEST_CASE ("Vibration report: self-contained HTML with all sections", "[vibration][report]") +{ + juce::ScopedJuceInitialiser_GUI juceInit; + const auto h = VibrationReport::generateHtml (baseInput (vib::Profile::MachineryIso20816)); + + CHECK (h.startsWith ("")); + CHECK (h.trimEnd().endsWith ("")); + for (auto* section : { "Measurement", "Setup", "Results", "Assessment", "Time history", + "1/3-octave spectrum", "Events", "Sound level (microphone)", "Disclaimer" }) + CHECK (has (h, section)); + + // No external resources: no scripts, links, images or stylesheets + CHECK_FALSE (h.containsIgnoreCase ("")); + CHECK (has (h, "Start <pump>")); + CHECK (has (h, "Line 1
Line 2")); + + // Setup + CHECK (has (h, "Test Interface (CoreAudio)")); + CHECK (has (h, "SN 4711")); + CHECK (has (h, "151.50")); + CHECK (has (h, "2026-11-12 · calibrator")); + CHECK (has (h, "SPLMeter v9.9.9")); + CHECK (has (h, "10 min 0 s")); + + // Charts: time history, spectrum; no PPV chart for machinery + CHECK (h.indexOf ("= 0); + CHECK (h.indexOf ("Aeq60.0 dB")); + CHECK (has (h, "LAFmax")); + + // Events: marker and pause with duration + CHECK (has (h, "Marker: Start <pump>")); + CHECK (has (h, "Pause (3.0 s)")); + CHECK (has (h, "Measured with SPLMeter v9.9.9")); +} + +TEST_CASE ("Vibration report: building profiles show their values", "[vibration][report]") +{ + juce::ScopedJuceInitialiser_GUI juceInit; + + auto in = baseInput (vib::Profile::BuildingStructural); + auto h = VibrationReport::generateHtml (in); + CHECK (has (h, "PPV and dominant frequency (DIN 4150-3)")); + CHECK (has (h, "DIN 4150-3, short-term vibration")); + CHECK (has (h, "Line 2")); + // X: 6 mm/s at 25 Hz, value 5 + 10 · 15/40 = 8.75 mm/s + CHECK (has (h, "6.00 mm/s at 25.0 Hz · value 8.75 mm/s")); + CHECK (has (h, "class=\"verdict bad\"")); // Z: 18 mm/s > 8.75 + + in = baseInput (vib::Profile::BuildingPerception); + in.limits.din2ExposureHours = 4.0; + h = VibrationReport::generateHtml (in); + CHECK (has (h, "KBFmax")); + CHECK (has (h, "Residential (WR, WA)")); + CHECK (has (h, "T_e = 4.00 h")); + // KB_FTr = 0.05 · √(4/16) = 0.025 + CHECK (has (h, "0.0250")); + CHECK (has (h, "KB_Fmax > A_u") == false); + CHECK (has (h, "class=\"verdict ok\"")); // KB_Fmax 0.2 > A_u 0.15, KB_FTr 0.025 ≤ A_r 0.07 +} + +TEST_CASE ("Vibration report: human exposure, no assessment, no mic", "[vibration][report]") +{ + juce::ScopedJuceInitialiser_GUI juceInit; + + auto in = baseInput (vib::Profile::HandArm); + in.snap.axis[vib::AxisSum].awRms = 3.0f; + in.exposureHours = 8.0; + in.hasMic = false; + auto h = VibrationReport::generateHtml (in); + CHECK (has (h, "Directive 2002/44/EC, ISO 5349-1")); + CHECK (has (h, "Action value 2.5 m/s² exceeded")); + CHECK (has (h, "class=\"verdict warn\"")); + CHECK (has (h, "VDV")); + CHECK_FALSE (has (h, "Sound level (microphone)")); + + in = baseInput (vib::Profile::StructureBorne); + h = VibrationReport::generateHtml (in); + CHECK (has (h, "No assessment for this profile.")); + + in.events.clear(); + in.log.clear(); + h = VibrationReport::generateHtml (in); + CHECK (has (h, "No markers or pauses.")); + CHECK_FALSE (has (h, "Time history covers")); +} + +TEST_CASE ("Vibration report: suggested file name", "[vibration][report]") +{ + juce::ScopedJuceInitialiser_GUI juceInit; + auto in = baseInput (vib::Profile::HandArm); + CHECK (VibrationReport::suggestedFileName (in) == "SPLMeter_Vibration_Pump_A__B_2026-11-13_14-30.html"); + in.meta.project = {}; + CHECK (VibrationReport::suggestedFileName (in) == "SPLMeter_Vibration_2026-11-13_14-30.html"); +} diff --git a/docs/VIBRATION_SPEC.md b/docs/VIBRATION_SPEC.md index 8c5a3b5..40bcd14 100644 --- a/docs/VIBRATION_SPEC.md +++ b/docs/VIBRATION_SPEC.md @@ -263,6 +263,16 @@ File playback reads that metadata: Mic tracks feed the SPL mix (all tracks for f 7. **Mic summary** (if a mic is configured): LAeq, LCeq, LAFmax for the same period. 8. **Disclaimer** (§9.4). +**Implementation (step 12).** +- `Source/VibrationReport.h`: `VibrationReport::generateHtml (Input)` is pure (no files, no processor) and unit-tested (`Tests/VibrationReportTests.cpp`); all visible text lives in `VibrationReport::Text` (English). User text is HTML-escaped; the file has no scripts, links, images or external styles. Print CSS keeps charts and tables on one page. +- Menu: Ex-/Import → **Save Vibration Report…**, enabled when the vibration snapshot is valid and has metered time. A dialog asks for project, location, operator, sensor mounting and notes (persisted in `UIState/Report`), then a file chooser (default name `SPLMeter_Vibration__.html`). +- Interface: the standalone app writes the audio device name and type (`StandalonePluginHolder`); plugins write the host. File playback lists the recorded tracks with their calibration. +- Results: per axis and Σ: RMS over the measurement, running RMS at the end, peak since reset (PPV), crest factor; MTVV and VDV for acceleration; f_dom for velocity; KB_Fmax / KB_FTm / KB_FTr with the KB weighting; plus the main value. +- Assessment: standard, parameters, the values compared and the reference values used, verdict with coloured dot (same evaluator as the panel). +- Charts (inline SVG): time history of the running RMS per axis and Σ from the log (markers red, pauses grey); 1/3-octave spectrum per axis in dB (bands outside the usable range or below the high-pass shaded); for DIN 4150-3, PPV over f_dom on log-log axes with the three Table 1 foundation lines and the values used. +- Time history and the mic summary (LAeq, LCeq, LA(F|S)max) cover the log period (`logDuration`); the accumulated values cover the time since the last reset. The report states both. +- 1/3-octave spectrum: `Source/Vibration/ThirdOctave.h`, base-10 bands 1 Hz … 1250 Hz (up to fs_d / 8), 6th-order Butterworth band-pass per band (edges prewarped), multirate (6th-order Butterworth low-pass at 0.15·rate, ÷2 per octave, each band at 8–16× its centre). It runs on the weighted signal of each axis, accumulates like the other detectors (after settling, while metering, reset with the session) and is published in the snapshot (`numBands`, `bandRms`). Engine overhead rose from 0.43 % to 0.62 % of one core (triaxial, 48 kHz). + ### 9.3 Assessment reference values All limit values ship as **editable defaults** in Settings; the report lists the values actually used. Status markers refer to the sources in §14. @@ -373,9 +383,9 @@ Manual verification: handheld calibrator per axis; compare a short machinery and | 9 Profiles | done | 2141ed9 | | 10 Accumulating detectors, engine settling | done | 9a84337 | | Fix: distinct axis colours, short weighting labels, .gitignore | done | b1ed461 | -| 11 Assessment + status dot, verified ⚠ values | done | | -| 12 HTML report | **next** | | -| 13 Docs, v3.6.0 bump, PR to main | open | | +| 11 Assessment + status dot, verified ⚠ values | done | 02353a1 | +| 12 HTML report, 1/3-octave spectrum | done | | +| 13 Docs, v3.6.0 bump, PR to main | **next** | | **Step 11 plan.** `Source/Vibration/Assessment.h` (no JUCE, unit-tested): status None / Ok / Warning / Exceeded with a short text, one evaluator per profile following §9.3 — health (A(8) and VDV against EU action/limit values, Germany preset), hand-arm (A(8)), comfort (informational band), machinery (zones A–D by group and foundation), DIN 4150-2 (zone, day/night, KB_Fmax/A_u/A_o then KB_FTr/A_r), DIN 4150-3 (line, foundation with frequency interpolation via f_dom or top floor, short-/long-term). Limits as editable defaults in `UIState/AccelLimits` (included in JSON export/import), edited in an "Assessment" group of the Inputs and Sensors window. The Vibration panel header gets the status dot and text. Tests cover each evaluator at its boundaries, the DIN 4150-3 interpolation and the DIN 4150-2 decision flow. The ⚠ items of §13 are resolved before release. From 04289dc3441ab294219906e06bdc5da71a779cab Mon Sep 17 00:00:00 2001 From: Philipp Paul Klose Date: Fri, 13 Nov 2026 11:42:48 +0100 Subject: [PATCH 22/30] Vibration step 13: user guide, README, version 3.6.0 - docs/VIBRATION_GUIDE.md: setup, calibration, profiles, assessment, measuring, export and report - README: vibration feature section, export menu, standards, v3.6.0 changelog - version 3.6.0 in CMakeLists.txt, SPLMeter.jucer, JucePluginDefines.h and the Xcode Info plists (were 2.5.0 / 2.6.1; AU component version 0x30600) - version label reads JucePlugin_VersionString Co-Authored-By: Claude Opus 5.5 --- Builds/MacOSX/Info-AU.plist | 6 +- Builds/MacOSX/Info-Standalone_Plugin.plist | 4 +- Builds/MacOSX/Info-VST3.plist | 4 +- Builds/MacOSX/Info-VST3_Manifest_Helper.plist | 4 +- CMakeLists.txt | 4 +- JuceLibraryCode/JucePluginDefines.h | 8 +- README.md | 45 ++++++- SPLMeter.jucer | 2 +- Source/PluginEditor.cpp | 2 +- docs/VIBRATION_GUIDE.md | 122 ++++++++++++++++++ docs/VIBRATION_SPEC.md | 8 +- 11 files changed, 182 insertions(+), 27 deletions(-) create mode 100644 docs/VIBRATION_GUIDE.md diff --git a/Builds/MacOSX/Info-AU.plist b/Builds/MacOSX/Info-AU.plist index cc5b965..8013ee2 100644 --- a/Builds/MacOSX/Info-AU.plist +++ b/Builds/MacOSX/Info-AU.plist @@ -18,9 +18,9 @@ CFBundleSignature ???? CFBundleShortVersionString - 2.5.0 + 3.6.0 CFBundleVersion - 2.5.0 + 3.6.0 NSHumanReadableCopyright 2025 Philipp Paul Klose Audio Engineering NSHighResolutionCapable @@ -41,7 +41,7 @@ subtype Splm version - 132352 + 198144 resourceUsage network.client diff --git a/Builds/MacOSX/Info-Standalone_Plugin.plist b/Builds/MacOSX/Info-Standalone_Plugin.plist index f616cf5..980125e 100644 --- a/Builds/MacOSX/Info-Standalone_Plugin.plist +++ b/Builds/MacOSX/Info-Standalone_Plugin.plist @@ -18,9 +18,9 @@ CFBundleSignature ???? CFBundleShortVersionString - 2.5.0 + 3.6.0 CFBundleVersion - 2.5.0 + 3.6.0 NSHumanReadableCopyright 2025 Philipp Paul Klose Audio Engineering NSHighResolutionCapable diff --git a/Builds/MacOSX/Info-VST3.plist b/Builds/MacOSX/Info-VST3.plist index 0c439ba..8cd60e3 100644 --- a/Builds/MacOSX/Info-VST3.plist +++ b/Builds/MacOSX/Info-VST3.plist @@ -18,9 +18,9 @@ CFBundleSignature ???? CFBundleShortVersionString - 2.6.1 + 3.6.0 CFBundleVersion - 2.6.1 + 3.6.0 NSHumanReadableCopyright 2025 Philipp Paul Klose Audio Engineering NSHighResolutionCapable diff --git a/Builds/MacOSX/Info-VST3_Manifest_Helper.plist b/Builds/MacOSX/Info-VST3_Manifest_Helper.plist index 1cf0f39..09a3a6c 100644 --- a/Builds/MacOSX/Info-VST3_Manifest_Helper.plist +++ b/Builds/MacOSX/Info-VST3_Manifest_Helper.plist @@ -18,9 +18,9 @@ CFBundleSignature CFBundleShortVersionString - 2.6.1 + 3.6.0 CFBundleVersion - 2.6.1 + 3.6.0 NSHumanReadableCopyright 2025 Philipp Paul Klose Audio Engineering NSHighResolutionCapable diff --git a/CMakeLists.txt b/CMakeLists.txt index f2cb683..3a080e1 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,5 +1,5 @@ cmake_minimum_required(VERSION 3.22) -project(SPLMeter VERSION 3.5.2) +project(SPLMeter VERSION 3.6.0) set(CMAKE_CXX_STANDARD 17) @@ -98,7 +98,7 @@ if(UNIX AND NOT APPLE) endif() juce_add_plugin(SPLMeter - VERSION 3.5.2 + VERSION 3.6.0 PLUGIN_MANUFACTURER_CODE Manu PLUGIN_CODE Splm FORMATS ${SPLMETER_FORMATS} diff --git a/JuceLibraryCode/JucePluginDefines.h b/JuceLibraryCode/JucePluginDefines.h index 4b1ec99..8199b4e 100644 --- a/JuceLibraryCode/JucePluginDefines.h +++ b/JuceLibraryCode/JucePluginDefines.h @@ -77,13 +77,13 @@ #define JucePlugin_EditorRequiresKeyboardFocus 1 #endif #ifndef JucePlugin_Version - #define JucePlugin_Version 3.5.2 + #define JucePlugin_Version 3.6.0 #endif #ifndef JucePlugin_VersionCode - #define JucePlugin_VersionCode 0x30502 + #define JucePlugin_VersionCode 0x30600 #endif #ifndef JucePlugin_VersionString - #define JucePlugin_VersionString "3.5.2" + #define JucePlugin_VersionString "3.6.0" #endif #ifndef JucePlugin_VSTUniqueID #define JucePlugin_VSTUniqueID JucePlugin_PluginCode @@ -155,7 +155,7 @@ #define JucePlugin_ARAFactoryID "com.PhilippPaulKloseAudioEngineering.SPLMeter.factory" #endif #ifndef JucePlugin_ARADocumentArchiveID - #define JucePlugin_ARADocumentArchiveID "com.PhilippPaulKloseAudioEngineering.SPLMeter.aradocumentarchive.3.5.2" + #define JucePlugin_ARADocumentArchiveID "com.PhilippPaulKloseAudioEngineering.SPLMeter.aradocumentarchive.3.6.0" #endif #ifndef JucePlugin_ARACompatibleArchiveIDs #define JucePlugin_ARACompatibleArchiveIDs "" diff --git a/README.md b/README.md index ae1d524..a7ae303 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # SPLMeter -A professional Sound Pressure Level (SPL) meter built with JUCE, available as a macOS/Windows/Linux standalone app and as VST3 / AU plugin. +A professional Sound Pressure Level (SPL) meter built with JUCE, available as a macOS/Windows/Linux standalone app and as VST3 / AU plugin. Since v3.6 it also measures **vibration** with an IEPE accelerometer, alongside the microphone. ![SPLMeter v3.5 screenshot](screenShot.png) @@ -61,17 +61,30 @@ Continuous real-time estimation of: | Specific Loudness | Perceived loudness approximation (sone) | | Psychoacoustic Annoyance | Combined annoyance index (Zwicker & Fastl 1999): N × (1 + √(w_S² + w_FR²)) | +### Vibration Measurement (Accelerometer) +Full guide: [docs/VIBRATION_GUIDE.md](docs/VIBRATION_GUIDE.md) +- **One IEPE accelerometer** (triaxial or uniaxial) **plus the microphone** at the same time — each input gets a role (Mic, Accel X/Y/Z, Accel uniaxial, Off) in **Settings → Inputs and Sensors…**; only Mic inputs feed the SPL meter +- **Calibration per axis** with a handheld calibrator (10 m/s² / 1 g at 159.2 Hz, or custom) or from the datasheet sensitivity and the interface's full scale +- **Signal chain** in double precision: high-pass, integration to velocity or displacement, ISO 8041 frequency weightings (Wb, Wc, Wd, We, Wf, Wh, Wj, Wk, Wm), DIN 4150-2 KB weighting, or a band limit +- **Detectors**: running RMS, peak, peak-to-peak, a_w,rms, MTVV, VDV, crest factor, PPV with dominant frequency, KB_Fmax / KB_FTr, vector sum with k-factors, A(8), 1/3-octave spectrum (1 Hz – 1250 Hz) +- **Measurement profiles**: structure-borne, machinery (ISO 20816), whole-body health and comfort (ISO 2631-1), hand-arm (ISO 5349-1), building perception (DIN 4150-2), building structural (DIN 4150-3) +- **Assessment** against editable reference values: EU 2002/44/EC and German LärmVibrationsArbSchV action/limit values, ISO 10816-3 / 20816-3 zones A–D, DIN 4150-2 A_u / A_o / A_r, DIN 4150-3 guideline values; shown as a status dot in the panel +- **Vibration panel** below the SPL meter, **timeline traces** (Vib X · Y · Z · Σ), vibration **CSV columns**, **multichannel WAV** with roles and calibration, and an **HTML vibration report** +- Indicative measurements: SPLMeter is not a type-tested ISO 8041-1 / DIN 45669-1 instrument + ### Input Modes -- **Real Time** — live microphone / audio interface input, up to **32 channels** +- **Real Time** — live microphone / audio interface input, up to **32 channels**; each input can be a microphone or an accelerometer axis - **File** — load and analyse an audio file (WAV, AIFF, FLAC, MP3, OGG) - **Monitor button** — speaker icon; output is muted by default, click to enable pass-through ### Export -Accessible via the **Save…** button (popup menu): -- **Save CSV** — exports the full measurement log (timestamps, all SPL values, all psychoacoustic metrics) as a CSV file -- **Save WAV** — saves the last *Keep Last* seconds of Input 01 and 02 as a stereo 24-bit WAV file +Accessible via the **Ex-/Import…** button (popup menu): +- **Save CSV** — exports the full measurement log (timestamps, all SPL values, all psychoacoustic metrics; with an accelerometer also the vibration values) as a CSV file +- **Save WAV** — saves the last *Keep Last* seconds of Input 01 and 02 as a stereo 24-bit WAV file; with an accelerometer, every non-Off input (up to 8 tracks) with roles and calibration in the file - **Save Screenshot** — exports the current view as a JPEG image - **Save All** — saves CSV, WAV, and screenshot in one step into a chosen folder +- **Save Vibration Report** — one self-contained HTML file (setup, results, assessment, charts, events, disclaimer), printable to PDF +- **Save / Load Settings** — JSON file with all settings, including input roles, accelerometer calibration and assessment values ### Analysis Tools Accessible via the **Tools…** button (popup menu): @@ -94,7 +107,7 @@ Opened via the **Settings** button. A wide, two-column, card-based window with a | **FFT** | FFT enable toggle, FFT Gain fader, FFT Smooth fader, FFT Size (32 – 524,288 samples), Band Resolution, Display Mode, Window Function, Overlap, Peak Hold, RTA +3 dB/oct | | **Spectrogram** | FFT Size (32 – 524,288 samples) for the Spectrogram window | | **Analysis** | Correction Filter (enable / load / clear), Graph Overlay (enable / load / clear) | -| **Input Channels** | Per-channel mute buttons for IN01 – IN32 | +| **Input Channels** | Per-channel mute buttons for IN01 – IN32 (with the role tag), **Inputs and Sensors…** window for roles, accelerometer calibration, profile and assessment | ### MIDI Learn Right-click any of the three faders to assign or clear a MIDI CC mapping: @@ -315,11 +328,31 @@ GitHub Actions workflows build the standalone for macOS and Windows on every pus | **IEC 61672-1:2013** | Electroacoustics — Sound level meters. Defines FAST (125 ms) and SLOW (1 s) time weighting and A/C frequency weighting curves. | | **ISO 266:1997** | Preferred frequencies — defines the 31 standard 1/3-octave band centre frequencies (20 Hz – 20 kHz). | | **Zwicker & Fastl, *Psychoacoustics: Facts and Models* (3rd ed., Springer, 2007)** | Theoretical basis for the Roughness, Sharpness, Fluctuation Strength, Specific Loudness, and Psychoacoustic Annoyance estimators. | +| **ISO 8041-1, ISO 2631-1/-2/-4, ISO 5349-1** | Human vibration frequency weightings and evaluation (a_w, MTVV, VDV, A(8), comfort scale). | +| **Directive 2002/44/EC, LärmVibrationsArbSchV** | Whole-body and hand-arm exposure action and limit values (EU, Germany). | +| **ISO 10816-3 / ISO 20816-3** | Machinery vibration severity zones A–D. | +| **DIN 4150-2, DIN 4150-3** | Building vibration: effects on people (KB weighting, A_u / A_o / A_r) and on structures (PPV guideline values). | +| **IEC 61260-1** | 1/3-octave band centre frequencies (base 10) of the vibration spectrum. | + +Sources and verification status of all vibration parameters: [docs/VIBRATION_SPEC.md](docs/VIBRATION_SPEC.md) §14. --- ## Changelog +### [v3.6.0](https://github.com/ppklose/ppkSPLMeter/releases/tag/v3.6.0) +- **Vibration measurement with an IEPE accelerometer** alongside the microphone — see [docs/VIBRATION_GUIDE.md](docs/VIBRATION_GUIDE.md) +- **Inputs and Sensors window** (Settings → Input Channels): a role per input (Mic, Accel X/Y/Z, Accel uniaxial, Off), live level meters, per-axis calibration (handheld calibrator or datasheet) with date and method +- **Accelerometer signal chain**: high-pass, integration to velocity / displacement, ISO 8041 weightings (Wb, Wc, Wd, We, Wf, Wh, Wj, Wk, Wm), DIN 4150-2 KB weighting, band limit; detectors for RMS, peak, a_w,rms, MTVV, VDV, crest factor, PPV with dominant frequency, KB_Fmax / KB_FTr, vector sum, A(8), 1/3-octave spectrum +- **Measurement profiles** for structure-borne sound, machinery, whole-body health and comfort, hand-arm, building perception and building structural +- **Assessment** with editable reference values (EU / Germany, ISO 20816-3, DIN 4150-2, DIN 4150-3) and a status dot in the new **Vibration panel** below the SPL meter +- **Timeline** vibration traces, **CSV** vibration columns, **JSON settings** with roles, calibration and limits +- **Multichannel WAV recording** with roles and calibration in the file; file playback uses them +- **HTML vibration report** (Ex-/Import → Save Vibration Report…) +- **FFT source** selector (mix, Dual 1+2, or a single input) replaces the Dual FFT toggle; v3.5.2 settings load unchanged +- The standalone app now accepts devices that open more than 8 inputs (up to 32); before, they fell back to a single input +- Default behaviour without accelerometer roles is unchanged (bit-identical SPL results, verified by regression tests) + ### [v3.5.2](https://github.com/ppklose/ppkSPLMeter/releases/tag/v3.5.2) - **All user settings now persist across launches** — previously some changes were silently reverted on quit, because the app's preferences shared a file with JUCE's standalone wrapper, which rewrote it from a stale copy. Preferences now live in their own `SPLMeter.prefs` (migrated automatically) and are saved every few seconds, so they also survive a crash or force-quit. Newly remembered: window size, timeline series checkboxes and psychoacoustic metric, FFT overlay toggle, Spectrogram view settings, Long-term SPL toggles and Y range, Sound Detective threshold and TFLite model, Impulse Fidelity frequency, loaded correction filter and graph overlays, MIDI CC assignments and channel names - **Dual FFT** (Settings → FFT): the timeline FFT overlay can show separate spectra for input 1 (green) and input 2 (red), overlaid with a legend. Both use identical analysis settings; the crosshair reads out both levels diff --git a/SPLMeter.jucer b/SPLMeter.jucer index 0bda04d..b84e671 100644 --- a/SPLMeter.jucer +++ b/SPLMeter.jucer @@ -1,6 +1,6 @@ - SPLMeter is not a type-tested vibration meter (ISO 8041-1 / DIN 45669-1). Results are indicative. For legal or contractual assessments, use a certified instrument. + +--- + +## 1. What you need + +- An **IEPE accelerometer** (triaxial or uniaxial). +- An audio interface with **IEPE (ICP) supply** and **DC-coupled** or very low-frequency inputs. A normal mic preamp's AC coupling (often 10–20 Hz) cuts off the low frequencies that building and human-exposure measurements need. +- The sensor's datasheet: sensitivity (mV/(m/s²) or mV/g) and usable frequency range — or a handheld calibrator (e.g. 10 m/s² at 159.2 Hz). + +--- + +## 2. Assign the inputs + +**Settings → INPUT CHANNELS → Inputs and Sensors…** opens a resizable window with every active input. + +1. Set the **Role** of each input: *Mic*, *Accel X*, *Accel Y*, *Accel Z*, *Accel (uniaxial)* or *Off*. + - Only *Mic* inputs feed the SPL meter, its bandpass and the correction filter. + - Use either X/Y/Z (one, two or three axes) **or** one uniaxial input. An axis assigned twice, or uniaxial mixed with X/Y/Z, is shown in red and the accelerometer stays inactive. +2. The status line shows the detected sensor, e.g. *"Triaxial accelerometer: X = IN 2, Y = IN 3, Z = IN 4"*. +3. The channel buttons in Settings show the role as a small tag (X / Y / Z / ACC / OFF). + +The standalone app opens up to 32 inputs. Plugins (VST3/AU) see the channels the host gives the track (1–8); use a multichannel track for an accelerometer. + +--- + +## 3. Calibrate each axis + +Click **Calibrate…** in an accelerometer row. The value is the level in **dB re 1 µm/s²** that a full-scale (0 dBFS) sine would read. + +- **Handheld calibrator** (preferred): mount the sensor on the calibrator, choose the reference (10 m/s² RMS at 159.2 Hz = 140 dB, 1 g, or a custom level/frequency) and click **Measure**. SPLMeter settles for 0.5 s, measures for 3 s and checks frequency (±5 %) and stability (±0.2 dB). Click **Apply**. +- **Datasheet**: enter the sensitivity (mV/(m/s²) or mV/g) and the interface's full scale (Vrms or dBu at 0 dBFS). The result updates live; click **Apply**. +- You can also type the value directly into the *Cal* column. + +Each axis keeps its own value plus the date and method, which go into the report. + +--- + +## 4. Choose a profile + +The **ACCELEROMETER** card below the input table sets everything that applies to all axes. A **Profile** fills in sensible defaults; every value stays editable, and after a change the profile reads *"Custom (based on …)"*. + +| Profile | Quantity | Weighting | Main value | Assessment | +|---|---|---|---|---| +| Structure-borne | acceleration | none | L_a in dB re 1 µm/s² | — | +| Machinery (ISO 20816) | velocity | 10–1000 Hz | v_rms (largest axis) | zones A–D | +| Machinery, low speed | velocity | 2–1000 Hz | v_rms | zones A–D | +| Whole-body health (ISO 2631-1) | acceleration | Wd / Wd / Wk, k = 1.4 / 1.4 / 1 | a_w (largest k·axis) | EU / Germany action and limit values | +| Whole-body comfort (ISO 2631-1) | acceleration | Wd / Wd / Wk | a_v (vector sum) | comfort scale (informative) | +| Hand-arm (ISO 5349-1) | acceleration | Wh | a_hv (vector sum) | EU action and limit values | +| Building, perception (DIN 4150-2) | velocity | KB | KB_Fmax | A_u / A_o / A_r | +| Building, structural (DIN 4150-3) | velocity | 1–315 Hz | PPV with dominant frequency | guideline values | + +Other settings in the card: quantity, high-pass, RMS time constant, weighting and k-factor per axis, band limits, **main value**, sensor serial, the sensor's **usable range** (from the datasheet) and the **daily exposure time T** for A(8). + +--- + +## 5. Set up the assessment + +The **ASSESSMENT** card shows the controls the current profile needs. Selecting a standard, group, zone or line fills in its reference values; you can edit each value, and **Defaults** reloads the standard's values. + +| Profile | Choices | Values | +|---|---|---| +| Whole-body health | EU 2002/44/EC or Germany (LärmVibrationsArbSchV); criterion A(8) or VDV | action 0.5 m/s²; limit 1.15 m/s² (Germany: Z 0.8 m/s²); VDV 9.1 / 21 m/s^1.75 | +| Hand-arm | — | action 2.5 m/s², limit 5 m/s² A(8) | +| Comfort | — | informative scale, no pass/fail | +| Machinery | machine group 1/2, rigid/flexible foundation | zone boundaries A/B, B/C, C/D | +| Building, perception | zone (industrial … hospitals), day/night | A_u, A_o, A_r, exposure time T_e | +| Building, structural | line 1/2/3, short-/long-term, foundation / top floor / floor slab | values at 1–10, 50, 100 Hz or one value | + +How the result is found: + +- **Whole-body health**: A(8) = k·a_w · √(T / 8 h) of each axis against the action value (amber) and the limit value of that axis (red). With *VDV*: the largest k·VDV, scaled to the daily exposure. +- **Hand-arm**: A(8) of a_hv. +- **Machinery**: the largest axis velocity RMS over the measurement → zone A/B (green), C (amber), D (red). +- **DIN 4150-2**: KB_Fmax ≤ A_u → met; KB_Fmax > A_o → not met; otherwise KB_FTr ≤ A_r → met, where KB_FTr = KB_FTm · √(T_e / T_r) (T_r = 16 h by day, 8 h at night). +- **DIN 4150-3**: the peak velocity (PPV) of each axis against the value at its dominant frequency (foundation, interpolated between 10, 50 and 100 Hz), or one value for the top floor (X/Y) or a floor slab (Z). + +Rail-specific rules of DIN 4150-2:2025 and the construction-site table are not built in — enter the values yourself in those cases. + +--- + +## 6. Measure + +The **Vibration panel** below the SPL meter shows one row per axis plus the vector sum Σ: a log-scale bar with the running RMS, the interval peak and the maximum since reset, the readout and the unit selector (linear, g, or dB re ISO 1683). + +- The header shows the profile, quantity, weightings and time constant, and the main value on the right. +- The results line underneath shows the measured time and the profile's secondary values (A(8), VDV, MTVV, crest factor; KB_FTr; or PPV axis and f_dom), and on the right a **status dot** with the assessment: green ok, amber warning, red exceeded, blue informative. +- After a start or a settings change, the filters settle for a moment (0.8 s ÷ high-pass, 0.5–10 s); the readout shows "--" meanwhile. +- **Reset** restarts all accumulated values (a_w, MTVV, VDV, PPV, KB values, the spectrum) together with the session peaks. **Pause** and DAW sync hold them, like the SPL log. + +In Advanced mode the **timeline** gets *Vib X · Y · Z · Σ* toggles; vibration traces use the right axis. + +--- + +## 7. Record and export + +- **Save WAV** with an accelerometer records every non-Off input (up to 8 tracks, 24-bit) and stores each track's role and calibration in the file. Playing the file back (File mode) uses that information, so the Vibration panel, timeline and CSV work during playback. +- **Save CSV** adds the columns `vibX_rms … vibSum_pk, vib_main, vib_unit, vib_profile` in the display unit. +- **Save Settings / Load Settings** include the input roles, calibration, accelerometer settings and assessment values. +- **Save Vibration Report…** (Ex-/Import menu) writes one HTML file that opens in any browser and prints to PDF. A dialog asks for project, location, operator, sensor mounting and notes (remembered for the next report). The report contains: + - measurement and setup (interface, sensor, roles, calibration, profile, filters, k-factors), + - a results table per axis and Σ, + - the assessment with the reference values used, + - the time history, the 1/3-octave spectrum per axis (1 Hz – 1250 Hz, averaged over the measurement), and for DIN 4150-3 a PPV over frequency chart with the guideline lines, + - markers and pauses, the microphone's LAeq / LCeq / LAFmax, + - the disclaimer. + + The time history and sound levels cover the log period (log duration); the accumulated results cover the time since the last reset. The report states both. + +--- + +## 8. Tips + +- Mount the sensor rigidly (stud or glue); a magnet or a handheld probe lowers the usable upper frequency. +- Set the sensor's **usable range** from the datasheet; the report shades the spectrum outside it. +- For building and whole-body measurements the interface must pass low frequencies: check that a slow movement of the sensor shows up in the 1–2 Hz bands. +- Whole-body and hand-arm exposure use the daily exposure time **T** from the accelerometer card; building perception uses **T_e** from the assessment card. diff --git a/docs/VIBRATION_SPEC.md b/docs/VIBRATION_SPEC.md index 40bcd14..00cff0e 100644 --- a/docs/VIBRATION_SPEC.md +++ b/docs/VIBRATION_SPEC.md @@ -1,6 +1,6 @@ # SPLMeter — Vibration Measurement (Accelerometer) Specification -Status: **Draft v0.2** · 2026-11-12 · target: **v3.6.0** +Status: **Implemented** (v0.3) · 2026-11-13 · release: **v3.6.0** · user guide: [VIBRATION_GUIDE.md](VIBRATION_GUIDE.md) (v0.2: open points resolved, weighting parameters and limit values cross-checked against public sources — see §14) ## 1. Goals @@ -366,7 +366,7 @@ Manual verification: handheld calibrator per axis; compare a short machinery and 12. HTML report (§9) with inline SVG charts. 13. README + user documentation; version bump to **v3.6.0** (CMakeLists.txt, SPLMeter.jucer, JucePluginDefines.h, PluginEditor version label). -### Status (2026-11-12) +### Status (2026-11-13) | Step | State | Commit | |---|---|---| @@ -384,8 +384,8 @@ Manual verification: handheld calibrator per axis; compare a short machinery and | 10 Accumulating detectors, engine settling | done | 9a84337 | | Fix: distinct axis colours, short weighting labels, .gitignore | done | b1ed461 | | 11 Assessment + status dot, verified ⚠ values | done | 02353a1 | -| 12 HTML report, 1/3-octave spectrum | done | | -| 13 Docs, v3.6.0 bump, PR to main | **next** | | +| 12 HTML report, 1/3-octave spectrum | done | 10602fc | +| 13 User guide, README, v3.6.0 bump, PR to main | done | | **Step 11 plan.** `Source/Vibration/Assessment.h` (no JUCE, unit-tested): status None / Ok / Warning / Exceeded with a short text, one evaluator per profile following §9.3 — health (A(8) and VDV against EU action/limit values, Germany preset), hand-arm (A(8)), comfort (informational band), machinery (zones A–D by group and foundation), DIN 4150-2 (zone, day/night, KB_Fmax/A_u/A_o then KB_FTr/A_r), DIN 4150-3 (line, foundation with frequency interpolation via f_dom or top floor, short-/long-term). Limits as editable defaults in `UIState/AccelLimits` (included in JSON export/import), edited in an "Assessment" group of the Inputs and Sensors window. The Vibration panel header gets the status dot and text. Tests cover each evaluator at its boundaries, the DIN 4150-3 interpolation and the DIN 4150-2 decision flow. The ⚠ items of §13 are resolved before release. From ff2b80e375e7b5b2cfd755382db2e02403491cad Mon Sep 17 00:00:00 2001 From: Philipp Paul Klose Date: Fri, 13 Nov 2026 15:45:34 +0100 Subject: [PATCH 23/30] docs: REW measurement sequencer spec Co-Authored-By: Claude Opus 5.5 --- docs/REW_SEQUENCER_SPEC.md | 230 +++++++++++++++++++++++++++++++++++++ 1 file changed, 230 insertions(+) create mode 100644 docs/REW_SEQUENCER_SPEC.md diff --git a/docs/REW_SEQUENCER_SPEC.md b/docs/REW_SEQUENCER_SPEC.md new file mode 100644 index 0000000..479d69f --- /dev/null +++ b/docs/REW_SEQUENCER_SPEC.md @@ -0,0 +1,230 @@ +# SPLMeter — REW Measurement Sequencer Specification + +Status: **Planned** (v0.2, decisions made — §9) · 2026-11-13 · target release: **v3.6.0** · branch `feature/vibration` + +## 1. Goals + +Run a list of Room EQ Wizard sweep measurements one after the other, each step with its own settings, from SPLMeter. REW does the measuring; SPLMeter configures REW through its REST API, triggers each sweep, waits for the result and moves on. + +| Decision | Value | +|---|---| +| Name | **REW Measurement Sequencer** | +| Access | **Tools → REW Measurement Sequencer…** opens a separate window, like the other tools | +| Transport | REW REST API, `http://127.0.0.1:4735` (port editable) | +| Targets | Standalone, VST3, AU on macOS / Windows / Linux; **not iOS** (REW only listens on the local machine) | +| Results | REW keeps the measurements; SPLMeter adds its own **acoustic and vibration values per step** (REW cannot measure vibration) and saves them with the run | +| Typical uses | multi-position room measurements (mic moves between steps), L / R / sub / L+R per output channel, level series, sweep-length or bandwidth comparisons, repeated runs for repeatability | + +### Non-goals (v1) + +- Starting or installing REW. The user starts REW with the API enabled (Preferences → API, or `-api`). +- Analysis, EQ or averaging of REW data inside SPLMeter. REW's results stay in REW; SPLMeter reads back only the title and UUID. +- RTA, stepped-sine, impedance and SPL-logger sequences. The data model allows other commands later, but v1 only uses `SPL` sweeps. +- REW on another computer. The API refuses non-local connections. + +## 2. REW API facts (verified against REW 5.40 beta 147, API 0.9.9, `/doc.json`) + +| Purpose | Endpoint | Notes | +|---|---|---| +| Alive / version | `GET /version` → `{"message":"5.40 Beta 147 API 0.9.9"}` | used for the connection status | +| Audio ready | `GET /audio/status` → `{enabled, ready}` | | +| Driver | `GET /audio/driver` → `Java` or `ASIO` | controls which channel endpoints are used | +| Output channel | Java: `POST /audio/java/output-channel {"channel":"L"}`, choices from `GET /audio/java/output-channels` (`L`, `R`, `L+R`, `3`…); ASIO: `/audio/asio/output`, `/audio/asio/outputs` | | +| Input channel | Java: `/audio/java/input-channel {"channel":1}`, `/audio/java/last-input-channel` (multi-input, Pro); ASIO: `/audio/asio/input`, `/audio/asio/last-input` | set *last* before *first*, otherwise REW clamps the range (VirtualEareality lesson) | +| Level | `POST /measure/level {"value":-12,"unit":"dBFS"}`; units `dBu`, `dBV`, `V`, `dBFS` | | +| Sweep | `POST /measure/sweep/configuration {startFrequency, endFrequency, length, fillSilenceWithDither}`; lengths `64k`…`4M` | | +| Repetitions | `POST /measure/sweep/repetitions` (sweeps averaged into one measurement) | | +| Timing reference | `POST /measure/timing/reference "Acoustic"`; choices `None`, `Loopback`, `Loopback cal`, `Acoustic`, `Wired` | | +| Name / notes | `POST /measure/naming {title, namingOption:"Use as entered"}`, `POST /measure/notes "…"` | apply to the *next* measurement | +| Protection | `/measure/protection-options` (abort on clipping / SPL limit) | | +| Trigger | `POST /measure/command {"command":"SPL"}` → 202 Accepted; `{"command":"Cancel"}` aborts | **automated sweeps need a REW Pro licence** | +| Blocking | `GET/POST /application/blocking` | must be **false**: blocking calls time out after 10 s, and the setting persists in REW | +| Results | `GET /measurements` → object keyed by index (`{"1":{…,"uuid":…}}`), `GET /measurements/{id}` | | +| Groups | `GET/POST /groups`, `POST /groups/{uuid}/measurements {"uuid":…}` | | +| Errors / warnings | `GET /application/errors`, `/application/warnings` (`{time,title,message}`) | | +| Save | `POST /measurements/command {"command":"Save all","parameters":["/path/file.mdat","note"]}` | overwrites existing files | +| Busy | a POST while a command is running → **400 Bad Request** | | + +Push notifications (`/measure/subscribe`, `/measurements/subscribe`) need an HTTP server on SPLMeter's side, and REW drops the subscription after one failed delivery. v1 **polls** instead. See §5.3. + +## 3. Data model + +``` +RewStep + enabled bool + name string → REW measurement title ("" = sequence name + step number) + notes string + output string e.g. "L", "R", "L+R", "3" (driver-specific choice list) + inputFirst/Last int last > first only with REW Pro multi-input + level double + unit dBFS | dBu | dBV | V + sweepStart/End int Hz + sweepLength string "64k" … "4M" + repetitions int 1–16 (averaged by REW) + timingRef string None | Loopback | Loopback cal | Acoustic | Wired + group string REW group name ("" = none; created if missing) + protection clippingAbort bool, splLimitAbort bool, dBSPLLimit dB (/measure/protection-options) + waitForUser bool + prompt text pause before this step, e.g. "Move mic to position 3" + preDelay seconds extra settle time before the trigger + +RewSequence + name, steps[], port + loops int run the whole list N times (repeatability) + betweenSteps seconds + onError stop | skip step | retry once + restoreRewSettings bool snapshot REW settings before the run, restore after + saveMdatPath string optional "Save all" at the end + resultsFolder string where the run results (§6.2) are written automatically + addLogMarkers bool one SPLMeter timeline marker per step +``` + +- Fields left "unchanged" (a per-field `inherit` flag, shown as "—" in the table) are not sent. This keeps REW settings the user made by hand, such as the sweep length. +- Persistence: `UIState/RewSequencer` (last sequence + window state). **Save / Load Sequence…** as `*.rewseq.json`. The sequence is not part of the SPLMeter settings JSON (decided, Q3). +- **Add positions…** helper: generates N copies of the selected step with `waitForUser` set and names like `Pos 1`, `Pos 2`, …. + +## 4. User interface + +`RewSequencerWindow` (DocumentWindow, resizable, about 900×560): + +``` +┌ REW Measurement Sequencer ──────────────────────────────────────────────┐ +│ ● REW 5.40 b147 · API 0.9.9 · Java · 48 kHz Port [4735] [Connect] │ +│ Sequence [Room L/R 9 pos ▾] [Load…] [Save…] Loops [1] Gap [2 s] │ +├───┬───┬──────────┬──────┬─────┬────────┬──────────┬──────┬────┬────┬─────┤ +│ # │ ✓ │ Name │ Out │ In │ Level │ Sweep │ Len │ Rep│ Ref│ Wait│ +│ 1 │ ✓ │ L pos1 │ L │ 1 │ −12 dBFS│ 20–20k │ 512k │ 1 │ Ac │ ✓ │ +│ 2 │ ✓ │ R pos1 │ R │ 1 │ — │ — │ — │ — │ — │ │ +│ … │ │ │ │ │ │ │ │ │ │ │ +├───┴───┴──────────┴──────┴─────┴────────┴──────────┴──────┴────┴────┴─────┤ +│ [+ Add] [Duplicate] [Add positions…] [Delete] [▲] [▼] │ +├──────────────────────────────────────────────────────────────────────────┤ +│ [▶ Run] [❚❚ Pause] [■ Abort] Step 3/18 · loop 1/1 · measuring… 0:07 │ +│ ▓▓▓▓▓▓▓▓░░░░░░░░░░░░░░░░ │ +│ 12:01:03 1 L pos1 ✓ "L pos1" uuid 7ec… │ +│ 12:01:15 2 R pos1 ✓ … │ +└──────────────────────────────────────────────────────────────────────────┘ +``` + +- Status dot: green when connected and audio is ready; amber when REW is reachable but `audio/status.ready` is false or blocking is on; red when REW is not reachable. Checked every 5 s while the window is open and idle. +- Choice columns (output, sweep length, timing reference, level unit) are filled from REW's `…/choices` endpoints after connecting, with built-in defaults offline. The sequence can be edited without REW running. +- A **wait-for-user** step shows a prompt banner with **Continue** / **Skip** / **Abort**, and the window comes to the front. +- While a sequence runs, the table is read-only and the current row is highlighted. Closing the window asks whether to abort. +- **Dry run** (checkbox next to Run): sends all settings but skips the trigger. Use it to check routing. + +## 5. Engine + +### 5.1 Components + +| File | Purpose | +|---|---| +| `Source/Rew/RewTransport.h` | interface `request(method, path, body) → {status, body}`, plus `HttpRewTransport` (juce::URL, connection timeout 2 s, read timeout 5 s) | +| `Source/Rew/RewSequence.h` | `RewStep`, `RewSequence`, JSON (de)serialisation, validation | +| `Source/Rew/RewSequencer.h` | runner on its own `juce::Thread`; state machine; publishes a progress snapshot (mutex-protected, polled by the window at 10 Hz) | +| `Source/RewSequencerComponent.h` | window, table, controls, run log | + +The engine never runs on the audio thread and does not touch the processor, apart from the optional log marker posted to the message thread. + +### 5.2 Run sequence + +``` +Preflight: GET /version · /audio/status (ready) · /audio/driver · GET /application/blocking + → POST blocking=false (remember the old value) + → snapshot settings if restoreRewSettings (output, inputs, level, sweep, reps, timing, naming, notes) + → validate every enabled step against REW's choice lists (unknown output → error before starting) +Per step: [waitForUser] → configure (POST only the non-inherited fields, check every response) + → naming {title, namingOption:"Use as entered"} + notes + → preDelay → remember the UUID set and the error/warning counts + → POST /measure/command SPL (202 expected; 400 = busy → wait and retry once) + → wait for the result (§5.3) → group assignment → log line → betweenSteps +End: optional Save all → restore snapshot → restore blocking → summary +Abort: POST /measure/command Cancel, then restore as above +``` + +### 5.3 Completion detection + +Poll every 500 ms: + +1. `GET /measurements`: a **UUID not in the set before the trigger** means a new measurement. With multi-input, wait for the expected count (`inputLast − inputFirst + 1`, plus one overall average unless `no-overall-average`), or until 2 s pass without another one. Comparing UUIDs instead of counting entries keeps working when the user deletes measurements or REW hits its 500-measurement limit. +2. `GET /application/errors` and `/warnings`: a new entry since the trigger is attached to the step. An error ends the step as **failed** (e.g. clipping abort, no Pro licence, input not found). A warning (e.g. low SNR) is logged and the step counts as ok. +3. Timeout: expected duration = start delay + repetitions × (sweep samples ÷ fs + 1 s) + 15 s margin. When it passes: Cancel, step **failed: timeout**. + +`onError` then decides: stop the sequence, skip to the next step, or retry the step once. + +### 5.4 Threading and robustness + +- All HTTP runs on the sequencer thread; the UI thread never blocks. +- Abort and pause are atomics checked between every request and every poll. +- The plugin editor can be closed while a sequence runs: the runner is owned by the **processor** (decided, Q4), so the window can be reopened and the run continues. Destroying the processor aborts the run (Cancel + restore). +- JSON bodies are built with `juce::JSON`, never by string concatenation (quotes in names). + +## 6. SPLMeter integration + +### 6.1 Per-step measurement (decided, Q6) + +REW measures the sweep; SPLMeter measures the same interval with its own microphone and accelerometer. REW cannot measure vibration, so these values are part of the result, not an extra. + +- **Step integrator** in the processor (audio thread, lock-free): the sequencer sets `stepBegin` at the trigger and `stepEnd` when the measurement arrives. In between it accumulates + - mic: mean square A, C and Z → **L_Aeq, L_Ceq, L_Zeq**, plus **L_AFmax**, **L_CSmax**, **L_Cpeak**; + - vibration (if an accelerometer is active): per axis X/Y/Z and Σ the **RMS** over the step (energy mean, weighted as configured) and the **peak**, plus the profile's **main value**, unit and profile name. +- It does not touch the user's running values: no reset of LAeq, log, peaks or vibration accumulators. +- Paused metering (Pause / DAW sync) is respected. A step that was partly paused is flagged. +- The step window runs from the trigger to the measurement's arrival. That includes REW's start delay and the silence before and after the sweep. The duration is stored, so values can be compared between steps. + +### 6.2 Run results (saved) + +At the end of the run, and also after an abort or error with the steps done so far, SPLMeter writes to `resultsFolder`: + +- `__