<div dir="ltr"><br><div class="gmail_extra"><br><br><div class="gmail_quote">On Sat, Mar 2, 2013 at 12:28 PM, ronni montoya <span dir="ltr">&lt;<a href="mailto:ronni.montoya@gmail.com" target="_blank">ronni.montoya@gmail.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi, Charles, my  idea in using shannons entropy  is to measure self<br>
generated songs.<br>
<br>
For example if you have a patch that generate sound structures using a<br>
generative rules  it would be nice to measure that sound structure and<br>
use that measurement to evolve the rules that generate that sound<br>
structure in order to create more complex structures for example.<br></blockquote><div><br></div><div>Cool!  That&#39;s a great idea!<br></div><div> <br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

But how to measure a sound structure using shannons entropy?<br></blockquote><div><br></div><div>I guess I&#39;m interested because it&#39;s a really tricky problem to define.  There&#39;s no clear mathematical formula to apply.  I&#39;m happy to discuss how you might do it, but I don&#39;t know if it&#39;s been done correctly already--or if there&#39;s some articles about entropy definitions for signals.<br>
<br></div><div>The important thing is if it captures the properties of the signal you care about.  If you have no math to start from--describe it verbally first.<br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

I was experimenting taking only short pieces of a larger sound ,<br>
converting each  piece into a string and evaluate the shannon entropy<br>
of each string.<br>
<br>
In this case entropy varies with time and what i am interested in are<br>
the entropy trayectories.<br>
<br>
You can plot this trayectories and compare different trayectories from<br>
different songs .<br>
<br>
More complex sound structures should have more complex trayectories ,<br>
not chaotic , not periodic but more complex . The problem for me  is<br>
that  i need to plot or visualize the entropy trayectories (values) in<br>
order to see the complexity of a sound structure.<br>
<br>
It would be nice to find a way to automate , for example find a way of<br>
measure different trayectories algorithmically and that computer can<br>
tells automatically which one is more complex.<br>
<br>
Do you have an idea?<br></blockquote><div><br></div><div>Martin&#39;s suggestion about spectral distribution is good.<br></div><div>Autocorrelation might also have some good properties--the signal has less entropy when it is more self-similar.  This also starts to sound like fractal dimension, which can be calculated by a box-muller method.<br>
</div><div><br> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
I have a question, why do you say it would be meaning less to convert<br>
signal into symbols?<br></blockquote><div><br></div><div>It may be meaningless if you choose a bad rule to convert them into symbols.  Here&#39;s an example meaningless rule:<br></div><div>Convert ranges of signal values into discrete values:<br>
</div><div>-1 to -0.99 -&gt; -99<br></div><div>-0.99 to -0.98 -&gt; 98<br>...<br></div><div>-0.01 to 0 -&gt; 0<br></div><div>0 to 0.01 -&gt; 1<br>...<br><br></div><div>Then, if you had a signal and you multiplied it by 10, the entropy measured from the discrete values would increase.  However--this does not mean the signal has more information.  It just becomes louder.<br>
</div><div><br></div><div>If you decide to convert the signal into symbols, it has to be a meaningful rule.  Otherwise, you might not be measuring the thing you meant to.<br></div><div> <br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

Other way i was experimenting is using this with video and images, for<br>
example converting an image into a array of characters iterating over<br>
all the pixels an getting the color of each pixel , then converting<br>
those values into characters and then evaluating the shannons entropy<br>
of each image.<br>
<br>
I would like to expand this and use it also for self generated 3d<br>
structure, but im still thinking about this.<br>
<br>
<br>
cheers.<br>
<br>
<br>
R.<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
can you please explain me why do you say it would be meaningless?<br>
<div class="im"><br>
&quot;That would do something, but may be meaningless--It would be just one<br>
way of converting the signal from real numbers to a discrete set of<br>
things/symbols that is easier to calculate.&quot;<br>
<br>
<br>
<br>
</div>2013/2/27, Charles Z Henry &lt;<a href="mailto:czhenry@gmail.com">czhenry@gmail.com</a>&gt;:<br>
<div class="im">&gt; If you took the fft squared magnitude, perfectly noisy data should have a<br>
&gt; chi-squared distribution in each bin (I think).  If you assumed that model<br>
&gt; and calculated the parameters of the distribution on each block, you&#39;d find<br>
&gt; out how much information is in each of those peaks relative to the assumed<br>
&gt; distribution and just add it up.<br>
&gt;<br>
&gt; What ever algorithm you choose probably needs to pass some &quot;common sense&quot;<br>
&gt; tests like what you mention Martin, noise has more entropy than a sine<br>
&gt; wave.  Also, if you take noise and just apply a comparison &gt; 0, you get a<br>
&gt; signal with less entropy.<br>
&gt;<br>
&gt; On Wed, Feb 27, 2013 at 7:54 AM, Martin Peach<br>
&gt; &lt;<a href="mailto:martin.peach@sympatico.ca">martin.peach@sympatico.ca</a>&gt;wrote:<br>
&gt;<br>
&gt;&gt; Why not do an FFT and measure the variance of the channels?<br>
&gt;&gt; For instance white noise has maximum entropy and all the bins of its FFT<br>
&gt;&gt; will be more or less the same, while a sine wave has low entropy and one<br>
&gt;&gt; bin will be much larger than the others.<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt; Martin<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt; On 2013-02-27 08:40, ronni montoya wrote:<br>
&gt;&gt;<br>
&gt;&gt;&gt; Hi, why is not possible? Instead of analysing the real time value of<br>
&gt;&gt;&gt; the signal , maybe i can have  a memory or buffer  that store the a<br>
&gt;&gt;&gt; piece of signal ( groups of samples) from time to time and then<br>
&gt;&gt;&gt; analize that group of values.<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; Maybe it can convert that group of values into a string and then:<br>
&gt;&gt;&gt;<br>
</div>&gt;&gt;&gt; <a href="http://www.shannonentropy." target="_blank">http://www.shannonentropy.</a>**<a href="http://netmark.pl/calculate" target="_blank">netmark.pl/calculate</a>&lt;<a href="http://www.shannonentropy.netmark.pl/calculate" target="_blank">http://www.shannonentropy.netmark.pl/calculate</a>&gt;<br>

