-3

I found a github containing a Voice Activity Detection algorithm here. the implementation takes in a simple list of doubles (file = sound.txt), and outputs several text files, containing 2 columns of data (files = example_.txt)

It contains an older gnuplot script to display a multiplot. However, this script needs revising with the new gnuplot

Here's the script:

$ gnuplot
$ > set multiplot
$ > plot "sound.txt" with 1:2 lines
$ > filename(n) = sprintf("example_%d.txt", n)
$ > plot for [i=1:10] filename(i) using 1:2 with lines

Can anyone figure out what this script is trying to do, and update it to the new syntax?

Thanks, Charles.

1 Answer 1

1

That script looks pretty recent to me, and is missing only the unset multiplot to close off the figure. As written, all 11 plots are drawn on top of each other to make a superposition of "sound.txt" with 10 examples. I don't know whether that is the actual intent.

If you instead want to make a figure with all 11 plots drawn separately in a column, each one spanning the width of the page and occupying ~1/11 of the vertical space you could modify it to something like this. If the individual files do not span an identical range of x values (column 1 data) they may not line up properly unless you explicitly state the desired x range.

filename(n) = sprintf("example_%d.txt", n)
set xrange [0:whatever]

set multiplot layout 11, 1
plot "sound.txt" with 1:2 lines    
do for [i=1:10] {
    plot filename(i) using 1:2 with lines
}
unset multiplot
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

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

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.