ee422g signals and systems laboratory

37
EE422G Signals and Systems Laboratory Noise Analysis Kevin D. Donohue Electrical and Computer Engineering University of Kentucky

Upload: others

Post on 30-Apr-2022

1 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: EE422G Signals and Systems Laboratory

EE422GSignals and Systems Laboratory

Noise Analysis

Kevin D. DonohueElectrical and Computer Engineering

University of Kentucky

Page 2: EE422G Signals and Systems Laboratory

Noise as a Random Variable

Noise is modeled as a random variable (RV), which is defined as a function that maps an event into a real number.

There are 2 main characterizations of noise that are important for designing signal processing and communication systems:

1. Distribution of amplitudes is characterized by the probability density function (pdf), or its integral, the cumulative distribution function (cdf)

2. The correlation or influence between neighboring noise samples is characterized by the autocorrelation (AC), or its Fourier transform, the power spectral density (PSD).

Page 3: EE422G Signals and Systems Laboratory

The PDF

Given random signal x[n] with pdf pX(x), its probability of occurring between values a and b is given by:

The cdf is the probability the RV X is less than x denoted by:

Pr {aX≤b }=∫a

b

pX xdx

Pr {X≤x }=P x x=∫−∞

x

pX d

Page 4: EE422G Signals and Systems Laboratory

PDF and CDF ExampleConsider an exponential noise distribution with pdf:

Compute cdf and find values of x such that the probability of being less than x1 is 0.5132 and less than x2 is 0.9544. Find the probability of x being

between x1 and x2

pX (x)=0.9exp(−0.9 x)for x≥0

and 0 Elsewhere

0 0 . 5 1 1 . 5 2 2 . 5 3 3 . 5 4 4 . 5 50

0 . 2

0 . 4

0 . 6

0 . 8

1

X : 0 . 8Y : 0 . 5 1 3 2

x

cdf

X : 3 . 4 3Y : 0 . 9 5 4 4

0 0 . 5 1 1 . 5 2 2 . 5 3 3 . 5 4 4 . 5 50

0 . 2

0 . 4

0 . 6

0 . 8

1

x

pdf

Page 5: EE422G Signals and Systems Laboratory

Parametric PDF EstimateIf the form of the distribution is known, then only the parameters of the distribution need to be estimated from the data. For example consider a Gaussian distribution with pdf given by:

with mean and standard deviation 2.

So if N data samples (xn) are collected, the sample mean and standard deviation is estimated by:

pX (x)=1

√2πσ2exp(−(x−μ)

2

2σ2 )

=1N ∑n=0

N−1

xn = 1N−1

∑n=0

N−1

xn−2

Page 6: EE422G Signals and Systems Laboratory

Threshold DesignAssume that a noise process is exponential with unknown mean. Given 10 noise samples, estimate a threshold to detect a signal of greater power, such that the probability of false alarm is 1 out of 10k tests.

pX x=1b

exp− xb for x≥0

Model:

Sample Data:

s=[0.20, 1.17, 0.69, 3.70, 1.3, 5.55, 0.46, 0.70, 0.36, 0.34 ]

Page 7: EE422G Signals and Systems Laboratory

Threshold DesignCompute sample mean as an estimate of the b parameter:

Use in cdf to show a relationship between a false alarm probability and the threshold value:

b=1

10∑i=1

10

si=1.45

P fa=1−cdf T =exp−Tb T=−b ln P fa≈−

b ln P fa

T≈−1.45ln 1/10k=13.35

Page 8: EE422G Signals and Systems Laboratory

PDF Non-Parametric EstimationIf the form of the distribution is unknown, it can be estimated with few assumptions using a normalized histogram operation, which estimates the PDF over short intervals (bins) based on percentage of sample data occurring in the bin:

Pr [ax≤b ]=∫a

b

p xdx≈samples∈[a ,b ]

total samplescollected

0 . 5 1 1 . 5 2 2 . 5 3 3 . 50

0 . 1

0 . 2

0 . 3

0 . 4

0 . 5

0 . 6

0 . 7

0 . 8

x

0 1 2 3 40

0 . 1

0 . 2

0 . 3

0 . 4

0 . 5

0 . 6

0 . 7

0 . 8

x

∫a

b

p xdx=b−a pxab for some xab∈[a b ]

Page 9: EE422G Signals and Systems Laboratory

Signal Power and Moments The RMS value of a random signal is equivalent to its second moment.

If the signal is zero mean, the standard deviation is equivalent to the RMS value.

Find the RMS value of:

Find RMS value of a Gaussian random noise process with mean 0.5 and variance of 4.

S rms=√ 1T∫T

s2(t)dt≈√ 1

N∑i=1

N

si2

s(t )=3+5sin (2π100 t)V

Page 10: EE422G Signals and Systems Laboratory

Signal to Noise RatioSignal to noise ratio in Decibels (dB) is defined as the following power ratio:

where s is the RMS value of the signal and

n

is the RMS value of the noise.

Assume a zero mean signal has an RMS value of 2 and zero mean Gaussian noise has an RMS value of 1. The noise and signal will be added together to simulate a signal in noise. What must the noise signal be multiplied by so that the resulting SNR

dB is -2 dB?

SNRdB=10 log10( σ2s

σ2n)=20 log10(

σ sσn )

Page 11: EE422G Signals and Systems Laboratory

CorrelationThe correlation indicates how similar one signal is to another. Related to this is the covariance, which removes the signal mean:

