Re: [Audacity-devel] Waveform db
A free multi-track audio editor and recorder
Brought to you by:
aosiniao
From: Martyn S. <mar...@gm...> - 2011-09-27 00:30:22
|
On 23/09/2011 16:29, Dennis wrote: > Hey Martyn, > > thx for your reply. When I see this correctly, you are just "avoiding" > zero values by adding a small number. Oh, come on, read the code! We don't avoid zero by adding a small number, (that wouldn't work), we use an 'if' (line 760, if (value != 0.) {) > This is a simple but effective way to make the calculation of the > logarithm possible for any sample value. No is isn't! If the negative value was equal to the arbitrary 'small number', we'd be stuffed. > But what I don't understand is the result. If you take a sine for > example, you get almost the same waveform as the original. But actually > this can't be because the energy of the signal doesn't get smaller when > the values are negative, otherwise the energy of a sine would be 0. So > it should actually look like y=|sin(x)|. So we remember the sign float sign = (value >= 0 ? 1 : -1); take the log of the absolute value float db = 20.0 * log10(fabs(value)); do some scaling and stick the sign back in again, for the sake of the display value *= sign; and it looks a bit like a sine, for people who don't look at a lot of sinusoids on a low-range log scale. > Do you know why it is not like that? Or is my thinking wrong here? I suggest that you read the code carefully. HTH Martyn > Dennis > > Am 22.09.2011 02:07, schrieb Martyn Shaw: >> Hi Dennis >> >> have a look at >> http://code.google.com/p/audacity/source/browse/audacity-src/trunk/src/TrackArtist.cpp >> about lines 758-771 >> where dBr is the minimal value to plot (I think, have not spent much >> time there this evening)). >> >> You can't really go on scaling to the signal, since one of them >> samples might be at zero, and then you'll crash. Having a minimum >> display level is sensible. We have done that at the same minimal >> level that our meters display at, whether that was a good plan is >> arguable. >> >> HTH >> Martyn >> >> On 21/09/2011 13:56, Dennis wrote: >>> Hello! >>> >>> I'm new to the list and first of all I would like to say that audacity >>> is a great project and I really appreciate your work. >>> As I am working on a university project about psychoacoustical stuff at >>> the moment,I came across the requirement to display an audio signal >>> (pcm) in its waveform but in db fs. >>> The first thing that came to my mind was this: >>> >>> x_db = 20log10(x_old/x_ref) with x_ref = highest possible positive >>> value,for example 2^16 for 16bit pcm. >>> >>> But when I do this,the signal looks kinda weird. >>> Of course this is the result of the different position of the samples. >>> if there is a sample very close to 0 the result is more or less -inf. >>> Now my question is,how are you doing this in audacity in the view mode >>> waveform (db)? >>> I would appreciate any help :-) >>> >>> Dennis >>> >>> >>> ------------------------------------------------------------------------------ >>> All the data continuously generated in your IT infrastructure contains a >>> definitive record of customers, application performance, security >>> threats, fraudulent activity and more. Splunk takes this data and makes >>> sense of it. Business sense. IT sense. Common sense. >>> http://p.sf.net/sfu/splunk-d2dcopy1 >>> _______________________________________________ >>> audacity-devel mailing list >>> aud...@li... >>> https://lists.sourceforge.net/lists/listinfo/audacity-devel >> >> ------------------------------------------------------------------------------ >> All the data continuously generated in your IT infrastructure contains a >> definitive record of customers, application performance, security >> threats, fraudulent activity and more. Splunk takes this data and makes >> sense of it. Business sense. IT sense. Common sense. >> http://p.sf.net/sfu/splunk-d2dcopy1 >> _______________________________________________ >> audacity-devel mailing list >> aud...@li... >> https://lists.sourceforge.net/lists/listinfo/audacity-devel > > > > > ------------------------------------------------------------------------------ > All of the data generated in your IT infrastructure is seriously valuable. > Why? It contains a definitive record of application performance, security > threats, fraudulent activity, and more. Splunk takes this data and makes > sense of it. IT sense. And common sense. > http://p.sf.net/sfu/splunk-d2dcopy2 > _______________________________________________ > audacity-devel mailing list > aud...@li... > https://lists.sourceforge.net/lists/listinfo/audacity-devel |