0

I am using librosa to get stft.

frame = 2048
a = librosa.stft(y, n_fft=frame,hop_length= int(frame /4), window='hann')

librosa.stft returns np.ndarray [shape=(1 + n_fft/2, t), dtype=dtype]

so a's dimension is (1025,***)

OK, 1025 is frequency classification.

However, how do I know which index in array correspond to each Hz??

For example when I want to mute under 440Hz, which is correct??

a[:10] = 0 
a[:100] = 0
a[:150] = 0 

How do I know the correct array index?

whitebear
  • 11,200
  • 24
  • 114
  • 237
  • 1
    Does this answer your question? [Getting the frequencies associated with STFT in Librosa](https://stackoverflow.com/questions/63350459/getting-the-frequencies-associated-with-stft-in-librosa) – Hendrik Dec 13 '20 at 19:47
  • 1
    Thank you verymuch, that's exactly what I want to know. – whitebear Dec 14 '20 at 04:09

0 Answers0