Outline: Fourier Transforms and The Sampling Theorem
Outline: Fourier Transforms and The Sampling Theorem
1
2
f
1
2
< < /T /T
< F < F
s
/2 F
s
/2
AA, INF4480 (I/UiO) Sampling and reconstruction April 2011 5 / 82
Fourier transforms and the sampling theorem Fourier transforms
Fourier transforms
Discrete-Time Fourier Transform, DTFT;
X() = F{x[n]} =
n=
x[n]e
n
x[n] =
1
2
_
2
X()e
n
d
Continuous-Time Fourier Transform, CTFT:
X(F) = F{x(t )} =
_
x(t )e
2Ft
dt .
x(t ) = F
1
{X(F)} =
_
X(F)e
2Ft
dF.
Convolution integral:
y(t ) = x(t ) h(t ) y(t ) =
_
x()h(t )d.
H(t ): The Heaviside function (cont. time step-func.):
F{H(t )} =
_
H(t )e
2Ft
dt =
1
2
_
(t )
1
t
.
AA, INF4480 (I/UiO) Sampling and reconstruction April 2011 6 / 82
Fourier transforms and the sampling theorem Fourier transforms
Fourier transforms ...
Properties valid for DTFT are usually valid for CTFT;
F{f g} = F{f }F{g}.
F{f g} =
_
__
f ()g(t )d
_
e
2Ft
dt
=
_
[e
2F
f ()d][e
2F(t )
g(t )dt ]
=
__
e
2F
f ()d
_ __
e
2F( )
g( )d
_
= F{f }F{g}, (t ).
AA, INF4480 (I/UiO) Sampling and reconstruction April 2011 7 / 82
Fourier transforms and the sampling theorem Sampling and reconstruction of signals
Sampling of analog signals
Periodic or uniform sampling; described by
x[n] = x
a
(nT), < n < ,
where x[n] is the discrete-time signal obtained by taking samples
of analog signal x
a
(t ) every T second.
T; sampling period/interval, 1/T = F
s
; sampling rate/frequency;
t = nT =
n
Fs
.
AA, INF4480 (I/UiO) Sampling and reconstruction April 2011 8 / 82
Fourier transforms and the sampling theorem Sampling and reconstruction of signals
Sampling of analog signals (2)
The spectrum of x
a
(t ) (an aperiodic, nite energy signal), i.e. the CTFT;
X
a
(F) =
_
x
a
(t )e
2Ft
dt . (1)
x
a
(t ) can be recovered by the inverse CTFT
x
a
(t ) =
_
X
a
(F)e
2Ft
dF. (2)
The spectrum of x[n] (sampled version of x
a
(t )), i.e. the DTFT;
X() =
x[n]e
n
or X(f ) =
x[n]e
2fn
(3)
x[n] can be recovered by the inverse DTFT
x[n] =
1
2
_
X()e
n
d =
_ 1
2
1
2
X(f )e
2fn
df . (4)
AA, INF4480 (I/UiO) Sampling and reconstruction April 2011 9 / 82
Fourier transforms and the sampling theorem Sampling and reconstruction of signals
Sampling of analog signals (3)
To determine a relationship between the spectra of analog and
digital signals we use that t = nT =
n
Fs
and f =
F
Fs
:
x[n] x
a
(nT)
(2)
=
_
X
a
(F)e
2nF/Fs
dF
(4)
=
_ 1
2
1
2
X(f )e
2fn
df =
1
F
s
_ Fs
2
Fs
2
X(F)e
2nF/Fs
dF.
Due to the periodicity of e
2nFs/F
, we can write
_
dF as
k=
_
(k+1/2)Fs
(k1/2)Fs
dF...
AA, INF4480 (I/UiO) Sampling and reconstruction April 2011 10 / 82
Fourier transforms and the sampling theorem Sampling and reconstruction of signals
Sampling of analog signals (4)
We then have that
1
F
s
_ Fs
2
Fs
2
X(F)e
2nF/Fs
dF =
_
X
a
(F)e
2nF/Fs
dF
=
k=
_
(k+1/2)Fs
(k1/2)Fs
X
a
(F)e
2nF/Fs
dF
=
k=
_ Fs
2
Fs
2
X
a
(F kF
s
)e
2nF/Fs
dF
=
_ Fs
2
Fs
2
_
k=
X
a
(F kF
s
)
_
e
2nF/Fs
dF
which gives
X(F) = F
s
k=
X
a
(F kF
s
) or X(f ) = F
s
k=
X
a
((f k)F
s
) .
AA, INF4480 (I/UiO) Sampling and reconstruction April 2011 11 / 82
Fourier transforms and the sampling theorem Sampling and reconstruction of signals
Sampling of analog signals (5)
No aliasing if F
s
> 2B.
If so; x(t ) can be
reconstructed from
x[n].
If not; aliasing occur as
in (e).
AA, INF4480 (I/UiO) Sampling and reconstruction April 2011 12 / 82
Fourier transforms and the sampling theorem Sampling and reconstruction of signals
Reconstruction of analog signal
Given no aliasing, then
X
a
(F) =
_
1
Fs
X(F), |F| F
s
/2
0, |F| > F
s
/2
(5)
and analog signal can be reconstructed:
x
a
(t )
(2)
=
_
X
a
(F)e
2Ft
dF
(5)
=
1
F
s
_ Fs
2
Fs
2
X(F)e
2Ft
dF
(4)
=
1
F
s
_ Fs
2
Fs
2
_
n=
x[n]e
j 2Fn/Fs
_
e
j 2Ft
dF
=
1
F
s
n=
x[n]
_ Fs
2
Fs
2
e
j 2F(t n/Fs)
dF
=
n=
x
a
(nT)
sin[(/T)(t nT)]
(/T)(t nT)
.
AA, INF4480 (I/UiO) Sampling and reconstruction April 2011 13 / 82
Fourier transforms and the sampling theorem Sampling and reconstruction of signals
Reconstruction of analog signal (2)
Ideal interpolation formula: x
a
(t ) =
n=
x
a
(nT)
sin[(/T)(t nT)]
(/T)(t nT)
.
Involves the function g(t ) =
sin(/T)t
(/T)t
appropriately shifted by nT,
n = 0, 1, 2, . . ., and multiplied or weighted by the
corresponding samples x
a
(nT) of the signal.
AA, INF4480 (I/UiO) Sampling and reconstruction April 2011 14 / 82
Fourier transforms and the sampling theorem Sampling and reconstruction of signals
Folding ...
Time-freq. relationships ...
AA, INF4480 (I/UiO) Sampling and reconstruction April 2011 15 / 82
Fourier transforms and the sampling theorem Sampling and reconstruction of signals
Nonbandlimited signal (1)
AA, INF4480 (I/UiO) Sampling and reconstruction April 2011 16 / 82
Fourier transforms and the sampling theorem Sampling and reconstruction of signals
Nonbandlimited signal (2)
AA, INF4480 (I/UiO) Sampling and reconstruction April 2011 17 / 82
Sampling of bandpass signals
A bandlimited signal
%%
% Eksempel p? b?ndbegrenset si gnal :
%
% x ( t ) = a( t ) * si n ( 2 \ pi f _c t ) ;
%
% f _c : c ar r i erf r ekvens
% a( t ) : langsom var i er ende modul asj on
fs = 500; % Sampl i ngsf rekvens
Nsek = 2; % Ant al l sekunder
t = 0: 1/ fs : ( Nsek) ; % Ti d
f_c = 100; % Car r i er
an = 1 + 0. 5 * si n ( 2* pi *5*t) ; % Modul asj on
xn = an . * si n ( 2* pi *f_c*t) ; % Bandbegrenset si gnal
% Pl ot t av xn
f i gur e ( 1) ;
pl ot ( t, xn, ' o ' ) ; gr i d on
t i t l e ( ' Pl ot of bandl i mi t ed si gnal xn ' ) ; xl abel ( ' t i me [ sec ] ' ) ;
fname = ' BpSi gnTi d ' ;
cmd = [ ' p r i n t deps2c ' , fname, ' ; ' ] ;
eval ( cmd) ;
% cmd = [ ' epst opdf ' , fname , ' . eps ' ] ;
% uni x ( cmd) ;
% Pl ot t av spektrum t i l xn
f i gur e ( 2) ;
Hs = spectrum. periodogram( ' Hamming ' ) ;
psd( Hs, xn, ' Fs ' , fs, ' NFFT ' , 1024 , ' SpectrumType ' , ' t wosi ded ' , ' CenterDC ' ,
true) ;
axi s([fs/ 2 fs/ 2 100 0] )
fname = ' BpSi gnFrek ' ;
cmd = [ ' p r i n t deps2c ' , fname, ' ; ' ] ;
eval ( cmd) ;
%cmd = [ ' epst opdf ' , fname , ' . eps ' ] ;
%uni x ( cmd) ;
0 0.2 0.4 0.6 0.8 1 1.2 1.4 1.6 1.8 2
1.5
1
0.5
0
0.5
1
1.5
Plot of bandlimited signal xn
time [sec]
250 200 150 100 50 0 50 100 150 200 250
100
90
80
70
60
50
40
30
20
10
0
Frequency (Hz)
P
ow
er/frequency (dB
/H
z)
Periodogram Power Spectral Density Estimate
AA, INF4480 (I/UiO) Sampling and reconstruction April 2011 19 / 82
Sampling of bandpass signals
Example (Sampling of a complex bandlimited signal (1))
Given a complex bandpass analog
signal x
a
(t ) with nonzero Fourier
transform over the frequency range
[
1
,
2
].
What is the smallest sampling
frequency that can be used so that
x
a
(t ) can be recovered from its
samples x[n]?
Xa()
1 2
AA, INF4480 (I/UiO) Sampling and reconstruction April 2011 20 / 82
Sampling of bandpass signals
Example (Sampling of a complex bandlimited signal (2))
Obvious choice, the Nyquist rate: 2
2
.
But if x
a
(t ) is modulated, i.e.
y
a
(t ) = x
a
(t )e
(
2
+
1
)t /2
, then y
a
(t )
becomes a (complex) low-pass signal
with spectrum as seen below.
y
a
(t ) may be recovered from samples
taken at the sampling rate
2
0
=
2
1
.
Question to ask: Can x
a
(t ) be uniquely
recovered from its samples x
a
(nT
s
)
provided that T
s
1
?
Ya()
0 0
AA, INF4480 (I/UiO) Sampling and reconstruction April 2011 21 / 82
Sampling of bandpass signals
Example (Sampling of a complex bandlimited signal (3))
If x
a
(t ) is sampled with a sampling frequency
s
, the spectrum of
the sampled signal is
X
s
() =
1
T
s
k=
X
a
( k
s
).
In order to avoid interference between shifted spectra, we must
have that
s
1
or
s
2
1
.
X()
1
-3s
2
-3s
1
-2s
2
-2s
1
-s
2
-s
1
2
AA, INF4480 (I/UiO) Sampling and reconstruction April 2011 22 / 82
Sampling of bandpass signals
Example (Sampling of a complex bandlimited signal (4))
If
s
2
1
, then x
a
(t ) may be
uniquely reconstructed from x
s
(t )
using a bandpass lter with a
frequency response as shown to the
right.
If
s
=
2
1
, the reconstruction
lter is a complex bandpass lter with
impulse response
h
a
(t ) = T
s
sin(
s
t /2)
t
e
(
2
+
1
)t /2
Hr ()
Ts
1 2
AA, INF4480 (I/UiO) Sampling and reconstruction April 2011 23 / 82
Sampling of bandpass signals Representation of bandpass signals
Representation of bandpass signals (1)
Any real-valued bandpass signal x
a
(t ) can be represented by an
equivalent lowpass signal x
LP
(t ).
x
a
(t ): Real-valued bandpass signal with frequency concentrated
around F
c
.
If
+
is the signal containing the positive frequencies in x
a
(t ), then
x
a
(t ) can be represented by a low-frequency signal:
x
LP
(t ) = e
2Fct
+
(t ) (complex envelope of x
a
(t ))
= x
I
(t ) + x
Q
(t ) (in-phase & quadrature components)
= A(t )e
(t )
e
piFct
(envelope & phase)
AA, INF4480 (I/UiO) Sampling and reconstruction April 2011 24 / 82
Sampling of bandpass signals Representation of bandpass signals
Representation of bandpass signals (2)
To develop a mathematical representation of x
a
(t ); start with the
signal
+
(t ) containing the positive frequencies in x
a
(t ).
Then:
+
(F) = 2V
a
(F)X
a
(F),
where V
a
(F) is the Heaviside function and X
a
(F) = F[x
a
(t )].
The analytic signal or the pre-envelope of x
a
(t ) given as:
+
(t ) =
_
+
(F)e
j 2Ft
dF = F
1
[2V
a
(F)] F
1
[X
a
(F)]
=
_
(t ) +
j
t
_
x
a
(t ) = x
a
(t ) +j
1
t
x
a
(t )
AA, INF4480 (I/UiO) Sampling and reconstruction April 2011 25 / 82
Sampling of bandpass signals Representation of bandpass signals
Representation of bandpass signals (3)
+
(t ) = x
a
(t ) +j x
a
(t ),
x
a
(t ) =
1
t
x
a
(t ) =
1
xa()
t
d.
x
a
(t ) viewed as output of the lter with impulse response
h
Q
(t ) =
1
t
when excited by x
a
(t ).
Such lter called Hilbert transformer and
F[h
Q
(t )] = H
Q
(F) =
_
_
_
j F > 0
0 F == 0
j F < 0.
|H
Q
(F)| = 1 and (F) = /2, F > 0 and (F) = /2, F < 0,
i.e. 90
phase shift.
AA, INF4480 (I/UiO) Sampling and reconstruction April 2011 26 / 82
Sampling of bandpass signals Representation of bandpass signals
Representation of bandpass signals (4)
+
(t ) a bandpass signal;
lowpass repr. X
LP
(F) =
+
(F +F
c
)
x
LP
(t ) =
+
(t )e
j 2Fc t
= [x
a
(t ) +j x
a
(t )]e
j 2Fc t
= x
I
(t ) +jx
Q
(t ).
This gives (from x
a
(t ) +j x
a
(t ) = [x
I
(t ) +jx
Q
(t )]e
j 2Fc t
)
x
a
(t ) = x
I
(t ) cos 2F
c
t x
Q
(t ) sin 2F
c
t and
x(t ) = x
I
(t ) sin 2F
c
t +x
Q
(t ) cos 2F
c
t .
x
I
(t ) and x
Q
(t ): Low freq. amp. modulators.
x
I
(t ) and x
Q
(t ): quadrature components.
Alternatively:
x
a
(t ) = Re{[x
I
(t ) +jx
Q
(t )]e
j 2Fct
} = Re[x
LP
(t )e
j 2Fct
].
x
LP
(t ): Complex envelope of x
a
(t ) and it is the equivalent lowpass
signal.
AA, INF4480 (I/UiO) Sampling and reconstruction April 2011 27 / 82
Sampling of bandpass signals Representation of bandpass signals
Representation of bandpass signals (5)
x
I
(t ); Known as in-phase component
x
Q
(t ); Known as quadrature component
AA, INF4480 (I/UiO) Sampling and reconstruction April 2011 28 / 82
Sampling of bandpass signals Representation of bandpass signals
Representation of bandpass signals (6)
Letting x
LP
(t ) = A(t )e
j (t )
,
A(t ) =
_
x
2
I
(t ) +x
2
Q
(t ) and (t ) = tan
1
(x
Q
(t )/x
I
(t )),
then a third possible representation is
x
a
(t ) = Re[x
LP
(t )e
j 2Fct
] = A(t ) cos[2F
c
t + (t )].
A(t ): Envelope of x
a
(t ).
(t ): Phase of x
a
(t )
Fourier transform of x
a
(t ):
X
a
(F) =
_
x
a
(t )e
j 2Ft
dt
=
_
{Re[x
LP
(t )e
j 2Fct
]}e
j 2Ft
dt
=
1
2
_
[x
LP
(t )e
j 2Fct
+x
LP
(t )e
j 2Fct
]e
j 2Ft
dt
=
1
2
[X
LP
(F F
c
) +X
LP
(F F
c
)].
Any bandpass signal x
a
(t ) can be represented by an equivalent
lowpass signal x
LP
(t ).
AA, INF4480 (I/UiO) Sampling and reconstruction April 2011 29 / 82
Sampling of bandpass signals Sampling of bandpass signals
Sampling of bandpass signals (1)
Know: A signal with highest frequency B can uniquely be
represented by samples taken at the minimum (Nyquist) rate of
2B samples per second.
What if the signal is band limited; B
1
F B
2
:
or sample at 2 (B
2
B
1
)/2.
AA, INF4480 (I/UiO) Sampling and reconstruction April 2011 30 / 82
Sampling of bandpass signals Sampling of bandpass signals
Sampling of bandpass signals (2)
Integer band positioning (1)
Sampling of a bandpass signal at rate F
s
= 1/T produces a
sequence x[n] = x
a
(nT) with spectrum
X
a
(F) =
1
T
k=
X
a
(F kF
s
)
m = F
H
/B; band position.
No aliasing with F
s
= 2B.
AA, INF4480 (I/UiO) Sampling and reconstruction April 2011 31 / 82
Sampling of bandpass signals Sampling of bandpass signals
Sampling of bandpass signals (3)
Integer band positioning (2)
AA, INF4480 (I/UiO) Sampling and reconstruction April 2011 32 / 82
Sampling of bandpass signals Sampling of bandpass signals
Sampling of bandpass signals (4)
Integer band positioning (3)
Signal can be reconstructed as x
a
(t ) =
n=
x
a
(nT)g
a
(t nT)
where g
a
(t ) =
sin Bt
Bt
cos 2F
c
t
g
a
(t ) is equal to the ideal interpolation function for lowpass
signals, modulated by the carrier frequency F
c
.
By properly choosing the center frequency F
c
of G
a
(F), we can
reconstruct a continuous-time signal with spectral band centered
at F
c
= (kB +B/2), k = 0, 1, . . ..
+
(t ) = x
a
(t ) +j x(t ), x(t ) =
1
t
x
a
(t ) =
1
x()
t
d
Must sample x
a
(t ) and its Hilbert transform x(t ) and use complex
bandpass interpolation (as example given before).
Solution: Shift the signal by F
c
= (B
1
+B
2
)/2 for instant by
multiplying with the two quadrature carriers + lowpass lter and
sample each stream at 2 (B
2
B
1
)/2 i.e. represent the signal
with 2 (B
2
B
1
) samples per second.
AA, INF4480 (I/UiO) Sampling and reconstruction April 2011 36 / 82
Sampling of bandpass signals Sampling of bandpass signals
Sampling of bandpass signals (8)
Sampling using bandpass signal representation (2)
(u
c
(1) == x
I
(t ) and u
s
(t ) == x
Q
(t ))
AA, INF4480 (I/UiO) Sampling and reconstruction April 2011 37 / 82
Sampling of bandpass signals Sampling of bandpass signals
Sampling of bandpass signals (9)
Sampling using bandpass signal representation (3)
If F
c
+B/2 = kB, k pos. int., B = (B
2
B
1
) and 2B = 1/T;
x(nT) = x
I
(nT) cos(2F
c
nT) x
Q
(nT) sin(2F
c
nT)
= x
I
(nT) cos
n(2k 1)
2
x
Q
(nT) sin
n(2k 1)
2
m=
v(m)z
m
= X(z
I
).
V(w
y
) is an I-fold periodic repetition of X(w
x
).
v(m) must be passed through a lowpass lter H
I
(w
y
) to create the
up-sampled sequence
H
I
(w
y
) =
_
I, 0 |w
y
| /I
0, otherwise
AA, INF4480 (I/UiO) Sampling and reconstruction April 2011 43 / 82
Multirate digital signal processing Sampling rate conversion
Interpolation by a factor I (2)
AA, INF4480 (I/UiO) Sampling and reconstruction April 2011 44 / 82
Multirate digital signal processing Sampling rate conversion
Example (Up- and down-sampling)
A signal x[n] has Fourier transformation X() as shown in the gure below.
X()
0 /3/2
1
The signal is used as input to the systems I and II, which are dened in the
gure below:
I: x[n] 3 w
1
[n] H
0
(z) z
1
[n] 2 y
1
[n]
II: x[n] 2 w
2
[n] 3 z
2
[n] H
0
(z) y
2
[n]
M means downsampling by a factor M (keep every Mth sample) and
N means zero-interpolation by a factor N (insert N 1 zeros
between each sample). H
0
(z) is an ideal low-pass lter with a cut-off
frequency w
c
= /3 and gain equal to 2.
For both systems, sketch the Fourier transformation of the signals
w
1
[n], w
2
[n], z
1
[n], z
2
[n], y
1
[n] og y
2
[n].
AA, INF4480 (I/UiO) Sampling and reconstruction April 2011 45 / 82
Multirate digital signal processing Sampling rate conversion
Example (Up- and down-sampling)
W1()
/6 0 /3 /2
11
Z1()
/6 0 /3 /2
2
Y1()
/6 0 /3 /2
1
W2()
/6 0 /3 /2
1
1
2
Z2()
/6 0 /3 /2
1
2
Y2()
/6 0 /3 /2
1
AA, INF4480 (I/UiO) Sampling and reconstruction April 2011 46 / 82
Multirate digital signal processing Sampling rate conversion
Conversion by a rational factor I/D (1)
Cascade an interpolator with a decimator.
Remember: Up-sample rst, downsample second.
I =
L
i =1
I
i
D =
J
i =1
D
i