Upload
others
View
36
Download
1
Embed Size (px)
Citation preview
Decimation-in-frequency FFT algorithmThe decimation-in-time FFT algorithms are all based on structuring the DFT computation by forming smaller and smaller subsequences of the input sequence x[n]. Alternatively, we can consider dividing the output sequence X[k] into smaller and smaller subsequences in the same manner.
The even-numbered frequency samples are
1,...,1,0 ][][1
0−==∑
−
=
NkWnxkXN
n
nkN
∑∑∑−
=
−
=
−
=
+==1
)2/(
)2(1)2/(
0
)2(1
0
)2( ][][][]2[N
Nn
rnN
N
n
rnN
N
n
rnN WnxWnxWnxrX
∑∑−
=
+−
=
++=1)2/(
0
))2/((21)2/(
0
2 )]2/([][]2[N
n
NnrN
N
n
nrN WNnxWnxrX
Since
and
The above equation is the (N/2)-point DFT of the (N/2)-point sequence obtained by adding the first and the last half of the input sequence.
Adding the two halves of the input sequence represents time aliasing, consistent with the fact that in computing only the even-number frequency samples, we are sub-sampling the Fourier transform of x[n].
rnN
rNN
rnN
NnrN WWWW 22)]2/([2 ==+
2/2
NN WW =
1)2/(,...,1,0 )])2/([][(]2[1)2/(
02/ −=++= ∑
−
=
NrWNnxnxrXN
n
rnN
We now consider obtaining the odd-numbered frequency points:
Since
∑∑∑−
=
+−
=
+−
=
+ +==+1
)2/(
)12(1)2/(
0
)12(1
0
)12( ][][][]12[N
Nn
rnN
N
n
rnN
N
n
rnN WnxWnxWnxrX
)12(1)2/(
0
)12(1)2/(
0
)12)(2/(
1)2/(
0
)12)(2/(1
2/
)12(
)]2/([
)]2/([
)]2/([][
+−
=
+−
=
+
−
=
++−
=
+
∑
∑
∑∑
+−=
+=
+=
rnN
N
n
rnN
N
n
rNN
N
n
rNnN
N
Nn
rnN
WNnx
WNnxW
WNnxWnx
We obtain
The above equation is the (N/2)-point DFT of the sequence obtained by subtracting the second half of the input sequence from the first half and multiplying the resulting sequence by WN
n.
Let g[n] = x[n]+x[n+N/2] and h[n] = x[n]−x[x+N/2], the DFT can be computed by forming the sequences g[n] and h[n], then computing h[n] WN
n, and finally computing the (N/2)-point DFTsof these two sequences.
1)2/(,...,1,0 ])2/[][(
])2/[][(]12[
2/
1)2/(
0
1)2/(
0
)12(
−=+−=
+−=+
∑
∑−
=
−
=
+
NrWWNnxnx
WNnxnxrX
nrN
N
n
nN
N
n
rnN
Butterfly structure for decimation-in-frequency FFT algorithm:
The decimation-in-frequency FFT algorithm also has the computation complexity of O(N log2N)
Chirp Transform Algorithm (CTA)This algorithm is not optimal in minimizing any measure of computational complexity, but it has been used to compute anyset of equally spaced samples of the DTFT on the unit circle.
To derive the CTA, we let x[n] denote an N-point sequence and X(ejw) its DTFT. We consider the evaluation of M samples of X(ejw)that are equally spaced in angle on the unit cycle, at frequencies
)/2,1,...,1,0(
0
MwMk
wkwwk
π=Δ−=
Δ+=
When w0 =0 and M=N, we obtain the special case of DFT.
The DTFT values evaluated at wk are
with W defined as
we have
The Chirp transform represents X(ejwk) as a convolution:
To achieve this purpose, we represent nk as
1,...,1,0 ][)(1
0−==∑
−
=
− MkenxeXN
n
njwjw kk
wjeW Δ−=
1,...,1,0 ][)(1
0
0 −==∑−
=
− MkWenxeXN
n
nknjwjwk
])()[2/1( 222 nkknnk −−+=
Then, the DTFT value evaluated at wk is
Letting
we can then write
To interpret the above equation, we obtain more familiar notation by replacing k by n and n by k:
X(ejwk) corresponds to the convolution of the sequence g[n] with the sequence W−n2/2.
∑−
=
−−−=1
0
2/)(2/2/ 2220][)(
N
n
nkknnjwjw WWWenxeX k
2/20][][ nnjw Wenxng −=
1,...,1,0 ][)(1
0
2/)(2/ 22
−=⎟⎠
⎞⎜⎝
⎛= ∑
−
=
−− MkWngWeXN
n
nkkjwk
1,...,1,0 ][)(1
0
2/)(2/ 22
−=⎟⎠
⎞⎜⎝
⎛= ∑
−
=
−− MnWkgWeXN
k
knnjwn
The block diagram of the chirp transform algorithm is
Since only the outputs of n=0,1,…,M−1 are required, let h[n] be the following impulse response with finite length (FIR filter):
Then ⎪⎩
⎪⎨⎧ −≤≤−−=
−
otherwiseMnNWnh
n
01)1(][
2/2
( ) 1,...,1,0 ][][)( 2/2
−=∗= MnnhngWeX njwn
The block diagram of the chirp transform algorithm for FIR is
Then the output y[n] satisfies that
Evaluating frequency responses using the procedure of chirp transform has a number of potential advantages:
We do not require N=M as in the FFT algorithms, and neither N nor M need be composite numbers. => The frequency values can be evaluated in a more flexible manner.
The convolution involved in the chirp transform can still be implemented efficiently using an FFT algorithm. The FFT size must be no smaller than (M+N−1). It can be chosen, for example, to be an appropriate power of 2.
1,...,1,0 ][)( −== MnnyeX njw
In the above, the FIR filter h[n] is non-causal. For certain real-time implementation it must be modified to obtain a causal system. Since h[n] is of finite duration, this modification is easily accomplished by delaying h[n] by (N−1) to obtain a causal impulse response:
and the DTFT transform values are
In hardware implementation, a fixed and pre-specified causal FIR can be implemented by certain technologies, such as charge-coupled devices (CCD) and surface acoustic wave (SAW) devices.
⎪⎩
⎪⎨⎧ −+==
+−−
otherwiseNMnWnh
Nn
02,...,1,0][
2/)1(
1
2
1,...,1,0 ]1[)( 1 −=−+= MnNnyeX njw
Two-dimensional Transform Revisited(c.f. Fundamentals of Digital Image Processing, A. K. Jain, Prentice
Hall, 1989)
One-dimensional orthogonal (unitary) transforms
v=Au →
u = A*T v = AH v →
where A*T = A−1, i.e., AAH = AHA = I. That is, the columns of AH
form a set of orthonormal bases, and so are the columns of A.
The vector ak* ≡ {ak,n*, 0≤ n ≤ N−1} are called the basis vector of A. The series coefficients v[k] give a representation of the original sequence u[k], and are useful in filtering, data compression, feature extraction, and other analysis.
10 ][][1
0, −≤≤=∑
−
=
NknuakvN
nnk
10 ][][1
0, −≤≤=∑
−
=
∗ NnkvanuN
knk
Two-dimensional orthogonal (unitary) transformsLet {u[m,n]} be an n×n image.
where {ak,l[m,n]}, called an image transform, is a set of complete orthonormal discrete basis functions satisfying the properties:
Orthonormality:
where δ[a,b] is the 2D delta function, which is one only when a=b=0, and is zero otherwise.
1,0 ],[],[],[
1,0 ],[],[],[
1
0
1
0,
1
0
1
0,
−≤≤=
−≤≤=
∑∑
∑∑−
=
−
=
∗
−
=
−
=
Nnmnmalkvnmu
Nlknmanmulkv
N
k
N
llk
N
m
N
nlk
]','[]','[],[
]','[],[],[
,
1
0
1
0,
','
1
0
1
0,
nnmmnmanma
llkknmanma
lk
N
k
N
llk
lk
N
m
N
nlk
−−=
−−=
∗−
=
−
=
∗−
=
−
=
∑∑
∑∑
δ
δ
V = {v[k,l]} is called the transformed image.The orthonormal property assures that any expansion of the basis images
will be minimized by the truncated series
When P=Q=N, the error of minimization will be zero.
Separable Unitary TransformsThe number of multiplications and additions required to compute the transform coefficients v[k,l] is O(N4), which is quite excessive.
The dimensionality can be reduced to O(N3) when the transform is restricted to be separable.
NQNPnmalkvnmu lk
P
m
Q
nQP ≤≤= ∗
−
=
−
=∑∑ , ],[],['],[ ,
1
0
1
0,
],[],[' lkvlkv =
A transform {ak,l[m,n]} is separable iff for all 0≤k,l,m,n≤N−1, it can be decomposed as follows:
where A ≡ {a[k,m]} and B ≡ {b[l,n]} should be unitary matrices themselves, i.e., AAH = AHA = I and BBH = BHB = I .
Often one choose B to be the same as A, so that
Hence, we can simplify the transform as
V = AUAT, and U = A*TVA*
where V = {v[k,l]} and U = {u[m,n]}.
][][ ],[, nbmanma lklk =
][],[][],[
][],[][],[
1
0
1
0
1
0
1
0
∑∑
∑∑−
=
−
=
∗∗
−
=
−
=
=
=
N
k
N
llk
N
m
N
nlk
nalkvmanmu
nanmumalkv
A more general form: for an M×N rectangular image, the transform pair is
V = AMUANT, and U = AM*TUAN*
where AM and AN are M×M and N×N unitary matrices, respectively. themselves, i.e., AAH = AHA = I and BBH = BHB = I.
These are called two-dimensional separable transforms. The complexity in computing the coefficient image is O(N3).
The computation can be decomposed as computing T=UAT
first, and then compute V= AT (for an N×N image)
Computing T=UAT requires N2 inner products (of N-point vectors). Each inner product requires N operations, and so in total O(N3).
Similarly, V= AT also requires O(N3) operations, and finally we need O(N3) to compute V.
A closer look at T=UAT:
Let the rows of U be {U1, U2, …, UN}. Then
T=UAT = [U1T, U2
T, …, UNT]TAT = [U1AT, U2AT, …, UNAT] T.
Note that each UiAT (i=1 … N) is a one-dimensional unitary transform. That is, this step performs N one-dimensional transforms for the rows of the image U, obtaining a temporary image T.
Then, the step V= AT performs N 1-D unitary transforms on the columns of T.
Totally, 2N 1-D transforms are performed. Each 1-D transform is of O(N2).
Remember that the two-dimensional DFT is
where
The 2D DFT is separable, and so it can be represented as
V = FUF
where F is the N×N matrix with the element of k-th row and n-th element be
F =
∑∑
∑∑−
=
−
=
−−
−
=
−
=
=
=
1
0
1
0
1
0
1
0
],[1],[
],[1],[
N
k
N
l
nlN
mkN
N
m
N
n
lnN
kmN
WWlkvN
nmu
WWnmuN
lkv
)/2( NjN eW π−=
1,0, 1−≤≤
⎭⎬⎫
⎩⎨⎧ NnkW
Nkn
N
Fast computation of two-dimensional DFT:
According to V = FUF, it can be decomposed as the computation of 2N 1-D DFTs.
Each 1-D DFT requires N×log2N computations.
So, the 2-D DFT can be efficiently implemented in time complexity of O(N2×log2N )
2-D DFT is inherent in many properties of 1-D DFT (e.g., conjugate symmetry, shifting, scaling, convolution, etc.). A property not from the 1-D DFT is the rotation property.
Rotation property: if we represent (m,n) and (k,l) in polar coordinate,
and
then
That is, the rotation of an image implies the rotation of its DFT.
)sin,cos(),( θθ rrnm = )sin,cos(),( ϕϕ wwlk =
],[],[ θϕθθ Δ+⇔Δ+ wvruDFT
• Until now, we have assumed that the signals are deterministic, i.e., each value of a sequence is uniquely determined.
• In many situations, the processes that generate signals are so complex as to make precise description of a signal extremely difficult or undesirable.
• A random or stochastic signal is considered to be characterized by a set of probability density functions.
Discrete-time Random Signals(c.f. Oppenheim, et al., 1999)
• Random (or stochastic) process (or signal)– A random process is an indexed family of random
variables characterized by a set of probability distribution function.
– A sequence x[n], −∞<n< ∞. Each individual sample x[n]is assumed to be an outcome of some underlying random variable Xn.
– The difference between a single random variable and a random process is that for a random variable the outcome of a random-sampling experiment is mapped into a number, whereas for a random process the outcome is mapped into a sequence.
Stochastic Processes
• Probability density function of x[n]:
• Joint distribution of x[n] and x[m]:
• Eg., x1[n] = Ancos(wn+φn), where An and φn are random variables for all −∞ < n < ∞, then x1[n] is a random process.
Stochastic Processes (continue)
( )nxp n ,
( )mxnxp mn ,,,
• x[n] and x[m] are independent iff
• x is a stationary process iff
for all k.• That is, the joint distribution of x[n] and x[m]
depends only on the time difference m − n.
Independence and Stationary
( ) ( ) ( )mxpnxpmxnxp mnmn ,,,,, =
( ) ( )mxnxpkmxknxp mnkmkn ,,,,,, =++ ++
• Particularly, when m = n for a stationary process:
It implies that x[n] is shift invariant.
Stationary (continue)
( ) ( )nxpknxp nkn ,, =++
• In many of the applications of discrete-time signal processing, random processes serve as models for signals, in the sense that a particular signal can be considered a sample sequence of a random process.
• Although such a signals are unpredictable –making a deterministic approach to signal representation is inappropriate – certain average properties of the ensemble can be determined, given the probability law of the process.
Stochastic Processes vs. Deterministic Signal
• Mean (or average)
• ε denotes the expectation operator
• For independent random variables
Expectation
{ } ( )∫∞
∞−== nnnnx dxnxpxxm
n,ε
( ){ } ( ) ( )∫∞
∞−= nnnn dxnxpxgxg ,ε
{ } { } { }mnmn yxyx εεε =
• Mean squared value
• Variance
Mean Square Value and Variance
( )∫∞
∞−= nnnn dxnxpxx ,22}{ε
{ }⎭⎬⎫
⎩⎨⎧ −=
2
nxnn mxx εvar
• Autocorrelation
• Autocovariance
Autocorrelation and Autocovariance
{ }( )∫ ∫
∞
∞−
∞
∞−
∗
∗
=
=
mnmnmn
mnxx
dxdxmxnxpxx
xxn,m
,,,
εφ }{
( )( ){ }∗−=
−−=
mn
mn
xxxx
xmxnxx
mmn,m
mxmxn,m
}{
}{
φ
εγ *
• For a stationary process, the autocorrelation is dependent on the time difference m − n.
• Thus, for stationary process, we can write
• If we denote the time difference by k, we have
Stationary Process
{ }( ){ }22
xnx
nxx
mx
xmmn
−=
==
εσ
ε
( ) ( ) { }∗+=+= nknxxxx xxnknk εφφ ,
• In many instances, we encounter random processes that are not stationary in the strict sense.
• If the following equations hold, we call the process wide-sense stationary (w. s. s.).
Wide-sense Stationary
{ }( ){ }22
xnx
nxx
mx
xmmn
−=
==
εσ
ε
( ) ( ) { }∗+=+= nknxxxx xxnknk εφφ ,
• For any single sample sequence x[n], define their time average to be
• Similarly, time-average autocorrelation is
Time Averages
[ ] [ ]∑−=
∞→ +=
L
LnLnx
Lnx
121lim
[ ] [ ] [ ] [ ]nxmnxL
nxmnxL
LnL
∗
−=∞→
∗ ∑ ++
=+12
1lim
• A stationary random process for which time averages equal ensemble averages is called an ergodic process:
Ergodic Process
[ ] xmnx =
[ ] [ ] [ ]mnxmnx xxφ=+ ∗
• It is common to assume that a given sequence is a sample sequence of an ergodic random process, so that averages can be computed from a single sequence.
Ergodic Process (continue)
[ ]
[ ]( )
[ ] [ ] [ ] [ ]∑
∑
∑
−
=
∗∗
−
=
−
=
+=+
−=
=
1
0
1
0
22
1
0
1
1
1
L
nL
L
nxx
L
nx
nxmnxL
nxmnx
mnxL
nxL
m
ˆ
ˆ
σ
In practice, we cannot compute with the limits, but instead the quantities.
Similar quantities are often computed as estimates of the mean, variance, and autocorrelation.
• Property 1:
Properties of correlation and covariance sequences
[ ] { }[ ] ( )( ){ }[ ] { }[ ] ( )( ){ }∗+
∗+
∗+
∗+
−−=
=
−−=
=
ynxmnxy
nmnxy
xnxmnxx
nmnxx
mymxm
yxm
mxmxm
xxm
εγ
εφ
εγ
εφ
[ ] [ ][ ] [ ] ∗−=
−=
yxxyxy
xxxxx
mmmm
mmm
φγ
φγ 2
• Property 2:
• Property 3
Properties of correlation and covariance sequences (continue)
[ ]
[ ] Variance 0
Value SquaredMean 0
2
2
==
=⎥⎦⎤
⎢⎣⎡=
xxy
nxx xE
σγ
φ
[ ] [ ] [ ] [ ][ ] [ ] [ ] [ ]mmmm
mmmm
xyxyxxxx
xyxyxxxx
∗∗
∗∗
=−=−
=−=−
γγγγ
φφφφ
• Property 4:
Properties of correlation and covariance sequences (continue)
[ ] [ ] [ ]
[ ] [ ] [ ]00
002
2
yyxxxy
yyxxxy
m
m
γγγ
φφφ
≤
≤
[ ] [ ][ ] [ ]0
0
xxxx
xxxx
m
m
γγ
φφ
≤
≤
• Property 5:– If
Properties of correlation and covariance sequences (continue)
[ ] [ ][ ] [ ]mm
mm
xxyy
xxyy
γγ
φφ
=
=
0nnn xy −=
• Since autocorrelation and autocovariancesequences are all (aperiodic) one-dimensional sequences, there Fourier transform exist and are bounded in |w|≤π.
• Let the Fourier transform (DTFT) of the autocorrelation and autocovariance sequences be
Fourier Transform Representation of Random Signals
[ ] ( ) [ ] ( )[ ] ( ) [ ] ( )jw
xyxyjw
xxxx
jwxyxy
jwxxxx
emem
emem
Γ↔Γ↔
Φ↔Φ↔
γγ
φφ
• Consider the inverse Fourier Transforms:
Fourier Transform Representation of Random Signals (continue)
[ ] ( )
[ ] ( ) dween
dween
jwnjwxxxx
jwnjwxxxx
∫
∫
−
−
Φ=
Γ=
π
π
π
π
πφ
πγ
21
21
• Consequently,
• Denote to be the power density spectrum (or power
spectrum) of the random process x.
Fourier Transform Representation of Random Signals (continue)
[ ]{ } [ ] ( )
[ ] ( )dwe
dwenx
jwxxxxx
jwxxxx
∫
∫
−
−
Γ==
Φ==
π
π
π
π
πγσ
πφε
210
210
2
2
( ) ( )jwxxxx ewP Φ=
• The total area under power density in [−π,π] is the total energy of the signal.
• Pxx(w) is always real-valued since φxx(n) is conjugate symmetric
• For real-valued random processes, Pxx(w) = Φxx(ejw)is both real and even.
Power Density Spectrum(using Fourier transform to represent a random signal)
[ ] [ ]{ } ( )dwePnxnxnx jwxxxx ∫−
∗ ===π
ππεφ
21][][0 2
• Consider a linear system with frequency response h[n]. If x[n] is a stationary random signal with mean mx, then the output y[n] is also a stationary random signal with mean mx equaling to
• Since the input is stationary, mx[n−k] = mx , and consequently,
Mean and Linear System
[ ] [ ]{ } [ ] [ ]{ } [ ] [ ]knmkhknxkhnynm xkk
y −=−== ∑∑∞
−∞=
∞
−∞=
εε
[ ] ( ) xj
kxy meHkhmm 0== ∑
∞
−∞=DC response
• If x[n] is a real and stationary random signal, the autocorrelation function of the output process is
• Since x[n] is stationary , ε{x[n−k]x[n+m−r] }depends only on the time difference m+k−r.
Stationary and Linear System
[ ] [ ] [ ]{ }
[ ] [ ] [ ] [ ]
[ ] [ ] [ ] [ ]{ }∑ ∑
∑ ∑∞
−∞=
∞
−∞=
∞
−∞=
∞
−∞=
−+−=
⎪⎭
⎪⎬⎫
⎪⎩
⎪⎨⎧
−+−=
+=+
k r
k r
yy
rmnxknxrhkh
rmnxknxrhkh
mnynymnn
ε
ε
εφ ,
• Therefore,
The output power density is also stationary.• Generally, for a LTI system having a wide-sense
stationary input, the output is also wide-sense stationary.
Stationary and Linear System (continue)[ ]
[ ] [ ] [ ]
[ ]m
rkmrhkh
mnn
yy
k rxx
yy
φ
φ
φ
=
−+=
+
∑ ∑∞
−∞=
∞
−∞=
,
• By substituting l = r−k,
where
• A sequence of the form of chh[l] is called a deterministic autocorrelation sequence.
Power Density Spectrum and Linear System
[ ] [ ] [ ] [ ] [ ]
[ ] ( )∑
∑ ∑∞
−∞=
∞
−∞=
∞
−∞=
−=
+−=
lhhxx
l kxxyy
lclm
klhkhkhlmm
φ
φφ
[ ] [ ] [ ]∑∞
−∞=
+=k
hh klhkhlc
• A sequence of the form of Chh[l], l = r−k,
where Chh(ejw) is the Fourier transform of chh[l].
• For real h,
• Thus
Power Density Spectrum and Linear System (continue)
( ) ( ) ( )jwxx
jwhh
jwyy eeCe Φ=Φ
[ ] [ ] [ ]( ) ( ) ( )jwjwjw
hh
hh
eHeHeC
lhlhlc∗=
−∗=
( ) ( )2jwjwhh eHeC =
• We have the relation of the input and the output power spectrums to be the following:
Power Density Spectrum and Linear System (continue)
( ) ( ) ( )jwxx
jwjwyy eeHe Φ=Φ
2
[ ]{ } [ ] ( )[ ]{ } [ ] ( ) ( )
output theofpower average total210
input theofpower average total210
22
2
=
Φ==
=Φ==
∫
∫
−
−
dweeHny
dwenx
jwxx
jwyy
jwxxxx
π
π
π
π
πφε
πφε
• Key property: The area over a band of frequencies, wa<|w|<wb, is proportional to the power in the signal in that band.
• To show this, consider an ideal band-pass filter. Let H(ejw) be the frequency of the ideal band pass filter for the band wa<|w|<wb.
• Note that |H(ejw)|2 and Φxx(ejw) are both even functions. Hence, after ideal low pass filtering,
Power Density Property
( ) ( ) ( ) ( )dweeHdweeH b
a
a
b
w
wjw
xxjww
wjw
xxjw ∫∫ Φ+Φ=
−
−
22
21
21
ππ
[ ] outputin power average0 =yyφ
• A white noise signal is a signal for which
– Hence, its samples at different instants of time are uncorrelated.
• The power spectrum of a white noise signal is a constant
• The concept of white noise is very useful in quantization error analysis.
White Noise (or White Gaussian Noise)
( ) 2x
jwxx e σ=Φ
[ ] [ ]mm xxx δσφ 2=
• The average power of a white-noise is therefore
• White noise is also useful in the representation of random signals whose power spectra are not constant with frequency.– A random signal y[n] with power spectrum Φyy(ejw) can
be assumed to be the output of a linear time-invariant system with a white-noise input.
White Noise (continue)
[ ] ( ) 22
21
210 xx
jwxxxx dwdwe σσ
ππφ
π
π
π
π ∫∫ −−==Φ=
( ) ( ) 22x
jwjwyy eHe σ=Φ
• The cross-correlation between input and output of a LTI system:
• That is, the cross-correlation between the input output is the convolution of the impulse response with the input autocorrelation sequence.
Cross-correlation
[ ] [ ] [ ]{ }
[ ] [ ] [ ]
[ ] [ ]∑
∑∞
−∞=
∞
−∞=
−=
⎪⎭
⎪⎬⎫
⎪⎩
⎪⎨⎧
−+=
+=
kxx
k
xy
kmkh
kmnxkhnx
mnynxm
φ
ε
εφ
• By further taking the Fourier transform on both sides of the above equation, we have
• This result has a useful application when the input is white noise with variance σx
2.
– These equations serve as the bases for estimating the impulse or frequency response of a LTI system if it is possible to observe the output of the system in response to a white-noise input.
Cross-correlation (continue)
( ) ( ) ( )jwxx
jwjwxy eeHe Φ=Φ
[ ] [ ] ( ) ( )jwx
jwxyxxy eHemhm 22 σσφ =Φ= ,