I noticed a difference in output when computing the TFSD using the seewave R package and the scikit-maad implementation in python.
Is there any justification and is it possible to get the same result from the same input?
Regards,
I noticed a difference in output when computing the TFSD using the seewave R package and the scikit-maad implementation in python.
Is there any justification and is it possible to get the same result from the same input?
Regards,
I think it's essentially the same answer to both questions.
In general (regarding development of software algorithms), a clearly defined specification and/or standard is required to get the same result from the same input. I wasn't familiar with TFSD but after googling see that it is an acronym for time-frequency second derivative. It looks like this is more of a concept than a clearly defined algorithms, so it seems reasonable that there could be more than one way to estimate this quantity.
Without a clearly defined and well-standardised specification that can be followed, software developers have some latitude when translating a concept into an algorithm.
There are a number of factors that can lead to differences in implementation of a concept -- even if all input parameters are the same. These factors might include: the specific details of the algorithm/software implementation, the programming language, low-level data types, and additional libraries that are used.
If you really need the scikid-maad result, but want to do everything else in R you could look into the R package reticulate (https://cran.r-project.org/web/packages/reticulate/vignettes/calling_python.html) to call Python code from within R. Or if it's the seewave results that you require, but you're working in Python, then the rpy2 package (https://github.com/rpy2/rpy2) seems to be the way to achieve that. NB: Though I'm aware of these packages, I've never actually used them myself, so can't comment on how easy they are to use or how well they work.
Thank you Brian for the answer. I will look into these packages.
@WMXZ input: any wav file, routine used: TFSD from seewave and TFSD from scikit-maad using the same parameters, I expected the same output.
So far, I think the main difference is in the spectrogram computation that feed the algorithm.