Вы находитесь на странице: 1из 45

Sampling

Sampling is used to accomplish time-discretization of


continuous-time (analog) signals.



x (t ) x(t )
n

n

t nTs X ( f ) X ( f ) * t nTs

1
1
X ( f ) X ( f ) *
Ts

n
f nfs
Ts
X f nf X ( f )
n
s

Spectrum of sampled signal Generated by periodic


repetition of the input signal spectrum with period (in
frequency domain) equal to the sampling rate fs, and
scaled by the reciprocal of the sampling interval, i.e.,
1/ Ts or fs.
Sampling
It can be observed that the minimum sampling rate
necessary is fs = 2W, where W is the maximum
frequency contained in the input signal.
By this condition each spectrum component X(f nfs)
has no overlap with its adjacent spectrum components
X(f [n1]fs) and X(f [n+1]fs) .
This minimum sampling rate is called the Nyquist rate.
Ideal reconstruction It can also be observed that the
original input analog signal may be retrieved exactly from
the sampled signal (sampled at a rate more than or
equal to Nyquist rate) when passed through an ideal low-
pass filter (LPF) of magnitude Ts and extending from
fs/2 to +fs/2 (or from W to +W).
Aliasing
Sampling at rate lower than the Nyquist rate causes
overlapping of the spectrum components.
For reconstruction, an undersampled signal may be
passed through an LPF extending from fs/2 to +fs/2.
This in effect gives some high frequency components (all
frequency components in the range fs/2 to W) translated
to lower frequency in the reconstructed signal due to
foldover of that part of the spectrum.
This is aliasing (high frequency components assuming
lower frequency).
Aliasing
Anti-aliasing filter For rejecting spurious frequencies
beyond which otherwise may enter the sampler and
cause distortion in the reconstructed signal due to
aliasing.
Guard band When sampled at a rate higher than the
Nyquist rate then the gap between two adjacent spectral
components is the guard band.
Guard band provides margin for avoiding aliasing.
It is also necessary to avoid any distortion in
reconstruction due to use of practical (non-ideal) LPF.
Sampling band-pass signal
Trivially, we may have sampling rate more than or equal
to 2fH.
However, it is possible to sample at a rate lower than the
above under the following conditions:
Nf s 2 f L and ( N 1) f s 2 f H

Accordingly, we can deduce that the minimum possible


sampling rate is: f
1 L
f s ,min 2W W
1 L
f
W
The above will be equal to twice the signal BW if the
lower frequency is integral multiple of the BW.
Sampling band-pass signal
But, all values in the range fs,min to 2fH cannot be used for
sampling.
Values that may be used as sampling rate should
conform to the following:

2 f H 2 f L
1 s
f 2 f or 1 f s 2 f H
f
s
L
f
s
FS representation of spectrum

x (t )
n
x(nTs ) (t nTs ) X ( f )
n
x(nTs )e j 2nTs f

The expression above gives the Fourier series


representation of the periodic spectrum (periodic signal
in the frequency domain) with frequency period equal to
the sampling frequency.
The sample values form the set of FS coefficients.
Sampling theorem

The original input signal may be obtained as:


W

x(t ) X ( f )exp j 2 ft df X ( f )exp j 2 ft df


W

W
1 f /2
Ts X ( f )exp j 2 ft df X ( f )exp j 2 ft df
s


W fs f /2s

1 f /2
exp j 2 f t nTs df
s

x(nTs )
n fs f /2
s


x(nTs )sinc f s t n
n
Sampling theorem

Thus, the original signal can be reconstructed by adding


a series of sinc functions scaled by the sample values
and translated in time (with each sinc function centered
at the corresponding sampling instant)
In other words, the original signal can be retrieved from
the samples only by using an interpolation function
the sinc function acts as the interpolation function.
For a signal sampled at Nyquist rate, the interpolation
function is sinc 2Wt n
Statements of sampling theorem
A band-limited signal of finite energy, which has no
frequency components higher than W Hz, is completely
described by specifying the values of the signal at
instants of time separated by 1 / 2W seconds.
A band-limited signal of finite energy, which has no
frequency components higher than W Hz, may be
completely recovered from a knowledge of its samples
taken at the rate of 2W per second.
Signal reconstruction

So, for signal reconstruction, the samples are passed


