开发者

how to determine signal strength of a pcm sample? in terms of power

I read that signal power = signal * signal. What is that? what is signal? how do we obtain it? I'm progra开发者_如何学Gomming in C(if that's necessary to post)


Signal is the amplitude of whatever input source you have sampled. E.g. for audio you might have 16 bit signed samples, and +32767 might represent say +1.0 V analogue and -32768 would be -1.0 V analogue. (The relationship between digital sample value and whatever analogue quantity you are sampling is usually linear, which makes life simple.)

To calculate the power of a signal you would measure the mean square value, e.g.

double sum_sq = 0.0;
for (int i = 0; i < N; ++i)
{
    sum_sq += (double)sample[i] * (double)sample[i];
}
double power = sum_sq / (double)N;
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