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.

Question about y_frames computed in librosa.core.spectrum.stft() function

See original GitHub issue

Description

I noticed that y_frames in librosa.core.spectrum.stft() is computed by

y_frames = util.frame(y, frame_length=n_fft, hop_length=hop_length)

when win_length is smaller than n_fft(for example, in asr task, win_length=400, n_fft=512) and center flag is False, it seems got fewer frames than expected(often missing last frame).

Issue Analytics

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

github_iconTop GitHub Comments

1reaction
funcwjcommented, Jun 28, 2018

OK, thanks a lot.

1reaction
funcwjcommented, Jun 27, 2018

I see, I just supposed that nfft is length of padded frame, not real frame length, and for speech recognition task(see kaldi:feature-window.cc:54), number of frames is computed by

1 + (num_samples - frame_length) // frame_shift)

instead of

1 + (num_samples - nfft) // frame_shift)

and frame_length is always equal to win_length.

Read more comments on GitHub >

github_iconTop Results From Across the Web

librosa.stft — librosa 0.10.0.dev0 documentation
The STFT represents a signal in the time-frequency domain by computing discrete Fourier transforms (DFT) over short overlapping windows. This function returns a ......
Read more >
Getting the frequencies associated with STFT in Librosa
I would like to point out this question and answer in particular: How do I obtain the frequencies of each value in an...
Read more >
How does the plot of the output of librosa.stft work? - Kaggle
So, I have been analyzing audio data. I used the librosa package and used its .stft() function to calculate the Fourier transform of...
Read more >
window - How to deal with overlap in STFT when considering ...
How do I produce a single channel audio file, with the highest energy per window? For reproduction: I am using librosa.core.stft for the...
Read more >
some question about librosa stft - Google Groups
if sample_rate value set 10000, stft method n_fft parameter set 100, ... to STFT bands, librosa.fft_frequencies() will compute that for you.
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