Correlation is the same as above without the mean subtraction. For zero mean signals, the covariance and correlation are identical.

To estimate correlation from stationary (i.e. statistics do not change over time) random signal segments of length N, the sample correlation is used:

xy=E[ xy]=∫x∫y

x− x y− y pXY x , ydx dy

R xy [k ]=1

N−k∑n=k

N−1x [n−k ] y [n]

Page 12: EE422G Signals and Systems Laboratory

Autocorrelation

A signal can be correlated with a delayed version of itself to determine influence (statistically) as samples get further apart. This is the autocorrelation (AC) function:

This is referred to as the biased AC and k is often called the lag, which represents the relative delay or shift between the signals. The Matlab function xcorr() can be used to perform these operations.Note for k=0 the energy or second moment is computed. This will always be the largest value for all AC lags. The AC is often normalized by this value so the zero lag becomes 1.

Rxy [k ]=1N ∑n=k

N−1

y [n−k ] y [n]

Page 13: EE422G Signals and Systems Laboratory

Convolution and Correlation

Recall the convolution operation:

The main difference between convolution and correlation is time reversal of one of the signals before the multiply and sum operation. The conv() operation in Matlab can be used to implement correlation (with some minor modifications to the input arguments)

w [k ]=∑n=k

N−1

x [k−n] y [n]

R [k ]=1N ∑n=k

N−1

x [n−k ] y [n]

Page 14: EE422G Signals and Systems Laboratory

Autocorrelation Example

- 2 0 - 1 5 - 1 0 - 5 0 5 1 0 1 5 2 0- 4

- 2

0

2

4x ( n )

n

Page 15: EE422G Signals and Systems Laboratory

Autocorrelation Example

Page 16: EE422G Signals and Systems Laboratory

Autocorrelation Example

Page 17: EE422G Signals and Systems Laboratory

Autocorrelation Example

Page 18: EE422G Signals and Systems Laboratory

Autocorrelation Example

Page 19: EE422G Signals and Systems Laboratory

Autocorrelation Example

Page 20: EE422G Signals and Systems Laboratory

Autocorrelation Example

Page 21: EE422G Signals and Systems Laboratory

Autocorrelation Example

Page 22: EE422G Signals and Systems Laboratory

Autocorrelation Example

Page 23: EE422G Signals and Systems Laboratory

Autocorrelation Example

Page 24: EE422G Signals and Systems Laboratory

Autocorrelation Example

Page 25: EE422G Signals and Systems Laboratory

Autocorrelation Example

Page 26: EE422G Signals and Systems Laboratory

Autocorrelation Example

Page 27: EE422G Signals and Systems Laboratory

Autocorrelation Example

Page 28: EE422G Signals and Systems Laboratory

Autocorrelation Example

Page 29: EE422G Signals and Systems Laboratory

Autocorrelation Example

Page 30: EE422G Signals and Systems Laboratory

Autocorrelation Example

Page 31: EE422G Signals and Systems Laboratory

Autocorrelation Example

Page 32: EE422G Signals and Systems Laboratory

Autocorrelation Example

Page 33: EE422G Signals and Systems Laboratory

Autocorrelation Example

Page 34: EE422G Signals and Systems Laboratory

Power Spectral DensityThe power spectral density (PSD) of a random signal is its average magnitude spectrum (phase is considered irrelevant and is removed). For stationary random signals the PSD can be estimated from the average of DFT magnitudes.

From long data segments the PSD is estimated from shorter overlapping segments, referred to as Welch's method. For a single segment g, FFT is computed from:

where w[n] is a window function used to taper the data down at the edge of each extracted segment, and L is an increment (usually less than N) to obtain an overlap between segments. N

FFT is the number of

FFT points usually obtained from padding with zeros. The Matlab function pwelch() can be used to implement the PSD computation.

S [m]=1G∑g=0

G−1

∣ V g [m]∣

V g [m]=1N ∑n=0

N−1

v [Lgn]w [n ]exp− j 2 nmN FFT for 0≤mN FFT

Page 35: EE422G Signals and Systems Laboratory

Average

PSD estimation process with hopping window methodFFT Magnitudes

Windowed Segments

Page 36: EE422G Signals and Systems Laboratory

Power Spectral Density Estimation

The power spectral density (PSD) estimation performance is affected by window length, window taper, and zero padding.

1. Window length is proportional to frequency resolution (i.e. the ability to distinguish between 2 closely spaced frequencies).

2. Window tapering lowers resolution but reduces sidelobe artifacts called spectral leakage.

3. Zero padding increases the number of grid points on the PSD frequency axis. It does this through interpolations, so resolution is not improved but can improve the location of a peak or a null by using a finer grid spacing.

Δ f ∝1T

Page 37: EE422G Signals and Systems Laboratory

MATLAB Tips for Axes

If plotting a time signal (vector) the X-axis labels must correspond to the same number of point as in the signal vector. Given the sampling frequency is stored in variable fs in Hz and the signal vector is stored in variable sig, a time axis vector can be generated by:

>> tax = [0:length(sig)-1]/fs; % time axis in seconds

>> plot(tax,sig)

If plotting the frequency spectrum vector pd from an NFFT point DFT, the frequency axis vector can be created from:

>> fax = fs*[0:length(pd)-1]/length(pd); % Frequency axis in Hz

>> plot(fax,abs(pd))