How to measure average power of demodulated signal in LTspice

Thread Starter

bdennis

Joined May 26, 2020
4
Hi guys. I have to compare mixer circuits for demodulation for a uni assignment.

One of the questions asks the average power of the demodulated signal in the 0-50MHz range, so I built the circuit in LTspice and took the FFT of the demodulated signal. For a trace in the time domain, I can get the average and RMS values by holding Ctrl and clicking on the trace name, but in the FFT it gives a different set of measurements (see attached screenshot).

I've tried googling, but I don't understand how to get the average power over a certain range in the frequency domain. Any help or advice will be greatly appreciated.

Thanks.
 

Attachments

ci139

Joined Jul 11, 2016
1,556
? terminate your V.demod by 50Ω . . . [ALT]+(Mouse.Left-Click) on that resistor gives you the power that is dissipating on it
 

Thread Starter

bdennis

Joined May 26, 2020
4
? terminate your V.demod by 50Ω . . . [ALT]+(Mouse.Left-Click) on that resistor gives you the power that is dissipating on it
The only problem with that is that it gives the power of the whole signal, I'm only after a small frequency range.

This step of the question is done before any filtering is applied, so I thought there may have been a way to measure a small frequency band of the signal in the frequency domain in LTspice, similar to how you can measure a transient over a small time in the time domain.
 

MrAl

Joined Jun 17, 2014
7,666
Hi guys. I have to compare mixer circuits for demodulation for a uni assignment.

One of the questions asks the average power of the demodulated signal in the 0-50MHz range, so I built the circuit in LTspice and took the FFT of the demodulated signal. For a trace in the time domain, I can get the average and RMS values by holding Ctrl and clicking on the trace name, but in the FFT it gives a different set of measurements (see attached screenshot).

I've tried googling, but I don't understand how to get the average power over a certain range in the frequency domain. Any help or advice will be greatly appreciated.

Thanks.
Hello,

Let me see if i understand you first...

So you have a range of frequencies say 10Hz to 100kHz and say you want to measure only the power in frequencies from 50Hz to 20kHz.

If this is true then the following may help.

You could terminate the signal source with the required termination resistance first. Measuring the voltage then the power in a sinusoid is P=Vrms^2/R. So knowing the RMS amplitude Vrms you can calculate the power.
To limit this to one frequency, you could do a Fourier analysis and pick out the amplitude of the frequency you want to measure and use that as Vrms call it Vrms1. The power would then be the same calculation P=Vrms1^2/R.
If you have a range of frequencies 1 though N then the total square of the RMS voltage is:
Vrms^2=Vrms1^2+Vrms2^2+Vrms3^2+...+VrmsN^2
You could then use the formula P=Vrms^2/R.

If you have a wide range of frequencies like 50Hz to 20kHz you may not be able to do that by hand by picking out the individual amplitudes because there are so many, and i am not sure if LT Spice has a way to do this (we could look more though). However, if you were to copy the page that shows the Fourier amplitudes you could store the values in a text file and write a short little program to read the RMS amplitudes and calculate the power as shown above. With a modern home computer this would take less than 1 second to calculate.

Another way although maybe not as accurate would be to design a sharp bandpass filter with high input impedance (or impedance to match the signal source requirement instead of a separate load resistor) and that would isolate the frequency band you want to measure. Then you could calculate Vrms and thus the power that way.

LT Spice may have a way to restrict the range of frequencies being reported, but you might still have to add them up by hand or with a program. That is, unless LT Spice shows a total RMS value for the entire range, which it very well might. Do a Fourier analysis and see what it spits out.
 

Thread Starter

bdennis

Joined May 26, 2020
4
Let me see if i understand you first...
Yes, you understand what I'm after.

I was hoping to avoid calculating it manually because I have to repeat the process for 6 topologies. In saying that, it's not unreasonable for me to do it by hand or by writing a script, I just thought LTspice may have had something built-in that I was missing. I'm only a novice with spice.

Thank you for your very comprehensive reply. I'll crack on with the assignment now.
 

Alec_t

Joined Sep 17, 2013
11,401
If you want to examine the response over only a small range of frequencies can't you just set the Start and Stop frequencies for the AC analysis accordingly?
 

Thread Starter

bdennis

Joined May 26, 2020
4
For AC Analysis, yes you can. In this particular case, the question is about the output of a mixer circuit, so I'm feeding an AM signals and oscillation into the mixer, both of which are above 100MHz. The mixer then multiplies the signals together and produces an output spectrum of frequencies. This is how they get the audio components out of a radio signal. So it's not actually an AC analysis, I have to take the FFT of a TRAN analysis.

The next step is to filter out the high frequency components to leave the low frequency stuff. But before the filtering is applied, the professor wants to know the power in the low frequencies. I had considered just filtering out the high frequencies and letting SPICE calculate the whole thing for me. I still might.
 

MrAl

Joined Jun 17, 2014
7,666
Hello again,

I tried the LT Spice Fourier analysis idea and it seems very hard to get it to work, if at all. It would take less than 30 minutes to wrote a program to do the calculation and it would be fast to use, but if it doesnt work there's no sense in doing that now.

So maybe the bandpass filter is the better idea which would at least give an estimate.
One you have the bandpass filter on the output you can then square it, take the time average, and then take the square root which would give you the RMS value. You should be able to calculate the power then.
 
Top