LCAV / pyroomacoustics

Pyroomacoustics is a package for audio signal processing for indoor applications. It was developed as a fast prototyping platform for beamforming algorithms in indoor scenarios.
https://pyroomacoustics.readthedocs.io
MIT License
1.33k stars 417 forks source link

Demo code changes #297

Open IandRover opened 1 year ago

IandRover commented 1 year ago

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.

fakufaku commented 1 year ago

Thanks for reporting this! I will update the examples!