[DOC] Explain relationship between recording duration and STFT output dimensions #44

Open
opened 2025-04-19 17:33:35 +00:00 by nuluh · 0 comments
nuluh commented 2025-04-19 17:33:35 +00:00 (Migrated from github.com)

Documentation Type

Thesis Chapter/Section

Description

Need to document the relationship between original time-domain signal duration and resulting STFT output dimensions. Specifically, explain why 256 seconds of accelerometer data processed with STFT results in a dimension of 513 time bins when using a hop size of 0.5 seconds, creating a shape of (513,513) for the magnitude array.

Current State

The thesis currently describes the STFT parameters but lacks a clear explanation of how the original signal duration directly affects the resulting time bins in the STFT output. The relationship between sampling frequency, window size, hop size, and resulting dimensions needs clarification.

Proposed Changes

  1. Add a detailed explanation in Section X.Y of how the STFT time bins are calculated:

    • Formula: num_time_bins = 1 + (signal_duration_in_samples - window_size) / hop_size
    • Show the calculation with our specific values (256 seconds, sampling rate, window size 1024, hop size 512)
  2. Include a paragraph explaining how the 0.5-second hop size relates to the time resolution

  3. Add a diagram showing how window size and hop size create overlapping segments that result in the specific number of time bins

  4. Explain the complete resulting shape (513,513) where:

    • 513 frequency bins = window_size/2 + 1 (from Nyquist theorem)
    • 513 time bins = calculated from signal duration and hop size
  5. Include a note on how changing parameters would affect output dimensions

Documentation Location

latex/chapters/methodology/signal_processing.tex

Priority

Medium (helpful but not urgent)

Target Audience

Thesis Committee/Reviewers

References

  • Source code in src/preprocessing/stft_transform.py
  • Documentation for scipy.signal.stft function
  • My experiment notebook: notebooks/stft_analysis.ipynb
  • Related issue: #43 (STFT dimension discrepancy bug)

Additional Notes

This explanation is essential for understanding both the theoretical foundation and the practical implementation of the spectral analysis in my thesis. It will tie directly to the recent bug fix in issue #43 where the export shape was incorrect. The documentation should emphasize why these specific values were chosen and how they optimize the time-frequency resolution tradeoff for this specific analysis.

### Documentation Type Thesis Chapter/Section ### Description Need to document the relationship between original time-domain signal duration and resulting STFT output dimensions. Specifically, explain why 256 seconds of accelerometer data processed with STFT results in a dimension of 513 time bins when using a hop size of 0.5 seconds, creating a shape of (513,513) for the magnitude array. ### Current State The thesis currently describes the STFT parameters but lacks a clear explanation of how the original signal duration directly affects the resulting time bins in the STFT output. The relationship between sampling frequency, window size, hop size, and resulting dimensions needs clarification. ### Proposed Changes 1. Add a detailed explanation in Section X.Y of how the STFT time bins are calculated: - Formula: num_time_bins = 1 + (signal_duration_in_samples - window_size) / hop_size - Show the calculation with our specific values (256 seconds, sampling rate, window size 1024, hop size 512) 2. Include a paragraph explaining how the 0.5-second hop size relates to the time resolution 3. Add a diagram showing how window size and hop size create overlapping segments that result in the specific number of time bins 4. Explain the complete resulting shape (513,513) where: - 513 frequency bins = window_size/2 + 1 (from Nyquist theorem) - 513 time bins = calculated from signal duration and hop size 5. Include a note on how changing parameters would affect output dimensions ### Documentation Location latex/chapters/methodology/signal_processing.tex ### Priority Medium (helpful but not urgent) ### Target Audience Thesis Committee/Reviewers ### References - Source code in src/preprocessing/stft_transform.py - Documentation for scipy.signal.stft function - My experiment notebook: notebooks/stft_analysis.ipynb - Related issue: #43 (STFT dimension discrepancy bug) ### Additional Notes This explanation is essential for understanding both the theoretical foundation and the practical implementation of the spectral analysis in my thesis. It will tie directly to the recent bug fix in issue #43 where the export shape was incorrect. The documentation should emphasize why these specific values were chosen and how they optimize the time-frequency resolution tradeoff for this specific analysis.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: nuluh/thesis#44