<div><div class="h5">&gt;&gt;&gt;<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; Other idea : ive seen using shannon entropy for calculating complexity<br>
&gt;&gt;&gt; in terms of spatial configuration.<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; Maybe other option could be converting my signal into image for<br>
&gt;&gt;&gt; example using similarity matrix and then analyze that image to get<br>
&gt;&gt;&gt; entropy values.<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; cheers<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; R<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; 2013/2/26, Charles Z Henry &lt;<a href="mailto:czhenry@gmail.com">czhenry@gmail.com</a>&gt;:<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt; Hi Ronni<br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt; How do you mean to do it?<br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt; Shannon entropy is not an independent measurement--the information in a<br>
&gt;&gt;&gt;&gt; observation is relative to the distribution of all it&#39;s possible<br>
&gt;&gt;&gt;&gt; values.<br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt; If I just take one sample and it&#39;s evenly distributed between -0.98 and<br>
&gt;&gt;&gt;&gt; 1<br>
&gt;&gt;&gt;&gt; and it&#39;s quantized in 0.02 increments (to make the math easier), then<br>
&gt;&gt;&gt;&gt; the<br>
&gt;&gt;&gt;&gt; information of any value observed is:<br>
&gt;&gt;&gt;&gt; -0.01*log(0.01)<br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt; Then--if I had a signal that&#39;s N samples long, I have N times as much<br>
&gt;&gt;&gt;&gt; information.  Or perhaps think of it as a rate of information.<br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt; But for real numbers and continuous distributions, this doesn&#39;t work.<br>
&gt;&gt;&gt;&gt;  The<br>
&gt;&gt;&gt;&gt; information in a single observation diverges.  So, doing that with<br>
&gt;&gt;&gt;&gt; floating<br>
&gt;&gt;&gt;&gt; point numbers is not practical.<br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt; You often see Shannon entropy describing digital signals.  If the<br>
&gt;&gt;&gt;&gt; signal<br>
&gt;&gt;&gt;&gt; just switches between 0 and 1, we can generate a distribution of the<br>
&gt;&gt;&gt;&gt; data<br>
&gt;&gt;&gt;&gt; and see what the probability is empirically.  The entropy of each new<br>
&gt;&gt;&gt;&gt; sample is relative to the distribution.  Likewise, then if you know the<br>
&gt;&gt;&gt;&gt; maximum rate of switching, you can figure out the maximum rate of<br>
&gt;&gt;&gt;&gt; information in the signal.<br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt; Just a few thoughts...<br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt; Chuck<br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt; On Tue, Feb 26, 2013 at 6:09 AM, ronni montoya<br>
</div></div>&gt;&gt;&gt;&gt; &lt;<a href="mailto:ronni.montoya@gmail.com">ronni.montoya@gmail.com</a>&gt;**wrote:<br>
<div class="im">&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;  Hi , i was wondering if anybody have implemented the shannon entropy<br>
&gt;&gt;&gt;&gt;&gt; function in pd?<br>
&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt; Do anybody have tried measuring entropy of a signal?<br>
&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt; cheeers<br>
&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt; R.<br>
&gt;&gt;&gt;&gt;&gt;<br>
</div>&gt;&gt;&gt;&gt;&gt; ______________________________**_________________<br>
<div class="im">&gt;&gt;&gt;&gt;&gt; <a href="mailto:Pd-list@iem.at">Pd-list@iem.at</a> mailing list<br>
&gt;&gt;&gt;&gt;&gt; UNSUBSCRIBE and account-management -&gt;<br>
</div>&gt;&gt;&gt;&gt;&gt; <a href="http://lists.puredata.info/**listinfo/pd-list" target="_blank">http://lists.puredata.info/**listinfo/pd-list</a>&lt;<a href="http://lists.puredata.info/listinfo/pd-list" target="_blank">http://lists.puredata.info/listinfo/pd-list</a>&gt;<br>

&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt; ______________________________**_________________<br>
&gt;&gt;&gt; <a href="mailto:Pd-list@iem.at">Pd-list@iem.at</a> mailing list<br>
&gt;&gt;&gt; UNSUBSCRIBE and account-management -&gt; <a href="http://lists.puredata.info/**" target="_blank">http://lists.puredata.info/**</a><br>
&gt;&gt;&gt; listinfo/pd-list &lt;<a href="http://lists.puredata.info/listinfo/pd-list" target="_blank">http://lists.puredata.info/listinfo/pd-list</a>&gt;<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt;<br>
&gt;&gt;<br>
&gt;<br>
</blockquote></div><br></div></div>