through a system having impulse response equal to the
sinc function.
That is, pass the samples through an LPF extending
from fs / 2 to +fs / 2 (or from W to +W).
This filter is called interpolation filter or reconstruction
filter.
Spectrum of discrete samples
Sampling may be useful in real-time transmission of multi-
signals over a single channel using time-division
multiplexing (TDM). In this case, the information about the
sampling interval (sampling rate) is retained.
For digital storage and other digital transmission systems
generally we have only a pool of discrete samples.
So, the timing information between samples is lost in case
of digital signal.
That is, we only have the sample numbers in hand and not
the time instants of the samples.
During playback/display the sample instants are decided
as per the header information and/or system requirement.
Spectrum of discrete samples
A digital signal is a pool of samples arranged in
sequence.
So, digital signal is a function of sample no. (not time).
Sampling interval = 1 sample.
So, its periodicity can be expressed only in terms of
samples (not in terms of time) after which the sequence
repeats, say N.
Accordingly, its frequency can be expressed as
= 2 / N radians per sample or simply radians.
Now, suppose the samples are arranged in time with Ts
time interval between samples (as one will obtain after
sampling the original time-continuous signal).
Spectrum of discrete samples
Then the corresponding frequency is given as
1 2
f
NTs NTs
So, can be related to f or as
2 f
Ts 2fTs 2
N fs

Ratio f / fs (and so also ) is called normalized


frequency.
So, normalized frequency is the corresponding
frequency when a continuous-time signal is discretized in
time.
Spectrum of discrete samples

Therefore, normalized sampling rate = 2 radian.


Therefore, the spectrum of a digital signal described by a
pool of samples is given by the same spectrum of the
sampled signal but as a function of (instead of or f).
The spectrum will repeat after every 2 radian.
Accordingly, the spectrum is generally sketched from
radian to + radian or from 0 to 2 radian.
Corresponds to the spectrum X ( f ) from fs / 2 to +fs / 2
fs Hz (or 2fs radian/sec) corresponds to 2 radian.
Parts of spectrum beyond fs / 2 and +fs / 2 are repetition of
the same as expected for angular frequency.
Frequency normalization
Now, let us see the significance of this frequency
normalization in case of digital signal.
Let a signal x(t) with spectrum X(), bandlimited in the
range || < m, is sampled at Nyquist rate 2fm Hz.
The spectrum of the sampled signal will be then 2fmX()
repeated after every 2m.
Now, say the signal is time-scaled to x(at) with spectrum
X(/a)/a, bandlimited in the range || < am,
This is sampled at Nyquist rate 2afm Hz (a times the
earlier sampling rate).
The spectrum of this sampled signal will be then
2fmX(/a) repeated after every 2am.
Frequency normalization (contd.)
It is not difficult to check that the sets of samples
obtained in both cases are exactly same.
So, the spectrum of the digital signal should also be
identical.
This will require normalization of the frequency.
Frequency normalization by dividing the frequency axis
by the sampling rate in each case will give same plot for
the spectrum in both cases repeated after 2 radians.
Discrete time Fourier transform
DTFT is used to obtain the spectrum of a signal
discretized in time.
Recall FS representation of the spectrum for a sampled

signal.
X ( f ) x(nTs )e j 2nTs f
n

Periodicity = sampling frequency.


FS coefficients = sample values.
We may write x[nTs ] x[n]

And we have 2fTs 2 f


f
s
Discrete time Fourier transform
Then we can write the expression for the spectrum as

X () x[n] exp jn
n

This is the expression for DTFT.


Calculated for non-periodic discrete-time signal.
Spectrum contains continuum of frequencies
continuous function of .
Unlike continuous-time FT, DTFT is periodic function in
with period 2 (prove it) This is what is expected from
our previous discussion.
Discrete time Fourier transform
DTFT turns out to be FS representation of the periodic
function X().
Inverse DTFT gives the FS coefficients x[n] in line
with our expectation that inverse DTFT should give back
the time-discrete signal.
X () exp jnd
1
x[n]
2
Check that the function X() obtained via DTFT is
nothing but the spectrum X(f) sketched as a function of
(instead of f).
Check that X(f) is periodic with period fs and accordingly
X() is periodic with period 2.
Properties of DTFT
Linearity
Time and frequency shift
Scaling of sample number
Differentiation in frequency
Summation (in time domain)
Convolution and multiplication
Persevals relationship
Duality
Symmetry
Discrete time Fourier series
x[n] X [k ]exp jk 0 n
N 1

k 0

1 N 1
X [k ] x[n]exp jk 0 n
N n 0

Periodic signal fundamental frequency 0.


Contains discrete frequency components multiples of 0.
The multiplier 1 N in computing FS coefficients may
alternatively be used during inverse FS calculation or both
the equations may be multiplied by 1 N .
The location of the multiplier does not matter as long as the
multiplier product is 1 N .
Properties of DTFS

