Post by Eric WongPost by PanderPlease review the attached patch for outputting the average power spectrum.
I am not knowledgable in the math behind this, but I noticed one
Post by Pander@@ -134,6 +138,15 @@ static int sox_stat_flow(sox_effect_t * effp, const sox_sample_t *ibuf, sox_samp
priv_t * stat = (priv_t *) effp->priv;
int done, x, len = min(*isamp, *osamp);
short count = 0;
+ float *re_average;
re_average needs to be initialized for the "stat->fft_average != 1" case
float *re_average = NULL;
Thanks, that will also remove a warning.
Please see the attachement for the incremental patch.
in the patch for the maintainer.
Post by Eric WongPost by Pander+ if (stat->fft_average == 1) {
+ samples = (stat->fft_size / 2);
+ ffa = effp->in_signal.rate / samples;
+ re_average = lsx_malloc(sizeof(float) * (int)samples);
+ }
+ if (re_average) {
+ free(re_average);
+ }
*isamp = *osamp = len;
/* Process all samples */
There's also a bunch of unrelated whitespace eliminations
in the manpage which should probably be a separate commit
(but I'm not a sox maintainer, just another user + occasional patcher).
------------------------------------------------------------------------------
Dive into the World of Parallel Programming! The Go Parallel Website,
sponsored by Intel and developed in partnership with Slashdot Media, is your
hub for all things parallel software development, from weekly thought
leadership blogs to news, videos, case studies, tutorials and more. Take a
look and join the conversation now. http://goparallel.sourceforge.net
_______________________________________________
SoX-devel mailing list
https://lists.sourceforge.net/lists/listinfo/sox-devel