DSPRelated.com
Forums

Adding noise given by Noise Factor

Started by Peter Mairhofer February 11, 2016
Eric Jacobsen <eric.jacobsen@ieee.org> wrote:

>On Sun, 14 Feb 2016 17:16:01 -0800, Peter Mairhofer <63832452@gmx.net>
[...]
>There are a frustratingly large number of potential sources of >factors-of-two errors in SNR calibration.
>Sometimes for a sanity check, if the signal characeteristics allow, a >spectral plot of the signal in noise might provide an easy graphical >estimation of (S+N)/N, which can be adjusted to estimate SNR. If the >results of this match your computed estimate, or are off by the same >3dB, it can sometimes save a lot of head-scratching.
That's a good idea. I think I now see the source for the 3 dB discrepancy in the OP's calculation:
> % signal after the antenna (the -174dBc/Hz noise) > xn = x0 + sqrt(4*kT*BW*Rs)*randn(size(xn)); > > % add noise according to NF > sigma2 = (nf-1)*4*kT*BW*Rs; > yn = xn + sqrt(sigma2)*randn(size(xn)); > > % calculate SNR > SNR1 = 20*log10(norm(x0-yn)/norm(x0)) > > This example gives -84.8450 dB. > Now I could use the well known equation for sensitivity to obtain the > SNR level (-30 converts dBm to volts): > > SNR2 = -174 - 30 - 10*log10(var(x0)/(2*Rs)) + 10*log10(BW) + NF
The "well known" expression for SNR is the SNR for a signal of interest x0 relative to the ideal thermal antenna noise, degraded by the noise figure. That is to say, if the noise figure is 0 dB, the LNA contributes no noise and only the thermal noise of the antenna is used to find the SNR. Whereas in the above formulation, the OP is using the thermal noise of the antenna _as the signal_. This is non-physical; the LNA would have to have a noise figure of 3 dB to get to the right answer for a noise figure of 0 dB. Steve
On 2016-02-15 12:34, Steve Pope wrote:
> Eric Jacobsen <eric.jacobsen@ieee.org> wrote: > [...] > I think I now see the source for the 3 dB discrepancy in the > OP's calculation:
Hi Steve, Thanks; I think I still do not understand fully:
>> % signal after the antenna (the -174dBc/Hz noise) >> xn = x0 + sqrt(4*kT*BW*Rs)*randn(size(xn)); >> >> % add noise according to NF >> sigma2 = (nf-1)*4*kT*BW*Rs; >> yn = xn + sqrt(sigma2)*randn(size(xn)); >> >> % calculate SNR >> SNR1 = 20*log10(norm(x0-yn)/norm(x0)) >> >> This example gives -84.8450 dB. >> Now I could use the well known equation for sensitivity to obtain the >> SNR level (-30 converts dBm to volts): >> >> SNR2 = -174 - 30 - 10*log10(var(x0)/(2*Rs)) + 10*log10(BW) + NF > > The "well known" expression for SNR is the SNR for a signal of interest > x0 relative to the ideal thermal antenna noise, degraded by the noise > figure.
I think this is what I am calculating.
> That is to say, if the noise figure is 0 dB, the LNA contributes no > noise and only the thermal noise of the antenna is used to find the SNR.
Exactly. Let's use this simplified version with NF=0 and forget about the LNA: % original signal of interest (not noise!) x0 = rand(2^16,1); % noise parameters BW = 400e6; Rs = 50; kT = 300*1.38e-23; Nsource = 10*log10(kT)+30; % source noise in dBm % Add source noise (x1 = signal at antenna) x1 = x0 + sqrt(4*kT*BW*Rs)*randn(size(x0)); NMSE1 = 20*log10(norm(x0-x1)/norm(x0)) NMSE2 = Nsource - 30 - 10*log10(var(x0)/(2*Rs)) + 10*log10(BW) + 0 The difference is still 3dB. "NMSE1" calculates the SNR just the standard way from discrete-time samples. "NMSE2" just calculates the SNR based on "NoisePower/SignalPower" in dB.
> Whereas in the above formulation, the OP is using the thermal noise > of the antenna _as the signal_.
Maybe I get it wrong but my signal is x0 (it just uses "randn" to get an actual signal). The signal at the antenna is xn. So the thermal noise of the antenna is "xn - x0" (=sqrt(4*kT*BW*Rs)*randn(size(xn)))
> This is non-physical; the LNA would > have to have a noise figure of 3 dB to get to the right answer > for a noise figure of 0 dB.
I found a different issue which may come from some voltage/power conversion: For the discrete-time samples I add the noise in voltage domain where the noise power (variance of the samples) is given as 4kTBRs "NMSE2" is calculated from *power* domain: NMSE2 = -SNR = N [dBm] - Pin [dBm] = 10*log(kTB)+30 - 10*log(Vin^2/(2Rs))-30 = 10*log(2kTBRs) - 10*log(Vin^2) = 10*log((2kTBRs)/(Vin^2)) = 10*log((2kTBRs)/var(x0)) It can be seen that the noise power from this derivation is 2kTBRs rather than 4kTBRs - a factor of 2. I can further verify: var(x0-x1) = 331.7233e-012 4*kT*BW*Rs = 331.2000e-012 NMSE2 = ... = 10*log(2*var(x0-x1)/var(x0)) = 10*log(2*norm(x0-x1)^2/norm(x0)^2) = 20*log(norm(x0-x1)/norm(x0)) + 10*log(2) = NMSE1 + 3 If I would calculate my signal as Vin^2/Rs I would get the same result. But I think 2Rs is correct because due to matching, the total resistance at the antenna is 2Rs (Rs of the antenna + Rs of the matched LNA/measurement device). Any thoughts on this? Thanks, Peter
On 2016-02-16 9:33, Peter Mairhofer wrote:
> On 2016-02-15 12:34, Steve Pope wrote: >> Eric Jacobsen <eric.jacobsen@ieee.org> wrote: >> [...] >> I think I now see the source for the 3 dB discrepancy in the >> OP's calculation: > > > Hi Steve, > > Thanks; I think I still do not understand fully: > >>> % signal after the antenna (the -174dBc/Hz noise) >>> xn = x0 + sqrt(4*kT*BW*Rs)*randn(size(xn)); >>> >>> % add noise according to NF >>> sigma2 = (nf-1)*4*kT*BW*Rs; >>> yn = xn + sqrt(sigma2)*randn(size(xn)); >>> >>> % calculate SNR >>> SNR1 = 20*log10(norm(x0-yn)/norm(x0)) >>> >>> This example gives -84.8450 dB. >>> Now I could use the well known equation for sensitivity to obtain the >>> SNR level (-30 converts dBm to volts): >>> >>> SNR2 = -174 - 30 - 10*log10(var(x0)/(2*Rs)) + 10*log10(BW) + NF >> >> The "well known" expression for SNR is the SNR for a signal of interest >> x0 relative to the ideal thermal antenna noise, degraded by the noise >> figure. > > I think this is what I am calculating. > >> That is to say, if the noise figure is 0 dB, the LNA contributes no >> noise and only the thermal noise of the antenna is used to find the SNR. > > Exactly. Let's use this simplified version with NF=0 and forget about > the LNA: > > % original signal of interest (not noise!) > x0 = rand(2^16,1); > > % noise parameters > BW = 400e6; > Rs = 50; > kT = 300*1.38e-23; > Nsource = 10*log10(kT)+30; % source noise in dBm > > % Add source noise (x1 = signal at antenna) > x1 = x0 + sqrt(4*kT*BW*Rs)*randn(size(x0)); > > NMSE1 = 20*log10(norm(x0-x1)/norm(x0)) > NMSE2 = Nsource - 30 - 10*log10(var(x0)/(2*Rs)) + 10*log10(BW) + 0 > > The difference is still 3dB. > > "NMSE1" calculates the SNR just the standard way from discrete-time samples. > > "NMSE2" just calculates the SNR based on "NoisePower/SignalPower" in dB. > >> Whereas in the above formulation, the OP is using the thermal noise >> of the antenna _as the signal_. > > Maybe I get it wrong but my signal is x0 (it just uses "randn" to get an > actual signal). > The signal at the antenna is xn. So the thermal noise of the antenna is > "xn - x0" (=sqrt(4*kT*BW*Rs)*randn(size(xn))) > >> This is non-physical; the LNA would >> have to have a noise figure of 3 dB to get to the right answer >> for a noise figure of 0 dB. > > I found a different issue which may come from some voltage/power conversion: > > For the discrete-time samples I add the noise in voltage domain where > the noise power (variance of the samples) is given as > > 4kTBRs > > "NMSE2" is calculated from *power* domain: > > NMSE2 = -SNR = N [dBm] - Pin [dBm] > = 10*log(kTB)+30 - 10*log(Vin^2/(2Rs))-30 > = 10*log(2kTBRs) - 10*log(Vin^2) > = 10*log((2kTBRs)/(Vin^2)) > = 10*log((2kTBRs)/var(x0)) > > It can be seen that the noise power from this derivation is 2kTBRs > rather than 4kTBRs - a factor of 2. > > I can further verify: > > var(x0-x1) = 331.7233e-012 > 4*kT*BW*Rs = 331.2000e-012 > > NMSE2 = ... = 10*log(2*var(x0-x1)/var(x0)) > = 10*log(2*norm(x0-x1)^2/norm(x0)^2) > = 20*log(norm(x0-x1)/norm(x0)) + 10*log(2) > = NMSE1 + 3 > > If I would calculate my signal as Vin^2/Rs I would get the same result. > But I think 2Rs is correct because due to matching, the total resistance > at the antenna is 2Rs (Rs of the antenna + Rs of the matched > LNA/measurement device). > > Any thoughts on this?
Ok, referring to the initial response <n9iobj$j3t$1@blue-new.rahul.net> where you wrote:
> In the simplest case you have a single antenna of known impedance > feeding a singla LNA. To say the noise figure is 0 dB means that the > noise voltage referred to the LNA input equals the thermal noise of a > resistor with that impedance: > > sqrt(4kTR) > > in units of volts per root hertz of bandwidth.
But this would only be true if you have a non-matched LNA with infinite source impedance, right? Since I would assume matching, the input impedance if the LNA is Rs too, so the thermal noise at the antenna is: sqrt(4kTR * R/(R+R)) = sqrt(2kTR) ? Peter
Peter Mairhofer  <63832452@gmx.net> wrote:

