right - energy is what I am looking for - did not not how to phrase
it..
> Loudness is a quite subjective measure, largely dependant on the human
> auditory system and the speaker setup. However, it is closely related to the
> energy of the signal and is quite unrelated to it's amplitude. I suggest you
> read about sound-pressure levels, dB's, SPL's, sones and phons.
so from the reading that I have done with respect to computing the
energy of the
signal, I have concluded (naively) that the output of the my FFT is
incorrect with respect
to computing energy.
Based on what you said previously:
> Loudness is a quite subjective measure, largely dependant on the human
> auditory system and the speaker setup. However, it is closely related to the
> energy of the signal and is quite unrelated to it's amplitude.
So, the contents of mag[] array could not be used to compute the
accumulate energy of the signal.
If I compute the energy I would need to:
wouldn't I need to change the output of my FFT to return the frequency
for each sample and not
the magnitude?
Would it be correct for me to first compute the FFT of the signal and
return a frequency[] for all the samples in the signal and this would
be acheived by doing the
following:
for (int i=0; i< NUMBER_SAMPLES/2; i++)
{
frequency[i] = (float) (frequency[i] * sampleRate) /
(float)transformLength;
}
and then pipe the frequency[] result to getEnergy() to compute the
energy of the signal?
//signalEnergy = Sigma (|x(n)^2|) from n -> n-1 of the samples in the
Signal.
public float getEnergy()
{
float eSignal, eSignalTemp;
eSignal = 0.0f;
eSignalTemp = 0.0f;
for (int i=0; i< NUMBER_SAMPLES/2; i++)
{
eSignalTemp = (float) (frequency[i]*frequency[i]);
eSignal += eSignalTemp;
}
// eSignal represents the total energy of the signal
return eSignal;
}
thank you for all your help on this - I sometimes wish that university
professors were sometimes
a bit more approachable - As for my professor, I think he is somewhere
between Earth and Mars...
angelo
Boudewijn Dijkstra - 06 May 2005 14:55 GMT
> Based on what you said previously:
>> Loudness is a quite subjective measure, largely dependant on the
[quoted text clipped - 8 lines]
> wouldn't I need to change the output of my FFT to return the frequency
> for each sample and not the magnitude?
Samples do not have a frequency. Instead frequencies (or frequency bands)
have samples (consisting of amplitude and phase).
> //signalEnergy = Sigma (|x(n)^2|) from n -> n-1 of the samples in the
> Signal.
What does x represent?
> thank you for all your help on this - I sometimes wish that university
> professors were sometimes a bit more approachable - As for my professor, I
> think he is somewhere between Earth and Mars...
Indeed, some of them seem to have forgotten that there is a difference between
teaching and divulging a truckload of (loosely related) facts.
beat - 11 May 2005 18:26 GMT
<snip>
> > //signalEnergy = Sigma (|x(n)^2|) from n -> n-1 of the samples in the
> > Signal.
>
> What does x represent?
with respect to the above formula to compute the signalEnergy - x
would represent
the byte->float representation of the signal prior to entering the fft.
another question about computing the signal energy:
do I compute the signal energy prior to transforming the signal via
fft...
or would I perform the fft on the signal and then compute signalEnergy
based on the output of the fft
> > //signalEnergy = Sigma (|x(n)^2|) from n -> n-1 of the samples in the
> > Signal.
angelo
> > thank you for all your help on this - I sometimes wish that university
> > professors were sometimes a bit more approachable - As for my professor, I
> > think he is somewhere between Earth and Mars...
>
> Indeed, some of them seem to have forgotten that there is a difference between
> teaching and divulging a truckload of (loosely related) facts.
Boudewijn Dijkstra - 11 May 2005 19:50 GMT
> <snip>
>
[quoted text clipped - 13 lines]
> or would I perform the fft on the signal and then compute signalEnergy
> based on the output of the fft
On the signalEnergy formula that you gave, you said yourself that it takes
samples in the time domain. If however, you have a reason to believe that
signalEnergy can be computed quicker when it is in a form to accept samples in
the frequency domain, and if you have the means and the will to rephrase the
formula in this form, then it would be good to compute signalEnergy based on
the FFT output.