SAMPLING & ALIASING. OVERVIEW Periodic sampling, the process of representing a continuous signal...

40
SAMPLING & ALIASING

Transcript of SAMPLING & ALIASING. OVERVIEW Periodic sampling, the process of representing a continuous signal...

SAMPLING & ALIASING

OVERVIEW

• Periodic sampling, the process of representing a continuous signal with a sequence of discrete data values, pervades the field of digital signal processing.

• In practice, sampling is performed by applying a continuous signal to an analog-to-digital (A/D) converter whose output is a series of digital values.

OVERVIEW (cont.)

• With regard to sampling, the primary concern is how fast must the given continuous signal be sampled in order to preserve its information content.

ALIASING• There is a frequency-domain ambiguity

associated with the discrete-time signal samples that is absent in the continuous signal world.

eg. Suppose you are given the following sequence of values,

x(0) = 0 x(1) = 0.866 x(2) = 0.866 x(3)= 0

x(4) = -0.866 x(5) = -0.866 x(6) = 0

and were told that they represented instantaneous values of a sinewave. Next you were told to draw that sinewave. You would be able to draw a sinewave that passes through the points representing the original sequence.

yn

n0 2 4 6

1

0

1

x1i

0

x2i

ti

However, someone else might draw another sine wave with a different frequency through the same points.

As an example, consider two sine waves that differ only in frequency. One has a frequency of 500 Hz, and the frequency of the subsequent sine wave is 8500 Hz.

x1i

0

x2i

ti

Consider the continuous time domain sinusoidal signal

This a garden variety sinewave with a frequency fo Hz. If we sample at a rate of fs samples per second, where Ts = 1/fs. If we start sampling at t = 0, we will obtain samples at 0 ts, 1 ts, 2 ts, and so on.

x t f to( ) sin( ) 2

The final equation defines the value of the nth sample of our x(n) sequence to be equal to the original sine wave at the time instant nTs.

0

0

0

0