> Let's use this simplified version with NF=0 and forget about the LNA: > > original signal of interest (not noise!) > x0 = rand(2^16,1);
Okay, x0 has a RMS value of 1, which is +30 dBm.
>% noise parameters
>BW = 400e6; >Rs = 50; >kT = 300*1.38e-23;
>x1 = x0 + sqrt(4*kT*BW*Rs)*randn(size(x0));
let's write this as x1 = x0 + 1.82e-5 * x2 Where x2 also has an RMS value of 1. The SNR is 20 * log10 (1 / 1.82e-5) = 94.8 dB Now let's go back to your textbook formula from a previous post: SNR2 = -174 - 30 - 10*log10(var(x0)/(2*Rs)) + 10*log10(BW) + NF = -97.9 dB So yes, still 3 dB off. (And inverted; not sure why that is.) Where did your textbook formula come from? Maybe there is some context surrounding this formula that would clear things up. Steve
Peter Mairhofer  <63832452@gmx.net> wrote:

>But this would only be true if you have a non-matched LNA with infinite >source impedance, right? Since I would assume matching, the input >impedance if the LNA is Rs too, so the thermal noise at the antenna is:
>sqrt(4kTR * R/(R+R)) = sqrt(2kTR)
If the antenna impedance is 50 ohms, and the LNA input impedance is 50 ohms, and the LNA is noise-free (0 dB noise figure) then both the thermal antenna noise, and the signal of interest, are attenuated by 6 dB due to loading of the antenna by the LNA. So this loading effect does not affect the SNR. Steve
Hi Steve,

