# [PD] [array quantile] explanation

Roman Haefeli reduzent at gmail.com
Mon Oct 28 22:24:58 CET 2019

On Mon, 2019-10-28 at 13:50 -0700, Miller Puckette wrote:
> Yes

Cool.

>  but not with perfect accuracy.

I don't mind.

> You have to make a histogram of the
> samples (choosing some bin size;

Forgive my ignorance, but how can I create a histogram out of an
unordered set of samples? Do I just iterate over all samples "manually"
and count up the bin depending on in which bin it falls?

>  that's what limits accuracy) and then
> array qualtile will do exactly what you're looking for.

So [array quantile] is meant to be used on a histogram of the raw data,
as opposed to the raw data directly? That's why it returns something
that looks like an index, namely the index of the bin of your
histogram?

> I use it for instance to do automatic level setting.  I ask for the
> 90%
> quamtile of env~ output (in dB) over a period of 10 seconds or so.

Thanks, this I understand and is very similar to the stuff I'm
interested in.

Roman

> On Sun, Oct 27, 2019 at 02:46:29PM +0100, Roman Haefeli wrote:
> > Hi all
> >
> > I am having difficulty understanding the output of [array
> > quantile].
> > From the help-file it seems it expects an input between 0 and 1,
> > and
> > also the values in the array should be in that range. The output
> > seems
> > to be in the range between 0 and <array-size> - 1. But what does it
> > mean?
> >
> > Can I use this somehow to achieve this:
> >
> > I have n samples and input q while 0 < q < 1. I would like to know
> > the
> > value x for which q*100 percent samples are smaller than x and (1-
> > q)*100 percent bigger.
> >
> > Thanks,
> > Roman
> >
> >
> >
>
>
>
> > _______________________________________________
> > Pd-list at lists.iem.at mailing list
> > UNSUBSCRIBE and account-management ->
> > https://lists.puredata.info/listinfo/pd-list
>
>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: This is a digitally signed message part
URL: <http://lists.puredata.info/pipermail/pd-list/attachments/20191028/e5af4c83/attachment.sig>