Spectral Analysis math
Forum rules
This board is ONLY for general feedback and discussion about Audacity 2.X.
If you require help, or think you have found a "bug", please post on the forum board relevant to your operating system.
Windows
Mac OS X
GNU/Linux and Unix-like
This board is ONLY for general feedback and discussion about Audacity 2.X.
If you require help, or think you have found a "bug", please post on the forum board relevant to your operating system.
Windows
Mac OS X
GNU/Linux and Unix-like
Spectral Analysis math
Hello,
I'm sure this question has been answered already but I cannot fionf it... So please can you tell me the following thing.
I'am using version 2.03
And I plot the Spectrum Analysis using Blackman-Harris Windows, 4096 samples, 8000Hz sampling rate over 1sec resord.
I would like to know what is the mathematical formula that give the result?
I have exported the track into wav format, read it with Mathematica 9 using
20*Log10[PeriodogramArray[data,4096,4096,BlackmanHarrisWindow]]
but the plot does not match the Audacity one.
I have tried diffrent FFT parameter definition wo success.
SO please can someone help me?
Thanks
I'm sure this question has been answered already but I cannot fionf it... So please can you tell me the following thing.
I'am using version 2.03
And I plot the Spectrum Analysis using Blackman-Harris Windows, 4096 samples, 8000Hz sampling rate over 1sec resord.
I would like to know what is the mathematical formula that give the result?
I have exported the track into wav format, read it with Mathematica 9 using
20*Log10[PeriodogramArray[data,4096,4096,BlackmanHarrisWindow]]
but the plot does not match the Audacity one.
I have tried diffrent FFT parameter definition wo success.
SO please can someone help me?
Thanks
Re: Spectral Analysis math
The peak amplitude is normalized such that a 0 dB sine wave will show (approximately) 0 dB.
9/10 questions are answered in the FREQUENTLY ASKED QUESTIONS (FAQ)
Re: Spectral Analysis math
I have just generate sin 440Hz freq. with Amplitude=1 and with Blackman-Harris window 1024 sample size I get 0dB at peak value. Oksteve wrote:The peak amplitude is normalized such that a 0 dB sine wave will show (approximately) 0 dB.
By the way is the windowing follow Welch rule with 50% overlapping ? (ie. 512 overlap between consecutive windows)?
Re: Spectral Analysis math
Do you mean also that thesteve wrote:The peak amplitude is normalized such that a 0 dB sine wave will show (approximately) 0 dB.
spectrum 20*Log10[PeriodogramArray[data,4096,2048,BlackmanHarrisWindow]]
is shifted such that the max is set to 0dB even if "data" are not from a sin func with amplitude = 1 ???
Re: Spectral Analysis math
I think that it is (but not for "Rectangular" window.)jean-eric wrote:By the way is the windowing follow Welch rule with 50% overlapping ? (ie. 512 overlap between consecutive windows)?
No. The "shift" (normalization) is such that a sine wave with amplitude = 1 (0 dB) will be displayed as (about) 0 dB. The amount of shift is the same regardless of the actual audio content.jean-eric wrote:Do you mean also that the
spectrum 20*Log10[PeriodogramArray[data,4096,2048,BlackmanHarrisWindow]]
is shifted such that the max is set to 0dB even if "data" are not from a sin func with amplitude = 1 ???
The spectrum shows the sum of all selected channels / tracks (the track data is mixed down to one mono audio selection prior to analysis).
9/10 questions are answered in the FREQUENTLY ASKED QUESTIONS (FAQ)
Re: Spectral Analysis math
Ok
But does this shift is independant of sampling rate AND/OR sample length ?
I get -24dB for 8000Hz sampling rate, 2048 sample length and Blackman-Harris windowing & 50% overlaping.
But does this shift is independant of sampling rate AND/OR sample length ?
I get -24dB for 8000Hz sampling rate, 2048 sample length and Blackman-Harris windowing & 50% overlaping.
-
Robert J. H.
- Posts: 3633
- Joined: Thu May 31, 2012 8:33 am
- Operating System: Windows 10
Re: Spectral Analysis math
It may be that the blackman-harris Windows have different coefficients.
The General structure is
A - B*cos2 + C*cos4 (blackman)
The FLAC library uses the following:
It is called Blackman-Harris 4term 92 dB sidelob, so it would actually have 4 coefficients.
Do the more trivial Windows match?
The General structure is
A - B*cos2 + C*cos4 (blackman)
The FLAC library uses the following:
Code: Select all
window[n] = (0.35875f - 0.48829f * cos(2.0f *PI * n / N) + 0.14128f * cos(4.0f * PI * n / N) - 0.01168f * cos(6.0f * PI * n / N));Do the more trivial Windows match?
Re: Spectral Analysis math
For implementation details, please refer to Spectrum.cpp in the source code http://code.google.com/p/audacity/sourc ... ectrum.cpp
9/10 questions are answered in the FREQUENTLY ASKED QUESTIONS (FAQ)
Re: Spectral Analysis math
Thanks a lot I have dived to the code and now I'm looking for thesteve wrote:For implementation details, please refer to Spectrum.cpp in the source code http://code.google.com/p/audacity/sourc ... ectrum.cpp
WindowFunc
and
PowerSpectrum
definition but I cannot managed to catch them in SVN source code ???
Re: Spectral Analysis math
ha! I find my way in FFT.h/cpp sorry for previous post...steve wrote:For implementation details, please refer to Spectrum.cpp in the source code http://code.google.com/p/audacity/sourc ... ectrum.cpp