Learning center

Earthquake spectrograms: padded frames, zero power and numeric arrays

Read a time–frequency spectrum with its frequency, timing and normalization conventions. Two small synthetic examples explain the displayed values and the meaning of an unavailable dominant frequency.

Read a time–frequency spectrum with its frequency, timing and normalization conventions. Two small synthetic examples explain the displayed values and the meaning of an unavailable dominant frequency.

Scope of this guide. The nonzero example is a retained local run and export on an older source snapshot. A separate zero-power run used candidate bytes matching the repository snapshot reviewed on 11 November 2026. References below to current source or current-byte results describe that dated snapshot. These are two small synthetic cases, not earthquake classification, physical PSD validation, full-app acceptance or evidence that a hosted service or immutable release contains the current source changes.

Product and app: Engineering Signal Processing · engineering_signals/earthquake_analysis. For real waveform roles, calibration declarations and onset candidates, read the Earthquake waveform guide.

Start with the input and the selected route

The saved nonzero fixture contains 256 alternating samples at 128 Hz. Its canonical NPZ has time_s, z and metadata_json; the metadata declares m/s2 and baseline correction. A separate 256-sample zero fixture uses the same sampling rate and declarations. These declarations identify the input contract; they do not establish instrument calibration. Neither example supplies P/S picks or additional acceleration components.

  1. Use LOAD EARTHQUAKE / WAVEFORM for the named input. Check the accepted sample count, sampling rate, component and input identity before interpreting any result.
  2. Open EDIT SETTINGS / METADATA. In the recorded setup, only stft_segment_samples changed from null to 16; VALIDATE AND APPLY accepted it. Keep the rest of the processing record. Sixteen samples is this example’s setting, not a recommendation for every recording.
  3. Select only the spectrogram route and run it. Inspect its route status and the Time-Frequency table. Loading an input does not establish that every app route is applicable.

The source uses a periodic Hann window, 12 samples of overlap and a four-sample hop for this setting. It removes a constant trend within each window. That differs from globally demeaning the uploaded waveform; both saved run contracts record that global demeaning was not performed.

Understand which frames and frequencies remain

QuantityRetained exampleInterpretation
Input record256 samples at 128 HzEncoded times run from 0 to 1.9921875 seconds.
Window / overlap / hop16 / 12 / 4 samplesSuccessive frame centers are 0.03125 seconds apart.
Frequency grid9 bins: 0 through 64 Hz, spaced by 8 HzThe first row is DC; the last is the Nyquist bin.
Retained frame centers64 times: 0 through 1.96875 secondsCenters outside the encoded input interval are excluded.
Power array9 × 64 = 576 valuesFrequency is the first dimension; time is the second.
Boundary windows61 complete windows; 3 partial windowsFrames 0, 1 and 63 still include zero padding.
Display decimation[1, 1]This small example displays every power row and column.

Keeping a frame’s center inside the record does not mean its entire window lies inside the record. The retained numerical comparison explicitly includes the three partial windows. Do not compare an edge frame with an interior frame as if their input support were identical. For larger results, the source can decimate the plotted grid; the Display Decimation field describes that choice while the cached power array retains its computed grid.

Keep the normalization convention explicit

This route uses SciPy 1.15.3 ShortTimeFFT with fft_mode='onesided' and scale_to='psd'. It retains nonnegative frequencies without doubling interior power. SciPy documents onesided2X as a different coefficient-scaling convention; changing to it would change the numbers. See the versioned FFT-mode definition and spectrogram definition and padding default.

The earlier independent comparison checked all 576 saved power values and their axes against an explicit finite-sum reference. For complete interior windows, that retained reference gives a plain nonnegative-bin integral of 5/6, versus 1 when conjugate-frequency weights are included. These are previously recorded results, not a new calculation. Numerical agreement with the configured convention does not establish an energy-conserving one-sided density interpretation, physical adequacy or agreement with a different app’s Welch settings.

Read zero power as unavailable dominance

The current source chooses dominant frequency only among positive-frequency bins with positive power. Frames without that support have a missing track value and are excluded from the median. A gap does not mean a measured frequency of 0 Hz. Positive ties use the first eligible frequency bin; the separate helper checks do not establish mixed-frame native rendering.

ObservationOlder nonzero runSeparate current-byte zero run
Power grid9 frequencies × 64 frames9 frequencies × 64 frames; all power values zero
Dominant track64 Hz in all 64 recorded frames64 missing values
Valid / unavailable frame fieldsThese two fields were not in the older table.0 valid / 64 unavailable
Saved median text64“Unavailable (zero power)”
Native export in this evidenceOne 10-member ZIPNo Export or Viewer action

The zero-case observation preserves the complete current Time-Frequency table, including its two added frame-count fields. It is a saved review observation, not a native exported table. Finite medians are formatted to nine significant digits by the source; a complete JSON export preserves that formatted string rather than restoring extra numerical precision.

Separate the heatmap from its numeric power

The current heatmap helper builds a separate logarithmic display buffer and an 80 dB range below the peak of the plotted slice. Values below that range include zero; the caption and lower colorbar extension disclose this display choice. An all-zero slice is labeled No positive power. This does not replace zeros in the power array with positive measurements.

The retained older positive PNG used an earlier display treatment that compressed nonzero differences. A later display-only review and the separate current-byte zero review have their own source identities. A subsequent positive drawing capture remains incomplete: it stopped before its explicit draw or PNG. That missing evidence is not a demonstrated clipping defect, and this guide does not turn it into a current positive-layout pass.

Inspect the actual package, including its limits

The source control is labeled EXPORT VERIFIED PACKAGE. The saved package nevertheless declares validated: false and identifies itself as an unvalidated earthquake-analysis evidence package. The button label does not establish scientific validation. Source checks also show that export refuses an existing destination and refuses a run whose waveform identity or settings no longer match.

Saved content in the older positive ZIPComplete representation
arrays/time_s.npy and arrays/acceleration_z.npyTwo float64 vectors of length 256: the accepted time coordinate and Z values.
arrays/time_frequency_power.npyFloat64, shape (9, 64), stored in Fortran order. Preserve its header and coordinate arrays when reading it.
arrays/time_frequency_time_s.npy and arrays/time_frequency_hz.npyFloat64 vectors of lengths 64 and 9. The vectors are not stored in Fortran order.
settings.json, receipt.json and tables.jsonProcessing settings, route/provenance record and two complete tables: 10 run-contract fields plus 12 Time-Frequency fields.
figures/01_Time-Frequency.pngOne figure from the older display source. A figure is not a substitute for the five numeric arrays.
manifest.jsonNine member identities. The manifest is the tenth ZIP member; retain the package hash separately.

The package contains numeric input copies, not the original NPZ bytes or source filesystem paths. This export does not contain a complex STFT coefficient array or a separate dominant-frequency track. The 64 observed track points belong to the retained review evidence; do not count them as an additional native ZIP member. Export completeness and session restoration are different claims.

Worked examples describe particular inputs, methods and recorded results. Check current availability and input requirements before planning an evaluation.

← Back to the learning center