question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Misleading documentation

See original GitHub issue

stft docs state hop_length does not affect frequency resolution; this isn’t true. The per-point resolution is unaffected, but that of the time-frequency plane is, and any hop_length greater than 1 guarantees loss of analysis information for most practical signals, and loss of reconstruction information except for certain windows with specific hop_lengths.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
OverLordGoldDragoncommented, Nov 18, 2020

@bmcfee There’s “frequency” in “time-frequency”; methods like synchrosqueezing rely on instantaneous frequency information to accurately extract components per modulation model (AM+FM-decoupled).

Regardless, strictly speaking you’re correct; resolution purely along frequency axis, disregarding its higher order derivatives or other analysis parameters, is unaffected. It’s why I titled “misleading” rather than “wrong”; part of what motivated my post is a few questions I’ve seen on Stack Exchange being surprised or confused about results when using high hop_length.

Experienced users don’t need docs to know said frequency resolution’s unaffected, but it’s those less familiar that might trip on “frequency is captured equally well”. This is more of a design decision - proceed however you see fitting.

1reaction
lostanlencommented, Nov 18, 2020

Hello @OverLordGoldDragon,

The documentation is correct.

The frequency resolution of a windowed Fourier atom is defined as inversely proportional to the energy spread around its center frequency. This energy spread is independent from the choice of discretization, whether orthogonal or redundant. A fortiori, the impact of hop_length on the reconstruction error is an entirely separate question.

In practice, if you wish to estimate empirically the frequency resolution of a time–frequency representation, what you can do is to pass a sine wave of frequency f and measure the energy spread around f. Denoting by Delta(f) this energy spread, the frequency resolution can be defined as 1/Delta(f). Note that Delta(f) is constant for STFT and is proportional to f for CQT.

Conversely:

any hop_length greater than 1 guarantees loss of analysis information for most practical signals

it’s not that simple. I suggest you read on Non-Stationary Gabor Transform (NSGT) to see how the hop_length may be above 1 while still allowing perfect reconstruction.

P. Balazs, M. Dörfler, F. Jaillet, N. Holighaus, and G. A. Velasco. Theory, implementation and applications of nonstationary Gabor frames. J. Comput. Appl. Math., 236(6):1481–1496, 2011 https://www.univie.ac.at/nonstatgab/pdf_files/badohojave11_04042011.pdf

Read more comments on GitHub >

github_iconTop Results From Across the Web

817.2341 False or Misleading Statements or Supporting ...
(3)(a) Any person who knowingly makes a material false statement or report to the department or office or any agent of the department...
Read more >
False documentation - Wikipedia
False documentation is the process of creating documents which record fictitious events. The documents can then be used to "prove" that the fictional...
Read more >
Misleading documentation on provider configuration #30910
The documentation on configuring providers here seems to be incorrect. You can use expressions in the values of these configuration ...
Read more >
IBM-WEBSERVICES-BND.XMI, ETC
Reviewing the following documentation from the Information Cente ... PK16355: MISLEADING DOCUMENTATION, WEB SERVICES ENGINE REQUIRES THE IBM FILES INSIDE ...
Read more >
Beware: Misleading Documentation Offers - Cruising World
Renewing documentation for most vessels is simple and straightforward, and costs $26 annually (renewal options for up to five years are also ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found