viewof cpip_tempCount = Inputs.range([0, 50], {value: 10, step: 1, label: "Temperature Sensors"})
viewof cpip_vibCount = Inputs.range([0, 50], {value: 5, step: 1, label: "Vibration Sensors"})
viewof cpip_motionCount = Inputs.range([0, 50], {value: 8, step: 1, label: "Motion Sensors"})
viewof cpip_pressCount = Inputs.range([0, 50], {value: 3, step: 1, label: "Pressure Sensors"})
viewof cpip_tempRate = Inputs.range([1, 60], {value: 1, step: 1, label: "Temp Sample Rate (Hz)"})
viewof cpip_vibRate = Inputs.range([100, 5000], {value: 1000, step: 100, label: "Vibration Sample Rate (Hz)"})Multi-Sensor Compression Pipeline
Multi-Sensor Compression Pipeline
animation
analytics-ml
edge
compression
Try Change Vibration Sample Rate (Hz) from 1000 to 5000.
Observe Compare Raw (B/s), Compressed (B/s), and Ratio for Vibration (FFT Top-10) at 5000 Hz.
Explain Explain why vibration Raw (B/s) changes at 5000 Hz while Compressed (B/s) remains fixed.
Technical boundaries. Temperature uses 16 bytes per 300 seconds; vibration uses 40 bytes per 10 seconds. Motion assumes 3 events/hour, and pressure assumes a 5x ratio at 10 Hz.
NoteMulti-Sensor Compression Pipeline
Configure sensor counts and sampling rates to see how different compression strategies affect total bandwidth for a multi-sensor system.
cpip_tempRawBps = cpip_tempCount * cpip_tempRate * 2
cpip_tempCompBps = cpip_tempCount * (16 / 300) // 16 bytes per 5-min window
cpip_tempRatio = cpip_tempRawBps > 0 ? cpip_tempRawBps / cpip_tempCompBps : 0
// Vibration: FFT top-10 bins every 10 seconds (40 bytes per window)
cpip_vibRawBps = cpip_vibCount * cpip_vibRate * 2
cpip_vibCompBps = cpip_vibCount * (40 / 10) // 40 bytes per 10-sec window
cpip_vibRatio = cpip_vibRawBps > 0 ? cpip_vibRawBps / cpip_vibCompBps : 0
// Motion: event logging (~3 events/hour, 8 bytes each)
cpip_motionRawBps = cpip_motionCount * 1 // 1 byte/s state polling
cpip_motionCompBps = cpip_motionCount * (3 * 8 / 3600) // 3 events/hour
cpip_motionRatio = cpip_motionRawBps > 0 ? cpip_motionRawBps / cpip_motionCompBps : 0
// Pressure: delta encoding + GZIP (5x ratio on 2-byte samples at 10 Hz)
cpip_pressRawBps = cpip_pressCount * 10 * 2
cpip_pressCompBps = cpip_pressRawBps / 5
cpip_pressRatio = 5
cpip_totalRawBps = cpip_tempRawBps + cpip_vibRawBps + cpip_motionRawBps + cpip_pressRawBps
cpip_totalCompBps = cpip_tempCompBps + cpip_vibCompBps + cpip_motionCompBps + cpip_pressCompBps
cpip_totalRatio = cpip_totalRawBps > 0 ? cpip_totalRawBps / cpip_totalCompBps : 0
cpip_totalRawDayMB = (cpip_totalRawBps * 86400) / (1024 * 1024)
cpip_totalCompDayMB = (cpip_totalCompBps * 86400) / (1024 * 1024)
cpip_savedDayMB = cpip_totalRawDayMB - cpip_totalCompDayMBhtml`<div style="background: var(--bs-light, #f8f9fa); border: 1px solid var(--bs-border-color, #dee2e6); border-radius: 8px; padding: 1.2rem; color: var(--bs-body-color);">
<h4 style="margin-top:0; color: #2C3E50;">Multi-Sensor Compression Summary</h4>
<table style="width:100%; border-collapse: collapse; font-size: 0.9rem;">
<tr style="background: rgba(44,62,80,0.06);">
<th style="padding: 6px 8px; text-align: left;">Sensor Type</th>
<th style="padding: 6px 8px; text-align: center;">Count</th>
<th style="padding: 6px 8px; text-align: right;">Raw (B/s)</th>
<th style="padding: 6px 8px; text-align: right;">Compressed (B/s)</th>
<th style="padding: 6px 8px; text-align: right;">Ratio</th>
</tr>
<tr style="border-bottom: 1px solid var(--bs-border-color, #dee2e6);">
<td style="padding: 6px 8px;">Temperature (Stat Agg)</td>
<td style="padding: 6px 8px; text-align: center;">${cpip_tempCount}</td>
<td style="padding: 6px 8px; text-align: right;">${cpip_tempRawBps.toFixed(0)}</td>
<td style="padding: 6px 8px; text-align: right; color: #0f6b5c;">${cpip_tempCompBps.toFixed(2)}</td>
<td style="padding: 6px 8px; text-align: right; font-weight: bold;">${cpip_tempRatio > 0 ? cpip_tempRatio.toFixed(0) + "x" : "-"}</td>
</tr>
<tr style="border-bottom: 1px solid var(--bs-border-color, #dee2e6);">
<td style="padding: 6px 8px;">Vibration (FFT Top-10)</td>
<td style="padding: 6px 8px; text-align: center;">${cpip_vibCount}</td>
<td style="padding: 6px 8px; text-align: right;">${cpip_vibRawBps.toFixed(0)}</td>
<td style="padding: 6px 8px; text-align: right; color: #0f6b5c;">${cpip_vibCompBps.toFixed(1)}</td>
<td style="padding: 6px 8px; text-align: right; font-weight: bold;">${cpip_vibRatio > 0 ? cpip_vibRatio.toFixed(0) + "x" : "-"}</td>
</tr>
<tr style="border-bottom: 1px solid var(--bs-border-color, #dee2e6);">
<td style="padding: 6px 8px;">Motion (Event Log)</td>
<td style="padding: 6px 8px; text-align: center;">${cpip_motionCount}</td>
<td style="padding: 6px 8px; text-align: right;">${cpip_motionRawBps.toFixed(0)}</td>
<td style="padding: 6px 8px; text-align: right; color: #0f6b5c;">${cpip_motionCompBps.toFixed(3)}</td>
<td style="padding: 6px 8px; text-align: right; font-weight: bold;">${cpip_motionRatio > 0 ? cpip_motionRatio.toFixed(0) + "x" : "-"}</td>
</tr>
<tr style="border-bottom: 1px solid var(--bs-border-color, #dee2e6);">
<td style="padding: 6px 8px;">Pressure (Delta+GZIP)</td>
<td style="padding: 6px 8px; text-align: center;">${cpip_pressCount}</td>
<td style="padding: 6px 8px; text-align: right;">${cpip_pressRawBps.toFixed(0)}</td>
<td style="padding: 6px 8px; text-align: right; color: #0f6b5c;">${cpip_pressCompBps.toFixed(1)}</td>
<td style="padding: 6px 8px; text-align: right; font-weight: bold;">${cpip_pressRatio}x</td>
</tr>
<tr style="background: rgba(44,62,80,0.06); font-weight: bold;">
<td style="padding: 6px 8px;">TOTAL</td>
<td style="padding: 6px 8px; text-align: center;">${cpip_tempCount + cpip_vibCount + cpip_motionCount + cpip_pressCount}</td>
<td style="padding: 6px 8px; text-align: right;">${cpip_totalRawBps.toFixed(0)}</td>
<td style="padding: 6px 8px; text-align: right; color: #0f6b5c;">${cpip_totalCompBps.toFixed(1)}</td>
<td style="padding: 6px 8px; text-align: right; color: #8a4a00;">${cpip_totalRatio > 0 ? cpip_totalRatio.toFixed(0) + "x" : "-"}</td>
</tr>
</table>
<div style="display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 0.8rem; margin-top: 1rem;">
<div style="text-align: center; padding: 0.6rem; background: rgba(231,76,60,0.08); border-radius: 6px;">
<div style="font-size: 0.8rem; color: #374151;">Raw Daily</div>
<div style="font-size: 1.3rem; font-weight: bold; color: #9f1d1d;">${cpip_totalRawDayMB < 1024 ? cpip_totalRawDayMB.toFixed(1) + " MB" : (cpip_totalRawDayMB/1024).toFixed(2) + " GB"}</div>
</div>
<div style="text-align: center; padding: 0.6rem; background: rgba(22,160,133,0.08); border-radius: 6px;">
<div style="font-size: 0.8rem; color: #374151;">Compressed Daily</div>
<div style="font-size: 1.3rem; font-weight: bold; color: #0f6b5c;">${cpip_totalCompDayMB < 1 ? (cpip_totalCompDayMB * 1024).toFixed(1) + " KB" : cpip_totalCompDayMB.toFixed(2) + " MB"}</div>
</div>
<div style="text-align: center; padding: 0.6rem; background: rgba(52,152,219,0.08); border-radius: 6px;">
<div style="font-size: 0.8rem; color: #374151;">Bandwidth Saved</div>
<div style="font-size: 1.3rem; font-weight: bold; color: #0d47a1;">${cpip_savedDayMB < 1024 ? cpip_savedDayMB.toFixed(1) + " MB" : (cpip_savedDayMB/1024).toFixed(2) + " GB"}/day</div>
</div>
</div>
</div>`