psychojs
psychojs copied to clipboard
Hamming/Hanning not yet implemented in PsychoJS
This is a great framework!
I tried to track in the code of Sound.js what the 'hamming' option does without success. The attribute is declared but seems to be never used. I also did not find any reference for it in Tone.js.
The reason I'm interested in this is because a Hamming window does not fall down to zero, while the Hann window does (wikipedia). I know there's been considerable confusion between Hamming's and Hann's windows (the latter being sometimes erroneously called "Hanning"), so I wanted to check what window was really applied and found none.
Cheers.
@apitiot would need to confirm but I think this is probably a placeholder, not yet implemented. In PsychoPy the issue is exactly as you imagine. We initially implemented a Hamming window, then switched to the superior Hanning window but actually left the argument with its original name. We debated changing the name but decided this level of change didn't warrant breaking user's scripts.
See the documentation source code at https://github.com/psychopy/psychopy/blob/b02d4dc866b62793d973020c6434cdd78dec094a/psychopy/sound/_base.py#L152
I can confirm that hamming has not been implemented yet. I had hoped I could do so quickly but, as mentioned by egaudrain, Tone.js does not seem to offer a way to do so, which significantly complicates the matter! My apologies for the mishap. I should have removed hamming from the function signature and from the documentation. I will be pushing the latest version of the library onto GitHub early next week, at which point hamming will have disappeared.
Alain
Actually, might I suggest that instead of removing it fmo the signature, just change the docs to indicate that it isn't yet implemented. I don't know if the Builder-generated code expects it to be there