Analytics & ML · Study deck

Edge Data: Semantic Compression and Pipelines

Reducing every sample by the same rule still sends data the application may not need.

Data Dora is your guide for this deck.

edgesamplingcompression
Data Dora, the module guide, in a scene from this chapter.
iotclass.org

After studying this chapter

Learning objectives

You will be able to:

  • design semantic event extraction
  • select compression from evidence needs
  • validate a multi-sensor edge pipeline
  • Explain: Event-like data can often become sparse semantic records; smooth numeric streams may support delta or window summaries; spectral decisions may justify selected frequency features; audit-grade reconstruction keeps the route lossless.
iotclass.org

Major section

Algorithm Selection Decision Tree

Event-like data can often become sparse semantic records; smooth numeric streams may support delta or window summaries; spectral decisions may justify selected frequency features; audit-grade reconstruction keeps the route lossless.

  • The final resource branch checks whether memory, latency, and energy fit the edge device.
Edge Data Compression Algorithm Selection Decision Tree
Edge Data Compression Algorithm Selection Decision Tree
iotclass.org

Major section

Over-Aggressive Lossy Compression

The Mistake: Applying high compression ratios uniformly across all sensor data without understanding which information is critical for downstream analytics, permanently destroying signals needed for root cause analysis.

  • Compression algorithms are chosen based on benchmark performance rather than domain-specific information preservation.
  • The "we can always collect more data later" assumption fails for non-reproducible events.
  • For predictive maintenance, preserve frequency-domain information (use FFT compression, not just statistics).
iotclass.org

Major section

Compression Compute Cost

The 1000x difference in computational efficiency between an ESP32 and a laptop is underestimated.

  • Energy cost of computation versus transmission varies by network type (Wi-Fi is cheap to transmit, LoRa is expensive).
  • For LoRaWAN devices where transmission costs 100+ mJ per packet, aggressive compression (even expensive algorithms) saves energy.
  • For Wi-Fi devices where transmission costs 1-5 mJ per packet, simple aggregation beats complex compression.
iotclass.org

Major section

Choose Edge Compression

The ratios in the comparison table are illustrative workload ranges, not guarantees for a new sensor stream.

  • If it does, keep the transformation lossless and prove that decompression reproduces the source bytes.
  • YES → Use event logging (transmit only state changes).
  • YES → Use lossless compression only (GZIP, DEFLATE).
  • YES (vibration, acoustics) → Use FFT + top-N bins.
iotclass.org

Major section

Choose Edge Compression (continued)

If a lossy representation is acceptable, inspect the signal: stable frequency components can support FFT features, slow trends can support window statistics, and bounded low-variance values can support delta encoding.

  • YES → Use statistical aggregation over time windows.
  • YES → Use delta encoding + lossless compression.
  • NO → Use adaptive sampling rate based on rate-of-change.
iotclass.org

Major section

Time-Series Compression Audit

The Keep raw windows around anomalies note makes the bargain explicit: compact events travel, while selected waveform evidence remains available for audit.

  • The closing Reduction changes the claim panel distinguishes losing hoof-strike peaks from losing the waveform itself.
  • Its retention panel separates a short replay buffer from ninety-day trends and an explicitly authorized long hold.

Why it matters

The shared Same ID and clock premise prevents a misleading comparison between differently described records.

Edge processing path from a six-axis cow-collar stream through fog event extraction to herd-level cloud comparison, with raw anomaly windows retained.
Edge processing path from a six-axis cow-collar stream through fog event extraction to herd-level cloud comparison, with raw anomaly windows retained.
iotclass.org

Major section

Concept Relationships

Under-sampling causes phantom patterns (150 Hz bearing fault aliased to 30 Hz when sampled at 60 Hz).

  • Lossless (GZIP): 2-4x reduction, preserves all data (audit trails, compliance).
  • Lossy statistical (aggregation): 10-100x reduction, preserves trends (environmental monitoring).
  • FFT-based: 50-500x reduction, preserves frequency spectrum (vibration analysis).
  • Semantic (event extraction): 100-1000x reduction, preserves state changes (threshold monitoring).

Why it matters

