2
$\begingroup$

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,

$\endgroup$
1
  • $\begingroup$ please provide additional information about the differences, routines used, what is the input, what did you expect and what are the outputs. $\endgroup$
    – WMXZ
    Commented Feb 15 at 17:12

2 Answers 2

1
$\begingroup$

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.

$\endgroup$
0
$\begingroup$

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.

$\endgroup$
1
  • 2
    $\begingroup$ bernabeu-a, OK, but this is better added as comment and not as a answer to original question. Also, in order to dive into the code, one would need all the parameters used. Otherwise, it results only to philosophical discussion $\endgroup$
    – WMXZ
    Commented Feb 16 at 9:00

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.