0
\$\begingroup\$

I have a measured voltage signal that I want to present in the frequency domain. My current process is to take the FFT of the signal, then use \$20 \text{log}_{10}|X|\$ where \$|X|\$ is the magnitude of the complex frequency domain representation of the voltage signal. This gives me decibels proportional to the power of the signal.

What are the units of this representation?

They can't be pure decibels as they are not relative to the input signal. I'd like to present the data as dBV or something similar but this seems to require RMS measurements.

\$\endgroup\$
1
  • 2
    \$\begingroup\$ Technically, it's dimensionless. Because you can not have units inside Log. So, either you compute the log of two quantities with the same dimension (like voltage gain), or you implicitly divide the amplitude by a reference quantity of the same dimension (if you divide a voltage amplitude by one mV, you will use dBmV, if you divide by a uV, it will be dBuV; if it's a power and you divide by one milliwatt, it's just dBm). But the result of your computation will be dimensionless, as the argument of the log. Why dimensionless? It has to do with the power series of analytical functions. \$\endgroup\$ – Sredni Vashtar May 13 '18 at 17:23
1
\$\begingroup\$

Look up Parseval's Theorem and try to understand it.

It basically says that if you have a signal, it has a power (or an energy, depending on whether you normalise for time). It doesn't matter whether you analyse it as a time series, or as a frequency series, the power is the same. So the integral over the square of each term in the time series, or the square each term of the frequency series, is identical.

Once you have that, you might then want to ask how the power of the original signal is distributed and changed when you do things like window, or FFT. Throughout, Parseval's tells you that the total power remains unchanged.

\$\endgroup\$
2
\$\begingroup\$

If your signal was originally volts before being acquired, you can use dBV as unit (or dBµV or any other variants).

You need to know the load impedance to determine power though. So if you know your load impedance is for example 50 ohms, then you can calculate the power and label it in dBW or dBm. If you don't know the impedance, then it doesn't make sense to display watts, only volts.

If the FFT is scaled properly, its y axis should be in the same unit as the input signal (Volts here) and thus, the 20log10 conversion in dB gives dBV, however there are several gotchas:

I'd like to present the data as dBV or something similar but this seems to require RMS measurements.

Be really careful about how it is scaled. If you write the code yourself using matlab or a relative, it is always a good idea to use a signal like "sin(wt)" which has a known amplitude and frequency, and check that the FFT really gives a spike with the proper amplitude and frequency... you never know.

About "RMS": The FFT will give you the amplitude of each sine component of your waveform. If you want that to be displayed as RMS, then you can remove 3dB (and use "dBV RMS" as a label), if you want peak amplitude then don't remove 3dB (and display it as dBV). It's the same information.

Also be aware that unless the signal frequency is an integer divider of the sampling frequency, then the signal peak on the FFT will be split between two bins. You need to sum both bins to know the amplitude of the original signal.

\$\endgroup\$
4
  • \$\begingroup\$ "it is always a good idea to use a signal like "sin(wt)" which has a known amplitude and frequency..." this is really good advice. From experimentation I have found to ensure that the FFT maintains the same amplitude, the magnitude must be normalised by the number of samples in the signal. \$\endgroup\$ – loudnoises May 13 '18 at 15:40
  • \$\begingroup\$ does dBV even exist for instantaneous voltages? Everything I find uses it as a reference for RMS only, like this note from Rane (albeit on dBu). \$\endgroup\$ – loudnoises May 13 '18 at 16:25
  • 1
    \$\begingroup\$ @loudnoises Correction for ac frequency bins is not the same to apply for dc; the factor of 2 due to the symmetry of positive and negative frequency axes disappears; the divided by N (number of points) remains there. Make a check also with a constant, besides a sin tone. \$\endgroup\$ – andrea May 13 '18 at 16:55
  • \$\begingroup\$ @andrea after checking you are correct, a DC offset of 1 V results in +3 dBV in the frequency response, thanks for the note! \$\endgroup\$ – loudnoises May 13 '18 at 17:07
1
\$\begingroup\$

The units will be dBV ie decibels relative to 1 volt RMS. You can also have dBI and these are decibels relative to 1 amp. The dBuV is often used in radio frequency analysis to indicate decibels relative to 1 micro volt. And dBm is for power measurements relative to one milli watt. There are plenty.

\$\endgroup\$
0
\$\begingroup\$

I am adding my own answer to supplement the useful responses I have already received. This answer converts a voltage signal into a frequency spectrum with units dBV.

Notes

