Hey!
I'm fairly new to Pure Data, and I'm having a hard time figuring how to extract the envelope of a signal.
Now I'm simply outputting the signal to an array, but I really wanted was to extract the envelope and plot it.
Anyone can help please?
Envelope of a signal
Hey!
I'm fairly new to Pure Data, and I'm having a hard time figuring how to extract the envelope of a signal.
Now I'm simply outputting the signal to an array, but I really wanted was to extract the envelope and plot it.
Anyone can help please?
Too woofing easy!.....
Should have named my example file dog.wav instead of a.wav! 
Thanks for the reply!
I tried using that, but unfortunately what I get is not what I need.
I'm using this patch, that computes a Fourier Transform so I can analyze the frequencies of an incoming signal (the sound received on the microphone to be exact), but I want the envelope of the signal, not the signal itself.
Here goes a part of my patch, the results seem correct, I just wanted the envelope now.
Any help will be greatly appreciated, I feel I'm missing something :/
fft_hz.pd
Oh btw, as I'm using libpd, I can't (as a requirement) use any externals, so no help with tabletool, but going to check it out for future projects! 
Hi Pedro,
but I want the envelope of the signal, not the signal itself.
I don't understand. What [env~] outputs is the envelope of the signal as far as I know.
Also, I found this about envelope followers (from Miller's book): http://msp.ucsd.edu/techniques/v0.11/book-html/node158.html
See if there is anything there that can help you.
Cheers,
Gilberto
Yeah, I know that, but when I try to use [env~] on my values and try to plot them, I only get one value (which makes sense, since it only outputts one value).
What I want is something like this in the second plot (sorry for the bad drawing):

I want to plot and be able to save the envelope of the signal like this.
Maybe Im confusing envelope with something else.....
Any help is appreciated, thanks guys!
Hi Pedro,
I do understand what you want, but I thought that the [env~] does exactly that. Of course it does only for the current signal arriving to it. So my idea was to save [env~]'s output to a table and then plot it, and that's what I tried with that patch I posted above.
Cheers,
Gilberto
Oh I get it now! Makes sense!
Any idea on how to save those values to a table?
I can't seem to get the grasp on how Pure Data handles arrays and tables :/
I can't use externals because I'm going to use the patch with libpd...
Thanks again! @gsagostinho
Any idea on how to save those values to a table?
I did it by using [tabletool] but of course you can patch it yourself. The logic I use is as follows:
Cheers,
GIlberto
Hm thanks again @gsagostinho! got it working but I don't think this is what I need.
As I showed on the image, I want to do the envelope of a signal after I used FFT on it (now I have an array that tells me for each moment in time what are the frequencies that compose the signal).
And this is right, as I tested it already.
Now I just wanted to use those values and envelope them...
@PedroPT Hello Pedro, I will post my (not so woofing easy) post again then...
https://en.wikipedia.org/wiki/Envelope_detector
the calculation can most likely be done using [expr~] or reading the table into [expr]
David.
@whale-av Those equations are related to FM and AM only and are not a general case, so you can't just use [expr~] with them and apply any signal to it.
@PedroPT I thought you had written that you just wanted to visualize the envelope, not use it later. Maybe you can store the envelope in a table, and when necessary recall their values from this table and feed a [line~] into which, and multiply it by the signal. For that you have to make sure that you have amplitude between 0 and 1 ([env~] actually outputs RMS dB). But maybe there is an easier way to do what you want and I am missing it altogether...
I want to send the values of the signal (as I'm doing now, but now I only have the FFT results, with frequencies distribution) to libpd and present them on an Android tablet.
So far this I have right, but I wanted to send the envelope instead of the FFT values...
But thanks anyway @gsagostinho, @whale-av !!
Pedro, why don't you try posting your problem on the pd mailling list? Those guys there know a lot about audio programming and they may be able to help you better than I can.
Oops! Looks like something went wrong!