Linearity
Time and frequency shift
Scaling of sample number
Convolution and multiplication
Persevals theorem
Duality
Symmetry
More on scaling property
For scaling factor 1/L where L is an integer, samples are
spaced by L times more (as if the signal is stretched
along time axis by L times) with missing samples in-
between padded (interpolated) with zeroes process
called expansion / upsampling / interpolation.
For integral scaling factor M, only every M-th samples
are taken while others are dropped (as if the signal is
compressed along time axis by M times) process
called downsampling / decimation.
Scaling factor of the form M/L fractional interpolation
(M > L) or fractional decimation (M < L) achieved by
interpolation followed by decimation.
Decimation and interpolation can be commuted only
when M and L are relatively prime.
Decimation
1 M 1
2k
YD ()
M
X
M

x[n] M yD[n] k 0


M 1
1
yD [n] x[Mn] OR YD ( z )
M
X
k 0
z 1M
WM
k

Only every M-th samples are taken while others are


dropped
Essentially integral scaling in time domain by a factor M.
As if the signal is compressed along time axis by M
times, but sampled at same rate.
Process also called downsampling.
Decimation (contd.)
Sampling rate s = 2M Spectrum X() of the discrete-time signal
(Nyquist rate) fs

3s/2
3

s/2
m +
+
+s/2
m +3s/2
+3
4
2s 2
s 0 +2
+s +4s
+2

Sampling rateSpectrum
unchanged YD() of the decimated signal
Time scaling by a factor M


Here we take M = 3 1 1
1 2 2 ( M 1)
fM X X X M
s/M M M
1/M M M

3
Mms 0 + +3
+M+2 +5
2 +
+2s
m
+4 s +3
+6s
Decimation (contd.)

Sampling rate 0 = sSpectrum


/ M = 2M / Y
MD() of the decimated signal
(1 / M times of original sampling rate s)
fs / M

3
m0/2
3 0/2
+0/2
+ +3
+0/2
+3 m
40
2 20
0 +2
+0 +40
+2
Interpolation
x[k ] n kL

y I [ n]
x[n] L yI[n]
0 otherwise

YI () X L OR
YI ( z ) X z L

Essentially scaling in time domain by a factor 1/L where L


is an integer.
Samples are spaced by L times more (as if the signal is
stretched along time axis by L times) with missing
samples in-between padded (interpolated) with zeroes.
Process also called expansion / upsampling.
Interpolation (contd.)
Sampling rate s = 2M Spectrum X() of the discrete-time signal
(Nyquist rate) fs

3s/2
3

s/2
m +
+
+s/2
m +3s/2
+3
4
2s 2
s 0 +2
+s +4s
+2
Sample rate increased by Spectrum
Spectrum YYDD()
() of
ofthe
thediscrete-time
discrete-timesignal
signal
L times (L = 3)

3/L
3 /L
+/L
+ +3/L
+3
4/L
4 2/L
2 0
0 +2/L
+2 +4/L
+4
Interpolation filter
Interpolation generates images of the signal spectrum as
seen before.
Interpolation filter LP digital filter with cutoff frequency
/L that follows the interpolator to suppress all images.
Check that the output of interpolation filter is what we
would have got by sampling the original time-continuous
signal at a rate L times more.
So, interpolation filter essentially recovers actual signal
samples at L 1 in-between points that are zero-padded
(no wonder, it is quite possible).
In short.
Decimation / interpolation used for changing sampling
rate
Generate a new digital signal directly from the input
digital signal without the need for intermediate
reconstruction of the original continuous-time signal.
That is, change the input set of samples to a new set
of samples that would have been obtained if the
original continuous-time signal was sampled at the
modified sampling rate.
Decimation reduces sampling rate.
Interpolation increases sampling rate.
Decimator and interpolators are linear but time-varying
(LTV) systems.
In short.
Interpolation is increasing the sampling rate by an
integral factor L.
This may be done by inserting extra L 1 samples in
between every pair of input samples.
But, values of these sample (in the original
continuous-time signal) are not available in the input
digital signal.
So, in the first place we take these sample values as
zero.
Following this, an interpolation filter retrieves these
sample values.
Since here sampling rate is increased there is no
question of aliasing.
Decimation and interpolation
Interpolation results in compression of spectrum by L
times without any overlapping (no aliasing).
Decimation results in stretching of spectrum by M times
and may result in aliasing.
Fractional decimation scheme:

x[n] L yI[n] H(z) y2[n] M y [n]

Interpolation Filter

Decimation factor = M/L, Sampling rate increased by factor L/M


Alias-free decimation
There will be no aliasing due to decimation if
x[n] 0 for n 0, M , 2M ,........
Or, if the signal is bandlimited within the range

