Skip to content
DeepForgeby svx
All problems
EasyNLPnlp-192

Mel Spectrogram Bin Count

Problem

Return the number of frequency bins in an FFT spectrogram: n_fft // 2 + 1, which includes the DC and Nyquist bins.

Hint

A real FFT of size N keeps N // 2 + 1 non-redundant bins.

Test cases

case 1
in: [512]
expected: 257
case 2
in: [400]
expected: 201
case 3
in: [1024]
expected: 513
case 4
in: [0]
expected: 1
Starter codePython
def mel_bin_count(n_fft):
    # Your code here
    pass

4 test cases · run your code against them in the editor