nan output with fl.timemean~

Issue #65 resolved
Former user created an issue

This patch should output the spectral centroid of a frame. I believe it works fine and tried to add some smoothing to the output but think I have found an error with fl.timemean~ as it produces NaN output. fl.timemedian~ however does what I think it would. Whats going on here?

Comments (7)

  1. Alex Harker repo owner

    Both objects are receiving a nan in the first frame. Because fl.timemedian~ works on a record of the input frames this leaves the memory and is never in the middle (except in the first frame). The timemean~ object aims to be fast by using a high accuracy running sum of the input and so the nan corrupts the output forever. If you place fl.nanfilter~ in from of the mean object then it does what you expect (although it take a little time to reach the average you expect. The latter is also probably not ideal behaviour, and is fixable.

    Need to think about the nan issue, because there are other potential issues (like infs). I think an inf will go away eventually, so probably the time mean object should auto filter nans.. for now you can do it manually.

  2. Alex Harker repo owner

    So you know this is the binFreq subpath with a simplification:

    <pre><code> ----------begin_max5_patcher---------- 745.3ocuW1saaCBEG+ZmmBjubJM0f+r6h8Tr6lllbiIMTYCoFbVpppe1G9Pb VRalMsFOoHif.m+myONli4kEd92KNPk9nuh9Axy6kEddvPcC3crumeU9g0k4 RXZ9qEUUTtxeo4+TzCJX7uukIQ5ezmZX6yK0SAoDH0VJZWtZ8VF+AjfC8Koa Nsbo54RJr99Q5m8upoqUFGKLKcUvRDNMqqgDdGzDrJ.8yiKh2Tw3kTE3h3dK USkZ2HWwD7Op0DMpdyEbbTVA3mh6e7FL1uarWWrn6wRKIGm9a8heG31TtRlW sqjVmqnsns4ka3h5pa91lZ5S8y13Opm2QMAgu+Iu0JDFgSfflDCMIPOB4ShP qr1YHD+dDl5VBVqIXK51JQAEw36ZTnakq0YgnNTlWxjzBGixDHKhfiGljDqH 4fFaXPF4VPpc8FYKB6JZgCifbDLAhy6lDsrwXCSqD2RquzhHtlTQgqhBBBHQ KQQDmfqQs3vLKN1sPqfsmUPacE2BMGBkRLoFYSBY1XrQnkiSwzURePss0wYY l.L9tIUFvBaMBqRms5ntM6xDhYQSBWiapQnUlaokhUQkNFTjLSxPjCdKbPaM LpHN9HKU9CsHyahthWDb3Y0xRm1wV1XrQHVzL7AYthUYPzQLEuhCmDprvViP pvOCo.+ywk7fPHLn+40wQfUE7FvTi7AUm9Rw9KFdtuy3ETfJ3OAxLB6+wAS3 wlQHiUGWOnsF9VhIjOLZ.i6Wx3u8N4Pr1M9k7RJZpW2mDYtMvRzecwBpTw3P fc1bRMy4p6H1pS219nBcoyHpKn0.plek0kJupzj+CRmdcowSSZaTN1Aarugb +CkRbgRoVnTxb.SqTlLKYuw1rQRhmkn1JoCmknN11jJ7DSpH1nT2AySN8kDY KNmbLEZaNykJYJljua2dZs73rAQzkYeT.aqYKgtLtoKTDyultm0OeyH405Bs JckwlZSI3CIQ9lkJzIH7F1wzSsxut3O.C1FH0. -----------end_max5_patcher----------- </code></pre>

  3. Alex Harker repo owner

    There’s now a reset input and lots of other changes so in framelib style don’t do NaNs!

  4. Log in to comment