Damp streaming values?
Date | 2016-03-06 16:24 |
From | Tobiah |
Subject | Damp streaming values? |
Looking at a stream of values from a phone's accelerometer, I can see that they jitter about quite a bit. If I were to control some aspect of a sound, pitch for instance, I would expect the result to sound the same way - rather erratic. What is the usual way to 'dampen' those values so that they follow a smooth curve? I'd expect to trade off responsiveness for smoothness. I actually need the algorithm (computer code really) rather than a reference to a csound opcode. I suppose it has to do with collecting and averaging the values ahead of time, but I thought I'd ask about it since there must have been a lot of work done on this sort of thing. Thanks! Tobiah Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here |
Date | 2016-03-06 16:58 |
From | Victor Lazzarini |
Subject | Re: Damp streaming values? |
Lowpass filtering does not do the job? Victor Lazzarini Dean of Arts, Celtic Studies, and Philosophy Maynooth University Ireland > On 6 Mar 2016, at 16:24, Tobiah |
Date | 2016-03-06 17:26 |
From | Tobiah |
Subject | Re: Damp streaming values? |
It would, I'm sure. I was hoping for a bit of code I could put in my program. At least I have a better term to Google now! Thanks, Tobiah On 3/6/2016 8:58 AM, Victor Lazzarini wrote: > Lowpass filtering does not do the job? > > Victor Lazzarini > Dean of Arts, Celtic Studies, and Philosophy > Maynooth University > Ireland > >> On 6 Mar 2016, at 16:24, Tobiah |
Date | 2016-03-06 18:02 |
From | Steven Yi |
Subject | Re: Damp streaming values? |
You might want to look at the port opcode's source: https://github.com/csound/csound/blob/develop/OOps/ugens5.c The first two functions, porset() and port(), are the code. It's essentially the same as a lowpass filter: https://ccrma.stanford.edu/~jos/filters/Definition_Simplest_Low_Pass.html If you step through the code mentally, it should make sense how it smooths out values over time. On Sun, Mar 6, 2016 at 12:26 PM, Tobiah |
Date | 2016-03-06 18:17 |
From | Victor Lazzarini |
Subject | Re: Damp streaming values? |
Smoothing can be done with port or tone, which are effectively the same filter but with different means of controlling the amount of smoothing. Victor Lazzarini Dean of Arts, Celtic Studies, and Philosophy Maynooth University Ireland > On 6 Mar 2016, at 17:26, Tobiah |
Date | 2016-03-07 08:19 |
From | Iain McCurdy |
Subject | Re: Damp streaming values? |
If you suspect that there are some random, nonsense values mixed in data stream, you might also consider median filtering before doing the lowpass filtering. > Date: Sun, 6 Mar 2016 18:17:24 +0000 > From: Victor.Lazzarini@NUIM.IE > Subject: Re: [Csnd] Damp streaming values? > To: CSOUND@LISTSERV.HEANET.IE > > Smoothing can be done with port or tone, which are effectively the same filter but with > different means of controlling the amount of > smoothing. > > Victor Lazzarini > Dean of Arts, Celtic Studies, and Philosophy > Maynooth University > Ireland > > > On 6 Mar 2016, at 17:26, Tobiah <toby@TOBIAH.ORG> wrote: > > > > It would, I'm sure. I was hoping for a bit > > of code I could put in my program. At least > > I have a better term to Google now! > > > > Thanks, > > > > Tobiah > > > >> On 3/6/2016 8:58 AM, Victor Lazzarini wrote: > >> Lowpass filtering does not do the job? > >> > >> Victor Lazzarini > >> Dean of Arts, Celtic Studies, and Philosophy > >> Maynooth University > >> Ireland > >> > >>> On 6 Mar 2016, at 16:24, Tobiah <toby@TOBIAH.ORG> wrote: > >>> > >>> Looking at a stream of values from a phone's accelerometer, > >>> I can see that they jitter about quite a bit. If I were to > >>> control some aspect of a sound, pitch for instance, I would > >>> expect the result to sound the same way - rather erratic. > >>> > >>> What is the usual way to 'dampen' those values so that they > >>> follow a smooth curve? I'd expect to trade off > >>> responsiveness for smoothness. I actually need the > >>> algorithm (computer code really) rather than a reference to > >>> a csound opcode. I suppose it has to do with collecting > >>> and averaging the values ahead of time, but I thought I'd > >>> ask about it since there must have been a lot of work done > >>> on this sort of thing. > >>> > >>> > >>> Thanks! > >>> > >>> > >>> Tobiah > >>> > >>> Csound mailing list > >>> Csound@listserv.heanet.ie > >>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND > >>> Send bugs reports to > >>> https://github.com/csound/csound/issues > >>> Discussions of bugs and features can be posted here > >> > >> Csound mailing list > >> Csound@listserv.heanet.ie > >> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND > >> Send bugs reports to > >> https://github.com/csound/csound/issues > >> Discussions of bugs and features can be posted here > > > > Csound mailing list > > Csound@listserv.heanet.ie > > https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND > > Send bugs reports to > > https://github.com/csound/csound/issues > > Discussions of bugs and features can be posted here > > Csound mailing list > Csound@listserv.heanet.ie > https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND > Send bugs reports to > https://github.com/csound/csound/issues > Discussions of bugs and features can be posted here |