Hi,
I am trying to continuously plot a sequence of data (from snapshot~), in order to get a running visualization of sound levels. Sampling should occur every 10..100ms and I want to see about 1000 past data points.
My first guess was to use an array of that size and to write data to it via tabwrite, indexed by modulo_counter. Unfortunately, the frequency at which the plot of the array is updated, is way too low (every one second or so). Is there a a way of changing that frequency? If not, are there better alternatives?
Thanks for your help, Matthias
I guess you want to use [env~] instead? Using [snapshot~] has the possibility of returning a stream of zeros even if the signal is quite loud (ie. if it sampled at the zero crossings each time). I Usually use an [env~] feeding into a [-90] which feeds into a vu object...
However, since I have my doubts on the efficiency of the env~ object for such operations, if ANYONE CAN SUGGEST HOW TO IMPLEMENT A ONE-TAP IIR FILTER it may be just as well to be using [snapshot~] in a different arrangement:
[adc~] connects to a [-~] object where the right inlet gets a delayed version of the output of [adc~] (delayed using [delwrite~] and [delread~]). This feeds into a one-tap IIR filter (where the coefficients are [1 0.999] - on the verge of stability but not exactly unity gain, which would cause probs in floating arithmetic). The output of the IIR filter should be the smoothed envelope signal, equivalent to summing all samples between now and "delay-time" ago. Sorry I can't provide this in a patch, I don't have pd here with me, nor can I make an IIR filter out of zexy's [z~] because pd complains about DSP loops (send~ and receive~ usually solve this but they put in huge delay, I think, which ruins the filter).
Sorry for blabbing. If you however just wanted the equivalent of an oscilloscope, I think there is a functioning object in cyclone!
Matt
-=-=-=-=-=-=-=-=-=-=-=-=- http://www.loopit.org/ -=-=-=-=-=-=-=-=-=-=-=-=- ----- Original Message ----- From: "Matthias Blau" blau_m@web.de To: pd-list@iem.at Sent: Friday, October 15, 2004 4:10 PM Subject: [PD] running plot of sampled data
Hi,
I am trying to continuously plot a sequence of data (from snapshot~), in order to get a running visualization of sound levels. Sampling should occur every 10..100ms and I want to see about 1000 past data points.
My first guess was to use an array of that size and to write data to it via tabwrite, indexed by modulo_counter. Unfortunately, the frequency at which the plot of the array is updated, is way too low (every one second or so). Is there a a way of changing that frequency? If not, are there better alternatives?
Thanks for your help, Matthias
PD-list@iem.at mailing list UNSUBSCRIBE and account-management ->
matthew jones schrieb:
I guess you want to use [env~] instead? Using [snapshot~] has the possibility of returning a stream of zeros even if the signal is quite loud (ie. if it sampled at the zero crossings each time). I Usually use an [env~] feeding into a [-90] which feeds into a vu object...
However, since I have my doubts on the efficiency of the env~ object for such operations, if ANYONE CAN SUGGEST HOW TO IMPLEMENT A ONE-TAP IIR FILTER it may be just as well to be using [snapshot~] in a different arrangement:
Well, I personally have snapshot~ preceeded by lp1_t~ from the iemlib, which implements a first order low pass of a given time constant. So a simple sound level meter would just be squaring the incoming signal, feeding it to lp1_t~ (time constants 125ms for "FAST", 1000ms for "SLOW"), and sampling the result with snapshot~.
--Matthias
Hi Matthias,
This is fixed (I hope) in 0.38, which is out in a test version.
cheers Miller
On Fri, Oct 15, 2004 at 05:10:32PM +0200, Matthias Blau wrote:
Hi,
I am trying to continuously plot a sequence of data (from snapshot~), in order to get a running visualization of sound levels. Sampling should occur every 10..100ms and I want to see about 1000 past data points.
My first guess was to use an array of that size and to write data to it via tabwrite, indexed by modulo_counter. Unfortunately, the frequency at which the plot of the array is updated, is way too low (every one second or so). Is there a a way of changing that frequency? If not, are there better alternatives?
Thanks for your help, Matthias
PD-list@iem.at mailing list UNSUBSCRIBE and account-management -> http://iem.at/cgi-bin/mailman/listinfo/pd-list