Off-Topic: Generating VU meter from spectral data

Status
This old topic is closed. If you want to reopen this topic, contact a moderator using the "Report Post" button.
Hi all...

What the best way to create a VU meter that accuratly represents a audio signal?

Im given an array holding the spectrum analysis of the audio stream.

At the moment im usng the simple code:

Code:
	//get VU values
	double sum;
	for (BYTE c=0; c < 2; c++)
	{
		sum = 0;
		for (WORD x=0; x < 576; x++)
		{
			sum += spectrum_data[c][x];
		}
		vu_data[c] = sum / (double)576;
	}

Where spectrum_data[channel][freq], where freq ranges from 0hz to (fs/2)Hz.

Is there a better/more-accurate way?

Thanks.
 
Status
This old topic is closed. If you want to reopen this topic, contact a moderator using the "Report Post" button.