Periodogram Shows power/magnitude
5 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Hi,
I have some doubts on the terminology of the power and magnitude of a signal. I am analyzing the content of a signal. I have made a lot of measurements and every time I see the Power/Frequency, I fear for having made a giant mistake.
Let's start with the code I use to test my theory.
%Mic Measurement
clear all
close all
Fs = 10000;
t_end = 20;
t = [0:1/Fs:t_end];
sig1 = 10*sin(2*pi*20*t);
sig2 = 30*sin(2*pi*80*t);
y = sig1+sig2;
%Plot FFT
N = length(y);
xdft = fft(y);
xdft = xdft(1:N/2+1);
psdx = (1/(Fs*N)).*abs(xdft).^2;
psdx(2:end-1) = 2*psdx(2:end-1);
freq = 0:Fs/length(y):Fs/2;
plot(freq,10*log10(psdx)); grid on;
title('Periodogram Using FFT');
xlabel('Frequency (Hz)'); ylabel('Power/Frequency (dB/Hz)');
Now here's the deal. When I have two signals with different magnitudes, I expect a difference in height of the peak. For this piece of example code, since the magnitude of one signal is 3 times that of the other, I expect a difference of close to 10 dB. That indead is what I see in the figure. So far so good.
Now here's my issue. It says POWER on the left. From electronics, my mind tells me that a signal that is 3 times larger, leads to a 9-fold in power.
I am a bit lost here. When testing the code, it nicely shows the difference between the magnitude of signals, but I get thrown off by the 'power' notation.
Can someone please set me straight and tell me where I got things mixed up?
I know that 20 dB in power is not the same ratio as 20 dB in magnitude, but then why does the example explicitly use power instead of magnitude?
1 commentaire
Matthew Crema
le 8 Oct 2013
Modifié(e) : Matthew Crema
le 8 Oct 2013
Unless I'm missing something, I see no giant mistakes here. Well, maybe there is one very small one: Because N is an even number, xdft = xdft(1:N/2+1); should be xdft = xdft(1:(N+1)/2);
But this just avoids a warning.
But regarding your question, I'm not sure where the confusion lies, except possibly with terminology, as you suspect. I suggest trying not to use phrases like "20 dB in power" or "20 dB in magnitude". These are confusing (to me at least, and so you may be confusing yourself too). As in electronics, the term "20 dB" equivalently means "a 10x difference in voltage" AND IT ALSO MEANS "a 100x difference in power".
So, in your example, I think it is more correct to simply say that there is a "10 dB difference in the peaks" in the power spectrum, as your code demonstrates. Since V2 = 30 and V1 = 10, this is equivalent to saying that there is a 3x difference in voltage (b/c 20*log10(V2/V1) \approx = 10). It is also equivalent to saying that there is a 9x difference in power (10*log10([V2/V1]^2) \approx = 10).
Try it with a power ratio that is not (approximately) 10, because you may also be confusing yourself due to the number 10 hanging around on both the linear and dB scales. I suggest leaving sig1 alone and varying the amplitude of sig2. Instead of V2 = 30, try V2 = 20 (for a factor of 2 difference in voltage), 100 (for a factor of 10), and 1000 (for a factor of 100) to get used to the idea.
Hope this helps.
Réponses (1)
Honglei Chen
le 8 Oct 2013
Hi Robert,
9-fold is about 10 dB, i.e., 10*log10(9) = 9.5424
If you are referring to the reference point, the signal is assumed to be in volts and the impedance is 1 ohm. So under these assumptions, the V^2 equals power. Maybe marking it as dBW match your expectation better?
1 commentaire
Matthew Crema
le 8 Oct 2013
Modifié(e) : Matthew Crema
le 8 Oct 2013
That's true, and one should also consider rms voltage and not zero-to-peak voltage to get the units right. But this level of detail may lead to more confusion in this case.
If one is concerned about the "difference" in the peaks at the two frequencies (as Robert seems to be) this difference in the peaks is independent of the resistor used.
To be explicit 20*log10(V2/sqrt(2)/R) - 20*log10(V1/sqrt(2)/R) = 20*log10([V2/sqrt(2)/R]/[V1/sqrt(2)/R]) = 20*log10([V2/V1]).
And one is safe to ignore the resistor and can worry about zero-to-peak voltage rather than rms voltage.
Or to put it more intuitively: a change in resistance will simply shift the power spectrum up or down on the dB scale, but will not change the dB difference in peaks.
Communautés
Plus de réponses dans Power Electronics Control
Voir également
Catégories
En savoir plus sur Parametric Spectral Estimation dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!