<div dir="ltr"><div class="gmail_default" style="font-family:arial,helvetica,sans-serif;font-size:small"><span style="font-family:arial">2014-08-08 19:42 GMT+02:00 Fons Adriaensen </span><span dir="ltr" style="font-family:arial"><<a href="mailto:fons@linuxaudio.org" target="_blank">fons@linuxaudio.org</a>></span><span style="font-family:arial">:</span><br>
</div><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div class="">
On Fri, Aug 08, 2014 at 08:46:54AM +0200, Raffaele Morelli wrote:<br>
<br>
> Great tool, I finally leaved it untouched as cumulative probability it's<br>
> enough for the scope*.<br>
><br>
> My 0.02€: I would suggest to add a cli option for output filename, leaving<br>
> 'ebur128-prob' as default if none is specified<br>
<br>
</div>Yes, the cumulative plots look less sexy but will give a better idea of<br>
dynamic range than a histogram. The 'loudness range' as displayed by<br>
ebumeter and printed by ebur128 is actually computed from the (modified)<br>
cumulative plots - details in the paper.<br></blockquote><div><br></div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif;font-size:small">​cumulative plot is way better to graphically compare two (or a bunch of) audio files dynamic.<br>
</div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif;font-size:small"><br></div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif;font-size:small">statistician here ;-)</div>
<div class="gmail_default" style="font-family:arial,helvetica,sans-serif;font-size:small">here's a few R lines to generate "sexy" plots, the script is supposed to be ran in the same dir where prob files are</div>
<div><br></div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif;font-size:small"><div style="font-family:arial"><div class="gmail_default" style="font-family:arial,helvetica,sans-serif;display:inline">
​</div>require(ggplot2)</div><div style="font-family:arial">require(reshape2)</div><div style="font-family:arial"><br></div><div style="font-family:arial"># read prob files, a shell script is being used to create and rename prob files as outputted from ebur128</div>
<div style="font-family:arial">files <- list.files(".", "*.prob$")</div><div style="font-family:arial"><br></div><div style="font-family:arial"># load prob files as tables in a list</div><div style="font-family:arial">
data.list <- lapply(files, read.table)</div><div style="font-family:arial"><br></div><div style="font-family:arial"># create an empty matrix </div><div style="font-family:arial">s<-matrix(nrow=751, ncol=length(files))</div>
<div style="font-family:arial"><br></div><div style="font-family:arial"># loads cumulative probabilities into the matrix</div><div style="font-family:arial">for( i in 1:length(files)) {</div><div style="font-family:arial">
    s[,i]<- data.list[[i]]$V2</div><div style="font-family:arial">}</div><div style="font-family:arial"><br></div><div style="font-family:arial"># matrix to dataframe and proper columns name</div><div style="font-family:arial">
s2 <- as.data.frame(s)</div><div style="font-family:arial">colnames(s2) <- files</div><div style="font-family:arial">s2$dbs <- data.list[[1]]$V1 # add X-axis variable (dB)</div><div style="font-family:arial"><br>
</div><div style="font-family:arial"># melt the data to a long format</div><div style="font-family:arial">df2 <- melt(data = s2, id.vars = "dbs")</div><div style="font-family:arial"><br></div><div style="font-family:arial">
# plot, using the aesthetics argument 'colour'</div><div style="font-family:arial">g<-ggplot(data = df2, aes(x = dbs, y = value, colour = variable)) + geom_line()</div><div style="font-family:arial">plot(g)</div>
</div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif;font-size:small">​<br></div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif;font-size:small"><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">

Next release will have the histograms as well, it's only a few chars extra<br>
code, and the filename as you suggest.<br></blockquote><div> </div><div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif;font-size:small;display:inline">​great<br></div></div><div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif;font-size:small;display:inline">
/r</div></div></div></div></div>