edge Data Acquisition: Power and Gateways: Compression reduces transmission frequency, directly extending battery life (factory case: 14,400x reduction enables LoRa vs cellular).

iotclass.org

Major section

Concept Relationships (continued)

Edge Data Acquisition: Architecture: Device category determines compression need (cameras need heavy compression; temperature sensors need aggregation).

  • Edge Compute Patterns: Edge ML requires compressed features (FFT bins, not raw waveforms).
  • data Quality and Preprocessing: Validation must occur before compression (compressing invalid data wastes resources).
  • Key Insight:: Compression algorithm selection depends on analytics requirements, not just compression ratio.
iotclass.org

Deck summary

Key takeaways

Event-like data can often become sparse semantic records; smooth numeric streams may support delta or window summaries; spectral decisions may justify selected frequency features; audit-grade reconstruction keeps the route lossless.

  • The Mistake: Applying high compression ratios uniformly across all sensor data without understanding which information is critical for downstream analytics, permanently destroying signals needed for root cause analysis.
  • The 1000x difference in computational efficiency between an ESP32 and a laptop is underestimated.
  • The ratios in the comparison table are illustrative workload ranges, not guarantees for a new sensor stream.
  • Edge Data Acquisition: Architecture: Device category determines compression need (cameras need heavy compression; temperature sensors need aggregation).
iotclass.org

Retrieval practice

Recall check 1 of 3

Data Dora says: answer from memory, then check your reasoning.

Q1A motor operates at 3600 RPM (60 Hz). Bearing defects typically manifest as harmonics at 2x, 3x, and 4x the rotation frequency. What is the minimum sampling rate to capture all relevant fault signatures without aliasing?

A120 Hz (2x the 60 Hz fundamental)
B480 Hz (2x highest harmonic of interest)
C240 Hz (the highest harmonic, not twice it)
D60 Hz (same as the shaft rotation frequency)
Show answer

Answer: B The highest frequency of interest is 4x the 60 Hz fundamental = 240 Hz.

iotclass.org

Retrieval practice

Recall check 2 of 3

Data Dora says: answer from memory, then check your reasoning.

Q2An edge device has 64KB of RAM. Which compression algorithm is MOST suitable for continuous vibration monitoring at 1 kHz sampling?

AGZIP Level 9 (best compression ratio)
BFFT with 4096-point window (best frequency resolution)
CFFT with 1024-point window (balanced memory/resolution)
DSemantic event extraction (lowest memory)
Show answer

Answer: C see answers page

Q3Place each sampling and compression responsibility where it lives so you can shrink payloads without aliasing events or losing the evidence needed to reconstruct them.

ASignal Bandwidth and Error Budget
BAnti-Alias Filter
CADC Sample Stream
DCompressed Payload and Metadata
Show answer

Answer: A Place each sampling and compression responsibility where it lives so you can shrink payloads without aliasing events or losing the evidence needed to reconstruct them.

iotclass.org

Retrieval practice

Recall check 3 of 3

Data Dora says: answer from memory, then check your reasoning.

Q4Complete the edge computing data aggregation function:

Aself.buffer = deque(maxlen=window_size)
Bself.buffer = list()
Cself.buffer = np.zeros(window_size)
Dself.buffer = deque()
Show answer

Answer: A Edge aggregation uses a fixed-size deque buffer to maintain a sliding window of readings.

iotclass.org

Print reference

Answers 1 of 2

Answer key.

  1. B · The highest frequency of interest is 4x the 60 Hz fundamental = 240 Hz.
  2. C · - GZIP requires 32-64KB just for compression state, leaving little for application - 4096-point FFT needs ~64KB for the complex buffer alone - won't fit - 1024-point FFT needs ~16KB, leaving room for application code and buffers - Semantic compression loses frequency information needed for vibration analysis For vibration monitoring specifically, FFT is essential to detect bearing harmonics.
iotclass.org

Print reference

Answers 2 of 2

Answer key.

  1. A · Place each sampling and compression responsibility where it lives so you can shrink payloads without aliasing events or losing the evidence needed to reconstruct them.
  2. A · Edge aggregation uses a fixed-size deque buffer to maintain a sliding window of readings.
iotclass.org