Using online calculators (1) (2) (factoring out my own ignorance!) to calculate the dBV value of a 2 Vpp sine wave I find it to be approximately -3 dBV, and that a 0 dBV signal will be \$2\sqrt{2}\$ Vpp.

Using MATLAB I have then generated a known signal as per the instructions in the answer from peufeu. The MATLAB code for the experiment is at the end of this answer.

My first discovery is that the magnitude of the FFT must be scaled by the number of samples in the signal to preserve the units of the time domain. I believe this refers to Parseval's Theorem from Neil_UK's answer as if you do not normalise for time then you are looking at energy rather than power.

As in the frequency domain we are inspecting the value of sine wave components, to adapt for RMS the signal must also be scaled by the ratio of peak to RMS of a sine wave, i.e. sqrt(2).

As per andrea's comment: 'Correction for ac frequency bins is not the same to apply for dc; the factor of (ed: sqrt)2 due to the symmetry of positive and negative frequency axes disappears; the divided by N (number of points) remains there.'

This requires a discrete scaling variable to be defined as: $$ k(m) = \begin{cases} \sqrt{2}, & m \neq 0\\ 1, & m=0 \end{cases} ,\quad m=0,\ldots,N-1, $$ which scales the sinusoidal components by \$\sqrt{2}\$ and the DC component by 1.

I'm still not sure whether dBV exists for peak values or whether it only exists for RMS.

Calculation

The DFT of the voltage is given by $$ V(m) = \sum_{n=0}^{N-1}v \cdot \mathrm{e}^{\frac{-2\pi j}{N} m\cdot n},\quad m=0,\ldots,N-1, $$ where \$V\$ is the DFT of the discrete time domain signal \$v\$, each of length \$N\$. (note: this is just the mathematical way of writing it but it is implemented with equivalent results in most fft() algorithms but faster).

This result is scaled by length and RMS amplitude: $$ \bar{V}(m) = \frac{k(m)}{N} V(m),\quad m=0,\ldots,N-1. $$ Finally the logarithmic magnitude is calculated to give the amplitude response in dBV: $$ 20\ \text{log}_{10} \left|\bar{V}(m)\right| $$

Numerical example

The below illustration is produced by the MATLAB script. A time domain signal is generated as the sum of two sine waves at 50 and 100 Hz with peak amplitudes of 1 V and sqrt(2) V respectively, and a DC offset of 1 V. The result is three peaks in the FFT: 0 dBV @ DC, -3 dBV @ 50 Hz, and 0 dBV @ 100 Hz.

Two tone signal in time and frequency domains

clear;

% Sample rate, duration, number of samples
fs  = 10e3;
dur = 2*(1/50); % 2 cycles
Ns  = dur*fs;

% Time and frequency axis
t   = (0:Ns-1)./fs;
f   = (0:Ns-1).*(fs/Ns);

% Input signal, FFT, and scaled decibel magnitude
vDC  = 1;
v1   = sin(2*pi*50*t);
v2   = sqrt(2)*sin(2*pi*100*t);
v    = vDC + v1 + v2;

% Scaling factor is sqrt(2) except for at DC when it is 1.
k  = [1, ones(1,Ns-1)*sqrt(2)];

% Amplitude response must be scaled by time length to maintain units
VdB  = 20*log10(abs((k./Ns).*fft(v)));

% Plot
figure(1);
clf;
subplot(211);
plot(t, v,'k');
hold on;
plot(t, v1,'--k');
plot(t, v2','-.k');
xlabel('Time (s)');
ylabel('Voltage (V)');
ylim([-max(v)*1.2 max(v)*1.2]);
grid on;
legend('Two-tone sum','50 Hz sine','100 Hz sine');

subplot(212);
plot(f, VdB,'k');
xlabel('Frequency (Hz)');
ylabel('Amplitude (dBV)');

ylimits = ylim;
ylim([-10 5]);
xlim([-20 200]);
grid on;

indDC = 1;
peakDCLabel = sprintf('- f = %d Hz, A = %.1f dBV',f(indDC),VdB(indDC));
text(f(indDC),VdB(indDC),peakDCLabel)

ind50Hz = find(f==50);
peak50HzLabel = sprintf('- f = %d Hz, A = %.1f dBV',f(ind50Hz),VdB(ind50Hz));
text(f(ind50Hz),VdB(ind50Hz),peak50HzLabel)

ind100Hz = find(f==100);
peak100HzLabel = sprintf('- f = %d Hz, A = %.1f dBV',f(ind100Hz),VdB(ind100Hz));
text(f(ind100Hz),VdB(ind100Hz),peak100HzLabel)
\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.