1 < < 1 + 2 /M.

To avoid aliasing due to sampling rate reduction,


sampling rate in the input digital signal should be at
least M times the Nyquist rate = 2Mm.
Accordingly, the input digital signal should be
bandlimited to the region || < /M.
Alias-free decimation example
BP digital signal: 1 < < 1 + 2 /M, say 1 = / 2
Decimation factor: M, say M = 3.
Spectrum X() before decimation

3 / 2 5 / 6 + / 2 +7 / 6 +5 / 2 +19 / 6
2 +2

Spectrum YD() after decimation

+3 / 2 +7 / 2 +11 / 2
+2 +4
Discrete Fourier transform (DFT)
DFT is used in approximating the spectrum for a finite
length sequence.
DTFT is good for theoretical spectrum analysis of digital
signal but not good for computer-aided analysis.
DFT provides practical approach to numerical
computation of DTFT for a finite length sequence.
Also, we may split an input signal in sets of N samples
and do analysis for each set (segment or frame)
separately.
N 1
X () x[n] exp jn x[n] exp jn
n 0
DFT continued
Approximation to X() is obtained by taking frequency
samples of X() at N equally spaced frequencies k =
2k / N, 0 k N 1.
Check that the DFT expression is same as the DTFS
expression.
That means, we do analysis in the DTFS manner.
That is, for a given set of N samples we calculate the
DTFT as if the signal is periodic with these N samples.
Therefore, one-dimensional DFT and inverse DFT
expressions are same as DTFS expressions given
before.
Sampling in frequency
Discuss frequency sampling in the light of what we have
studied in case of time sampling at Nyquist rate.

DTFT
N-length sequence Freq. continuous Spectrum
from to +
Periodic repetition DFT
Freq. sampling

Periodic signal with period N Discrete-frequency spectrum


DTFS

For better approximation we may go for M-point DFT (M


> N) by taking an M-length sequence created by zero
padding to the given N-length sequence discuss in the
light of time sampling at a rate greater than Nyquist rate.
Signal recovery from DFT
x[n] DTFT X() freq. sampling Y[k]

Y[k] IDFT y[n]

N 1

Y [k ] exp jk n
1
y[n] 0
N k 0

N 1


1
x[l ] exp jk l
0 exp jk 0 n
N k 0


1 N 1

x[l ] exp jk 0 (n l ) x[n mN ]
N k 0 m
Signal recovery from DFT (contd.)

y[n] is obtained by adding an infinite number of shifted


replicas of x[n], shifted by integer multiples of N sampling
instants.

For x[n] of length equal to or less than N, x[n] can be


recovered from y[n].

If length of x[n] greater than N, there is time-domain


aliasing and x[n] cannot be recovered from y[n].
DFT properties
Linearity
Symmetry:
For real x[n]: X k X * k X * N k

For imaginary x[n]: X k X * k X * N k

Circular shift: circular time-shift, circular frequency-shift.

xn X k , hn H k
Circular convolution

Y k X k H k yn hn N xn
Circular convolution
For M N, N-point circular convolution is different from
M-point circular convolution.
Circular convolution and linear convolution of two finite
length N-point sequences are not the same.
Circular convolution = one period of the linear
convolution of the periodic extensions of the two input
signals.
Circular convolution = linear convolution + time-aliasing.
yn xn* hn


xn N hn yn kN , n 0,1,....., N 1

System output from circular conv.
The input to a system is x[n] and the impulse response
of the system is h[n].
Then, the system output is y[n].
System output can be calculated by linear convolution of
x[n] and h[n] or by taking inverse DTFT of X()H().
Second option (freq. domain approach) better for large
length x[n] and h[n].
However, in computer we can only compute DFT / IDFT
and not DTFT / IDTFT.
But, IDFT of X[k]H[k] Gives circular convolution of x[n]
and h[n].
System output (contd.)
As said, circular convolution is periodic repetition of y[n]
with period N + time aliasing; where N is the number of
DFT points taken in computing DFT of x[n] and h[n].
That means y[n] can be obtained from the circular
convolution result if there is no time aliasing.
Length of x[n] = N1, length of h[n] = N2
Then, length of y[n] = N1 + N2 1
So, to avoid time aliasing, N N1 + N2 1.
2D DFT

Two-dimensional DFT and its inverse:

2D DFT: X [k , l ]
1 1 M 1 N 1

M N m 0 n 0 M
x[m, n]exp j 2 km ln
N


2D IDFT: x[m, n] X [k , l ]exp j 2 km ln
M 1 N 1

k 0 l 0 M N

Вам также может понравиться