LCAV/pyroomacoustics

Demo code changes

IandRover opened this issue · 1 comments

Hi, I would like to report that a piece of code might be misleading in the notebooks/stft.ipynb.

In the code here (https://github.com/LCAV/pyroomacoustics/blob/master/notebooks/stft.ipynb), we have:

frame_len = 512
X = pra.stft(audio, L=frame_len, hop=frame_len, transform=np.fft.rfft)

But actually I have to modify it into the following to yield the same result:

frame_len = 512
analyzer = pra.stft.STFT(N=frame_len, hop=frame_len, transform=np.fft.rfft)
X = analyzer.analysis(audio)

or equivalently

X = pra.stft.analysis(audio, L=frame_len, hop=frame_len)

Thank you for your time.

Thanks for reporting this! I will update the examples!