On 2016-02-16 10:51, Steve Pope wrote:
> Peter Mairhofer <63832452@gmx.net> wrote: > >> Let's use this simplified version with NF=0 and forget about the LNA: >> >> original signal of interest (not noise!) >> x0 = rand(2^16,1); > > Okay, x0 has a RMS value of 1, which is +30 dBm.
Actually in this case not because it is "rand" but let's go back to my initial code and use Gaussian: x0 = randn(2^16, 1); Yes, RMS value of 1.
>> % noise parameters > >> BW = 400e6; >> Rs = 50; >> kT = 300*1.38e-23; > >> x1 = x0 + sqrt(4*kT*BW*Rs)*randn(size(x0)); > > let's write this as x1 = x0 + 1.82e-5 * x2 > > Where x2 also has an RMS value of 1. > > The SNR is 20 * log10 (1 / 1.82e-5) = 94.8 dB > > Now let's go back to your textbook formula from a previous post: > > SNR2 = -174 - 30 - 10*log10(var(x0)/(2*Rs)) + 10*log10(BW) + NF > > = -97.9 dB > > So yes, still 3 dB off. (And inverted; not sure why that is.)
The inversion comes because I use NMSE (normalized mean squared error) which is in this case just -SNR. But we can stick with SNR.
> Where did your textbook formula come from? Maybe there is some > context surrounding this formula that would clear things up.
The formula itself comes from a course reader but I can easily derive it here. It's nothing but the SNR definition in power: SNR = Pin - N (in dB; Pin: input signal power, N: noise power) Noise power at antenna: N = 10*log(kTB) [dBW] Signal power: Pin = 10*log(Vin^2/(2*Rs)) [dBW] N = 10*log(kT) + 10*log(B) = -203.83 + 10*log(B) = -174 [dBm] - 30 + 10*log(B) [dBW] SNR = 10*log(Vin^2/(2*Rs)) + 174 + 30 - 10*log(B) = 174 + 30 + 10*log(var(x0)/(2*Rs)) - 10*log(B) Thanks, Peter
On 2016-02-16 10:59, Steve Pope wrote:
> Peter Mairhofer <63832452@gmx.net> wrote: > >> But this would only be true if you have a non-matched LNA with infinite >> source impedance, right? Since I would assume matching, the input >> impedance if the LNA is Rs too, so the thermal noise at the antenna is: > >> sqrt(4kTR * R/(R+R)) = sqrt(2kTR) > > If the antenna impedance is 50 ohms, and the LNA input impedance > is 50 ohms, and the LNA is noise-free (0 dB noise figure) then > both the thermal antenna noise, and the signal of interest, > are attenuated by 6 dB due to loading of the antenna by the LNA. > > So this loading effect does not affect the SNR.
Yes, you are right. And I just checked regarding my previous post: Also for the *signal* I assume the same attenuation (Pin=Vin^2/(2*R)) hence it is valid. Really, really weird. Peter
Peter Mairhofer  <63832452@gmx.net> wrote:

>> [ textbook formula ]
>The formula itself comes from a course reader but I can easily derive it >here. It's nothing but the SNR definition in power: > >SNR = Pin - N (in dB; Pin: input signal power, N: noise power)
>Noise power at antenna: N = 10*log(kTB) [dBW] >Signal power: Pin = 10*log(Vin^2/(2*Rs)) [dBW]
Surely power = V^2 / R, not V^2 / (2*R) !! Steve
On 2016-02-16 12:00, Steve Pope wrote:
> Peter Mairhofer <63832452@gmx.net> wrote: > >>> [ textbook formula ] > >> The formula itself comes from a course reader but I can easily derive it >> here. It's nothing but the SNR definition in power: >> >> SNR = Pin - N (in dB; Pin: input signal power, N: noise power) > >> Noise power at antenna: N = 10*log(kTB) [dBW] >> Signal power: Pin = 10*log(Vin^2/(2*Rs)) [dBW] > > Surely power = V^2 / R, not V^2 / (2*R) !!
Actually, this is what I meant in <n9vt8g$8s1$2@news.albasani.net>, however, got it wrong for some reason. So to summarize: In case of matching, Pin = Vsig^2/(2*R) But then the same is true for noise: Vn^2 = 4kTBR*R/(2*R) = 2kTR If no matching is assumed (LNTA has infinite input impedance), Pin=Vsig^2/R, Vn^2=4kTR Both give the same SNR and work. In my opinion, the former should be favored because in an actual system there would be a match between antenna and LNA (and both; noise and signal would be halfed). Peter
Peter Mairhofer  <63832452@gmx.net> wrote:

>On 2016-02-16 12:00, Steve Pope wrote:
>> Surely power = V^2 / R, not V^2 / (2*R) !!
>Actually, this is what I meant in <n9vt8g$8s1$2@news.albasani.net>, >however, got it wrong for some reason.
Great, so we have resolved the 3 dB discrepancy between formulae.
>So to summarize:
>In case of matching, Pin = Vsig^2/(2*R)
Yes, if the antenna is being modeled as a voltage source with a series resistance R, and Vsig is that voltage source, then this is then the power going into the input of the LNA. (But see below.)
>But then the same is true for noise: Vn^2 = 4kTBR*R/(2*R) = 2kTR
Yes but it bears more examination. Let's say R = 50. The 50 ohm antenna impedance (modeled as I stated above) is effectively in parallel with the 50 ohm input impedance of the LNA, so the thermal noise voltage is that associated with these two in parallel, a single R/2 = 25 ohm resistor: Vn^2 = 4kTB(R/2) = 2kTR Which is the same as what you wrote.
>If no matching is assumed (LNTA has infinite input impedance), >Pin=Vsig^2/R, Vn^2=4kTR
>Both give the same SNR and work.
Okay
> In my opinion, the former should be favored because in an > actual system there would be a match between antenna and LNA > (and both; noise and signal would be halfed).
Well, so long as you don't conclude this adds in an automatic 3 dB loss when computing your link margin. Because it doesn't. You aren't actually dissipating half of the received power in the antenna, and half in the LNA. Ideally antennas do not dissipate RF power. The antenna model I described above is a valid circuit model for a receiving antenna, but it is non-physcial in the sense that the voltage source internal this model is chugging out twice the RF power than actually exists physically. Steve