2sin)(

22sin)2(

2sin)(

02sin)0(

T

nTnTx

T

TTx

T

TTx

Tx

ss

ss

ss

Because two values of a sine wave are identical if they’re separated by an integer multiple of 2 radians, i.e.,

where m is any integer. Now

)2sin()sin( m

)22sin()2sin()( mntfntfnx soso

s

so nt

nt

mfnx 2sin)(

If we let m be an integer multiple of n, m=kn, we can replace the m/n ratio with k so that

The fo and (fo + kfs ) factors are equal. It means that an x(n) sequence of digital sample values, representing a sine wave of fo Hz, also exactly represents sine waves at other frequencies, namely fo + kfs . This is one of the most important relationships in the field of DSP.

s

so nt

t

kfnx 2sin)(

When sampling at a rate of fs samples/sec., if k is any positive or negative integer, we cannot distinguish between the sampled values of a sine wave of fo Hz and a sine wave of (fo + kfs) Hz.

IMPULSE FUNCTION

The impulse function is represented by (t). Its domain is all t, and the range contains only two values, 0 and .

The range is zero for all values of time except when t = 0, when the time function has the value of infinity (i.e. blows up).

0,

0,0)(

t

tt

The graphical representation of the delta function is given below

(t)

t

To obtain some insight into the function, we can consider the function (t) as shown below

(t)

t

The function has a height of 1/and a width of , resulting in an area of 1.

otherwise

tt

,022

,1

122

112

2

dtdtt

The function is obtained from (t) by the limiting process

The width of function goes to zero as its amplitude goes to infinity in a manner that causes the area under the curve to remain constant at unity.

(t)

t

)(lim)(0

tt

As decreases in value, the function becomes narrower and higher. In the limit, as t (t).

The integral of (t) is unity for any value of . It follows that the integral of the function is also unity provided that the origin is included in the limits of integration. Otherwise, it is zero.

otherwise

badtt

b

a ,0

0,1)(

If we multiply the function by a constant, k, and then integrate the product over all time, we get

Multiplication of (t) by a constant is equivalent to choosing (t) with a height of k/. This results in an area equal to k.

kdttkdttk

)()(

TIME-SHIFTED FUNCTIONS

If the argument of the function is replaced with t-, we see that the impulse still occurs when the argument takes on the value of zero (i.e., when t- = 0 or t = ).

0,

0,0)(

t

tt

TIME-SIFTING PROPERTY

If we integrate the product of the function and any time function, we can observe the sifting property of function.

where is arbitrarily small.

dtttfdtttfdtttfdtttf

)()()()()()()()(

The first and last integrals on the right-hand side of the previous equation are zero, since the limits of integration do not include the origin. If f(t) is reasonably well behaved at the origin (i.e., no jumps or discontinuities), as f(t) can be approximate by f(0). Since f(0) is a constant, it can be taken outside the integral.

)0()()0()()0()()(lim0

fdttfdttfdtttf

So all the values of f(t) are sifted out except the value at the origin, f(0).

)0()()( fdtttf

If we use the time-shifted function, we obtain

dtttff

)()()(

Note that

Since expressions equal to the same expression are equal to each other,

and

)(00)( ttt

)()( tt

)()( tt

Because , we can interchange t with to obtain

( ) ( )t t

dttftf

)()()(

Evaluate the following integrals.

dtt4

1)(a.

c. dtt10

10)(3

dtt

8

28)(b.

dtt50

40)(7d.

In many DSP textbooks you will find sampling described as a multiplication of the input analog waveform with a periodic delta, Dirac, or impulse function.

In an idealized system our sampling waveform would consist of a train of impulse functions spaced evenly by a period Ts.

We can describe our idealized sampling function, z(t), as the sum of all the individual impulse functions:

tTtTt

tTtTtttz

ss

ss

2

2)(

n

n

snTttz )(

If we multiply these by our analog input signal, f(t), we obtain a train of pulses whose amplitudes are equal to the amplitude of f(t) at that moment in time.

Mathematically, the output sampled waveform, y(t), is just the multiplication of z(t) with the input analog signal f(t):

n

n

snTttfty )()(

InterpolationA digital-to-analog converter (DAC) converts digital signals to continuous (analog) signals.

A general formula that describes a broad class of DACs is

y t y n p t nTsn

( ) [ ] ( )

where p(t) is the characteristic pulse shape of the converter.

The equation state that the output signal is produced by adding together many pulses, each shifted in time. That is, at each sample time tn = nTs, a pulse p(t-nTs) is emitted with an amplitude

The simplest pulse shape is a symmetric square pulse:

p tTs t Ts

otherwise( )

RS|T|1

1

2

1

20

The figure below shows a pulse is Ts = 5ms and a amplitude of 1.

p t( )

t0.005 0 0.005

0

1

w t( )

t0.005 0 0.005 0.01 0.015 0.02 0.025

1

0

1

The reconstructed waveform for the square pulse is a poor approximation of the original sine wave.

Although this a poor approximation, this is a useful model since many physically realizable DACs produce outputs that look exactly like this.

Since a constant is a polynomial of zero order, and since the effect of the flat pulse is to hold or replicate each sample for Ts seconds, the use of a flat pulse is called a zero-order hold reconstruction.

p t( )

t0.005 0 0.005

0

0.5

1

p tt

TsTs t Ts

otherwise

( ) RS|T|1

0

The triangular pulse is defined as a pulse consisting of the first-order polynomial (straight-line segments:

w t( )

t0.005 0 0.005 0.01 0.015 0.02 0.025

1

0

1

w t( )

t0.005 0 0.005 0.01 0.015 0.02 0.025

1

0

1

Oversampling

If the original waveform does not vary much over the duration of p(t), then we will also obtain a good construction. Oversampling, i.e., using a sampling rate that is much greater than the Nyquist rate, can ensure this.