Re: [Audacity-devel] Question about spectral analysis in Audacity
A free multi-track audio editor and recorder
Brought to you by:
aosiniao
From: Martyn S. <mar...@go...> - 2009-07-01 22:38:35
|
Gale Andrews wrote: > | From Martyn Shaw <mar...@go...> > | Wed, 01 Jul 2009 01:47:37 +0100 ... >> The scale of 'Spectrum' stays the same as you change the 'Size' >> parameter (13.4.5 of http://www.nrbook.com/a/bookcpdf/c13-4.pdf >> refers). I didn't adjust the others as I'm not sure what they do and >> if they are 'right' or 'wrong' > > Adobe9 does not seem capable of opening that PDF here (missing > components) so can you explain what you mean for the stupid (me)? I never did like pdf files. Suggest that you get a reader capable of opening it, or get the rest of the components you need. Works fine here in Adobe Reader 8.0. The book is excellent, if technical. I'll try in two sentences, but this isn't the place for a long explanation: If you generate a sine wave and look at it's amplitude with different window lengths, you'll get about the same value since it 'always' falls in one frequency bin. If you have a random signal then you can expect the amplitude to fall by 3dB for every doubling of the FFT size, since the bins are half the size and so contain only half the energy. > If I change size from 128 to 16384 the increments of both scales > change (except that for frequency, if I use the linear option). Again related to the size of the bins. More bins, greater resolution. And if > I look at a particular peak, the dB value is much lower with the > largest size (is that expected)? Depends on signal, see above. > Did you make progress trying to make the dB values displayed more > like those in 1.2.6 where the low frequencies are close to -0 dB? > Doing an identical plot of the same audio in 1.2.6 and 1.3.8 still > shows about -30 dB less in 1.3.8. Have we got a good explanation > when we are asked about this? Normalisation. Read the book. >>> On my XP box (2.6 GHz 1 GB RAM) >>> if I select that much or longer it takes 10 -18 seconds before anything >>> happens. If the audio is over 237.8, the "anything" is the length warning, >>> after which the Spectrum displays at once. >> 'tis less than a second here (for a 1hr 15s file). I get the warning, >> then the spectrum, as anticipated. >> >> Are you still seeing this? > > No, not in my recent ANSI build using wx 2.8.10. The wait is about > 3 - 5 seconds for an hour long file (FF is running as it was before and > it has about 40 tabs open as usual, but if I had the upcoming local > Manual open, FF would have to be running anyway). I got the results > I gave (10 - 18 seconds delay) in my 2.8.9 build from yesterday, and > that was both with the XP machine several hours after boot and on a > fresh boot (made no difference). Is that Windows variability again? > I will try on the Vista machine too. > > But anyway, wouldn't you suppose on slow machines with little RAM > that the waiting time would exceed that where we usually give an . > effect progress dialogue? Our nominal minimum system requirements > for Windows XP and earlier are still only 64 - 128 MB RAM, 300 MHz. We should up that, perhaps. A progress dialogue would be good, but low priority (for me at least). > Also I've found what seems to be un-necessary window-switching > behaviour (is in 1.3.7 as well): > > 1. Open Audacity and generate a tone > 2. Plot Spectrum (close it or leave it open) > 3. File > New (you will have to task switch or click on the > correct section of the Taskbar button to see the new > window, due to another bug we have) > 4. Import an audio file (because easy to see the difference) > 5. Plot Spectrum and it appears with the plot of the audio > file, but the window switches to that for the tone, which > is confusing. So it does. I guess these are both on Release_Checklist for our students to take a hit at? TTFN Martyn > Thanks > > > Gale > > >>>> Michael Chinen wrote: >>>> Are you trying to take THE spectrum of a 60 second segment (with one >>>> FFT,) or are you interested in finding the average spectrum by taking >>>> many small FFTs over the duration and averaging it out? These may >>>> yield similar results but the process is very different. >>>> >>>> You probably know this, but I just want to point out that in O(n log >>>> n), n is in samples, not seconds, so each second adds a big factor to >>>> the running time of the algorithm. I would be willing to bet you >>>> aren't going to be able to finish a FFT of size 44100*60 for a very >>>> long time. >>>> >>>> The Plot Spectrum command appears to take many small ones and average >>>> them, since you can select the FFT size in the popup window, with a >>>> maximum of 16384. If that's the case I'm not sure why it has a 24 >>>> second limit either. >>>> >>>> >>>> Michael >>>> >>>> >>>> >>>> On Fri, Jul 18, 2008 at 2:24 PM, Julien F. Vanegue <jf...@ce...> wrote: >>>>>> Computing the spectrum requires all samples to be in memory at once >>>>>> and costs n*log(n), so operating on many seconds of sound is unusual. >>>>>> If the spectrum is very stable, e.g. a steady tone, then you probably >>>>>> don't need to look at many seconds to extract the spectral >>>>>> information. If the spectrum is changing, then grabbing the spectrum >>>>>> of a large interval is in some sense going to smear out or average the >>>>>> overall energy, so again, it's not so useful. Finally, there are >>>>>> numerical issues to worry about when doing a very large Fourier >>>>>> transform to compute the spectrum. What might be useful is to compute >>>>>> a sequence of short-term spectra and average their magnitudes to get a >>>>>> long-term average spectrum. Audacity could do this in principle, but >>>>>> the user would have to provide more parameters and confirm that he/she >>>>>> really wants to do an expensive computation on a long segment of audio. >>>>> Alright. So if I understand well, there is no hidden reason to forbid >>>>> spectral analysis on >>>>> a larger sample. O(n log n) is a very reasonable complexity for a >>>>> fourier transform and >>>>> I am ready to wait some more seconds to compute the spectrum for 60 >>>>> seconds instead >>>>> of 24 seconds. I will modify the audacity source code for my own needs >>>>> in that direction. >>>>> >>>>> Thanks for your quick answer >>>>> >>>>> Julien >>> >>> >>> ------------------------------------------------------------------------------ >>> _______________________________________________ >>> audacity-devel mailing list >>> aud...@li... >>> https://lists.sourceforge.net/lists/listinfo/audacity-devel >>> >> ------------------------------------------------------------------------------ >> _______________________________________________ >> audacity-devel mailing list >> aud...@li... >> https://lists.sourceforge.net/lists/listinfo/audacity-devel > > > > ------------------------------------------------------------------------------ > _______________________________________________ > audacity-devel mailing list > aud...@li... > https://lists.sourceforge.net/lists/listinfo/audacity-devel > |