《Josh 的复习总结之数字信号处理》系列文章目录:
Part 1——离散时间信号和系统分析基础
Part 2——离散傅里叶级数 DFS
Part 3——离散傅里叶变换 DFT
Part 4——快速傅里叶变换 FFT
Part 5——部分 FFT 蝶形图
Part 6——数字滤波器的基本结构
Part 7——数字滤波器设计
取离散傅里叶级数的主值,得离散傅里叶变换
X ( k ) = X ~ ( k ) R N ( k ) = ∑ n = 0 N − 1 x ( n ) W N k n , k = 0 , 1 , ⋯ , N − 1 X\left(k\right)=\widetilde{X}\left(k\right)R_N\left(k\right)=\sum_{n=0}^{N-1}{x\left(n\right)W_N^{kn}},\ \ k=0,1,\cdots,N-1 X(k)=X (k)RN(k)=n=0∑N−1x(n)WNkn, k=0,1,⋯,N−1 x ( n ) = x ~ ( n ) R N ( n ) = 1 N ∑ k = 0 N − 1 X ( k ) W N − k n , n = 0 , 1 , ⋯ , N − 1 x\left(n\right)=\widetilde{x}\left(n\right)R_N\left(n\right)=\frac{1}{N}\sum_{k=0}^{N-1}{X\left(k\right)W_N^{-kn}},\ \ n=0,1,\cdots,N-1 x(n)=x (n)RN(n)=N1k=0∑N−1X(k)WN−kn, n=0,1,⋯,N−1且 X ~ ( k ) = X ( ( k ) ) N , x ~ ( n ) = x ( ( n ) ) N \widetilde{X}\left(k\right)=X\left(\left(k\right)\right)_N,\widetilde{x}\left(n\right)=x\left(\left(n\right)\right)_N X (k)=X((k))N,x (n)=x((n))N。其中 R N ( n ) R_N\left(n\right) RN(n) 表示矩形序列,表示取主值; ( ( n ) ) N \left(\left(n\right)\right)_N ((n))N 表示 n n n 对 N N N 取余。
注:不同教材中取主值、取余的符号表述可能不同。
若令 X = [ X ( 0 ) X ( 1 ) ⋯ X ( N − 1 ) ] T , x = [ x ( 0 ) x ( 1 ) ⋯ x ( N − 1 ) ] T X=\left[\begin{matrix}X\left(0\right)&X\left(1\right)&\cdots&X\left(N-1\right)\\\end{matrix}\right]^\mathrm{T},x=\left[\begin{matrix}x\left(0\right)&x\left(1\right)&\cdots&x\left(N-1\right)\\\end{matrix}\right]^\mathrm{T} X=[X(0)X(1)⋯X(N−1)]T,x=[x(0)x(1)⋯x(N−1)]T,则 DFT 和 IDFT 可分别表示为
X = D N x , x = D N − 1 X X=D_Nx,\ \ x=D_N^{-1}X X=DNx, x=DN−1X其中 Vandermonde 矩阵
D N = [ 1 1 1 ⋯ 1 1 W N 1 W N 2 ⋯ W N ( N − 1 ) 1 W N 2 W N 4 ⋯ W N 2 ( N − 1 ) ⋮ ⋮ ⋮ ⋮ 1 W N ( N − 1 ) W N 2 ( N − 1 ) ⋯ W N ( N − 1 ) 2 ] D_N=\left[\begin{matrix}1&1&1&\cdots&1\\1&W_N^1&W_N^2&\cdots&W_N^{\left(N-1\right)}\\1&W_N^2&W_N^4&\cdots&W_N^{2\left(N-1\right)}\\\vdots&\vdots&\vdots&&\vdots\\1&W_N^{\left(N-1\right)}&W_N^{2\left(N-1\right)}&\cdots&W_N^{\left(N-1\right)^2}\\\end{matrix}\right] DN=⎣⎢⎢⎢⎢⎢⎢⎡111⋮11WN1WN2⋮WN(N−1)1WN2WN4⋮WN2(N−1)⋯⋯⋯⋯1WN(N−1)WN2(N−1)⋮WN(N−1)2⎦⎥⎥⎥⎥⎥⎥⎤ D N − 1 = 1 N [ 1 1 1 ⋯ 1 1 W N − 1 W N − 2 ⋯ W N − ( N − 1 ) 1 W N − 2 W N − 4 ⋯ W N − 2 ( N − 1 ) ⋮ ⋮ ⋮ ⋮ 1 W N − ( N − 1 ) W N − 2 ( N − 1 ) ⋯ W N − ( N − 1 ) 2 ] D_N^{-1}=\frac{1}{N}\left[\begin{matrix}1&1&1&\cdots&1\\1&W_N^{-1}&W_N^{-2}&\cdots&W_N^{-\left(N-1\right)}\\1&W_N^{-2}&W_N^{-4}&\cdots&W_N^{-2\left(N-1\right)}\\\vdots&\vdots&\vdots&&\vdots\\1&W_N^{-\left(N-1\right)}&W_N^{-2\left(N-1\right)}&\cdots&W_N^{-\left(N-1\right)^2}\\\end{matrix}\right] DN−1=N1⎣⎢⎢⎢⎢⎢⎢⎡111⋮11WN−1WN−2⋮WN−(N−1)1WN−2WN−4⋮WN−2(N−1)⋯⋯⋯⋯1WN−(N−1)WN−2(N−1)⋮WN−(N−1)2⎦⎥⎥⎥⎥⎥⎥⎤且有 D N − 1 = 1 N D N ∗ D_N^{-1}=\dfrac{1}{N}D_N^\ast DN−1=N1DN∗。
D F T [ a x 1 ( n ) + b x 2 ( n ) ] = a X 1 ( k ) + b X 2 ( k ) \mathrm{DFT}\left[ax_1\left(n\right)+{bx}_2\left(n\right)\right]=aX_1\left(k\right)+bX_2\left(k\right) DFT[ax1(n)+bx2(n)]=aX1(k)+bX2(k)
x ( n ) = 1 N [ ∑ k = 0 N − 1 X ∗ ( k ) W N n k ] ∗ , n = 0 , 1 , ⋯ , N − 1 x\left(n\right)=\frac{1}{N}\left[\sum_{k=0}^{N-1}{X^\ast\left(k\right)W_N^{nk}}\right]^\ast,\ \ n=0,1,\cdots,N-1 x(n)=N1[k=0∑N−1X∗(k)WNnk]∗, n=0,1,⋯,N−1证明:
1 N [ ∑ k = 0 N − 1 X ∗ ( k ) W N n k ] ∗ = 1 N [ ∑ k = 0 N − 1 X ( k ) W N − n k ] = x ( n ) \frac{1}{N}\left[\sum_{k=0}^{N-1}{X^\ast\left(k\right)W_N^{nk}}\right]^\ast=\frac{1}{N}\left[\sum_{k=0}^{N-1}{X\left(k\right)W_N^{-nk}}\right]=x\left(n\right) N1[k=0∑N−1X∗(k)WNnk]∗=N1[k=0∑N−1X(k)WN−nk]=x(n)
D F T [ 1 N X ( n ) ] = x ( − k ) = x ( N − k ) \mathrm{DFT}\left[\frac{1}{N}X\left(n\right)\right]=x\left(-k\right)=x\left(N-k\right) DFT[N1X(n)]=x(−k)=x(N−k)证明:
x ( − n ) = x ( N − n ) = 1 N ∑ k = 0 N − 1 X ( k ) W N − ( N − n ) k = 1 N ∑ k = 0 N − 1 X ( k ) W N n k ⟹ x ( − k ) = x ( N − k ) = ∑ n = 0 N − 1 [ X ( n ) N ] W N k n = D F T [ X ( n ) N ] \begin{aligned} &x\left(-n\right)=x\left(N-n\right)=\frac{1}{N}\sum_{k=0}^{N-1}{X\left(k\right)W_N^{-\left(N-n\right)k}}=\frac{1}{N}\sum_{k=0}^{N-1}{X\left(k\right)W_N^{nk}} \\ \Longrightarrow &x\left(-k\right)=x\left(N-k\right)=\sum_{n=0}^{N-1}{\left[\frac{X\left(n\right)}{N}\right]W_N^{kn}}=\mathrm{DFT}\left[\frac{X\left(n\right)}{N}\right] \end{aligned} ⟹x(−n)=x(N−n)=N1k=0∑N−1X(k)WN−(N−n)k=N1k=0∑N−1X(k)WNnkx(−k)=x(N−k)=n=0∑N−1[NX(n)]WNkn=DFT[NX(n)]
D F T [ x ( − n ) ] = X ( − k ) \mathrm{DFT}\left[x\left(-n\right)\right]=X\left(-k\right) DFT[x(−n)]=X(−k)证明:
D F T [ x ( − n ) ] = ∑ n = 0 N − 1 x ( − n ) W N n k = 令 m = − n ∑ m = − ( N − 1 ) 0 x ( m ) W N − m k = ∑ m = 0 N − 1 x ( m ) W N m ⋅ ( − k ) = X ( − k ) \mathrm{DFT}\left[x\left(-n\right)\right]=\sum_{n=0}^{N-1}{x\left(-n\right)W_N^{nk}}\xlongequal{令m=-n}\sum_{m=-\left(N-1\right)}^{0}{x\left(m\right)W_N^{-mk}}=\sum_{m=0}^{N-1}{x\left(m\right)W_N^{m\cdot\left(-k\right)}}=X\left(-k\right) DFT[x(−n)]=n=0∑N−1x(−n)WNnk令m=−nm=−(N−1)∑0x(m)WN−mk=m=0∑N−1x(m)WNm⋅(−k)=X(−k)
∑ n = 0 N − 1 x ( n ) = ∑ n = 0 N − 1 x ( n ) W N k n ∣ k = 0 = X ( k ) ∣ k = 0 = X ( 0 ) \sum_{n=0}^{N-1}x\left(n\right)=\left.\sum_{n=0}^{N-1}{x\left(n\right)W_N^{kn}}\right|_{k=0}\left.=X\left(k\right)\right|_{k=0}=X\left(0\right) n=0∑N−1x(n)=n=0∑N−1x(n)WNkn∣∣∣∣∣k=0=X(k)∣k=0=X(0)
x ( 0 ) = 1 N ∑ k = 0 N − 1 X ( k ) W N − k n ∣ n = 0 = 1 N ∑ k = 0 N − 1 X ( k ) x\left(0\right)=\frac{1}{N}\left.\sum_{k=0}^{N-1}{X\left(k\right)W_N^{-kn}}\right|_{n=0}=\frac{1}{N}\sum_{k=0}^{N-1}X\left(k\right) x(0)=N1k=0∑N−1X(k)WN−kn∣∣∣∣∣n=0=N1k=0∑N−1X(k)
将 N N N 点长序列 x ( n ) ( n = 1 , 2 , ⋯ , N − 1 ) x\left(n\right)\left(n=1,2,\cdots,N-1\right) x(n)(n=1,2,⋯,N−1) 补零延长 r N rN rN 点得到序列 g ( n ) g\left(n\right) g(n),即
g ( n ) = { x ( n ) , n = 0 , 1 , ⋯ , N − 1 0 , n = N , N + 1 , ⋯ r N − 1 g\left(n\right)= \begin{aligned} \begin{cases} x(n),&n=0,1,⋯,N-1\\ 0,&n=N,N+1,⋯rN-1 \end{cases} \end{aligned} g(n)={x(n),0,n=0,1,⋯,N−1n=N,N+1,⋯rN−1则 g ( n ) g\left(n\right) g(n) 的DFT
G ( k ) = D F T [ g ( n ) ] = ∑ n = 0 r N − 1 g ( n ) e − j 2 π n k r N = ∑ n = 0 N − 1 g ( n ) e − j 2 π n ( k r ) N = X ( k r ) , k = 0 , 1 , ⋯ , r N − 1 \begin{aligned} G\left(k\right)&=\mathrm{DFT}\left[g\left(n\right)\right]=\sum_{n=0}^{rN-1}{g\left(n\right)e^{-j\frac{2\pi nk}{rN}}}=\sum_{n=0}^{N-1}{g\left(n\right)e^{-j\frac{2\pi n\left(\frac{k}{r}\right)}{N}}} \\ &=X\left(\frac{k}{r}\right),\ \ k=0,1,\cdots,rN-1\ \end{aligned} G(k)=DFT[g(n)]=n=0∑rN−1g(n)e−jrN2πnk=n=0∑N−1g(n)e−jN2πn(rk)=X(rk), k=0,1,⋯,rN−1 由此, G ( k ) G\left(k\right) G(k) 与 X ( k ) X\left(k\right ) X(k)具有相同的形状,但 G ( k ) G\left(k\right) G(k) 的频谱间隔比 X ( k ) X\left(k\right) X(k) 的小。即通过补零,频谱变得更加细致。但是补零不能提高频谱分辨能力。
x ( ( n − m ) ) N R N ( n ) = { x ( n − m ) , m ⩽ n ⩽ N − 1 x ( N − m + n ) , 0 ⩽ n ⩽ m x\left(\left(n-m\right)\right)_NR_N\left(n\right)= \begin{aligned} \begin{cases} x\left(n-m\right),&m\leqslant n\leqslant N-1 \\ x\left(N-m+n\right),&0\leqslant n\leqslant m \end{cases} \end{aligned} x((n−m))NRN(n)={x(n−m),x(N−m+n),m⩽n⩽N−10⩽n⩽m
x ( ( − n ) ) N R N ( n ) = { x ( 0 ) , n = 0 x ( N − n ) , 1 ⩽ n ⩽ N − 1 x\left(\left(-n\right)\right)_NR_N\left(n\right)= \begin{aligned} \begin{cases} x\left(0\right),&n=0 \\ x\left(N-n\right),&1\leqslant n\leqslant N-1 \end{cases} \end{aligned} x((−n))NRN(n)={x(0),x(N−n),n=01⩽n⩽N−1
D F T [ x ( ( n + m ) ) N R N ( n ) ] = W N − m k X ( k ) \mathrm{DFT}\left[x\left(\left(n+m\right)\right)_NR_N\left(n\right)\right]=W_N^{-mk}X\left(k\right) DFT[x((n+m))NRN(n)]=WN−mkX(k)由此,有限长序列的圆周移位导致频谱线性相移,而对频谱幅度无影响。
I D F T [ X ( ( k + l ) ) N R N ( k ) ] = W N n l x ( n ) = e − j 2 π N n l x ( n ) \mathrm{IDFT}\left[X\left(\left(k+l\right)\right)_NR_N\left(k\right)\right]=W_N^{nl}x\left(n\right)=e^{-j\frac{2\pi}{N}nl}x\left(n\right) IDFT[X((k+l))NRN(k)]=WNnlx(n)=e−jN2πnlx(n)由此,时域序列的调制等效于频域的圆周移位,且可以推得
D F T [ x ( n ) cos ( 2 π n l N ) ] = 1 2 [ X ( ( k − l ) ) N + X ( ( k + l ) ) N ] R N ( k ) \mathrm{DFT}\left[x\left(n\right)\cos{\left(\frac{2\pi nl}{N}\right)}\right]=\frac{1}{2}\left[X\left(\left(k-l\right)\right)_N+X\left(\left(k+l\right)\right)_N\right]R_N\left(k\right) DFT[x(n)cos(N2πnl)]=21[X((k−l))N+X((k+l))N]RN(k) D F T [ x ( n ) sin ( 2 π n l N ) ] = 1 2 [ X ( ( k − l ) ) N − X ( ( k + l ) ) N ] R N ( k ) \mathrm{DFT}\left[x\left(n\right)\sin{\left(\frac{2\pi nl}{N}\right)}\right]=\frac{1}{2}\left[X\left(\left(k-l\right)\right)_N-X\left(\left(k+l\right)\right)_N\right]R_N\left(k\right) DFT[x(n)sin(N2πnl)]=21[X((k−l))N−X((k+l))N]RN(k)
奇序列的 DFT
x ( n ) = − x ( − n ) = − x ( ( − n ) ) N R N ( n ) → X ( k ) = − X ( − k ) = − X ( ( N − k ) ) N R N ( k ) x\left(n\right)=-x\left(-n\right)=-x\left(\left(-n\right)\right)_NR_N\left(n\right)\rightarrow X\left(k\right)=-X\left(-k\right)=-X\left(\left(N-k\right)\right)_NR_N\left(k\right) x(n)=−x(−n)=−x((−n))NRN(n)→X(k)=−X(−k)=−X((N−k))NRN(k)偶序列的 DFT
x ( n ) = x ( − n ) = x ( ( − n ) ) N R N ( n ) → X ( k ) = X ( − k ) = X ( ( N − k ) ) N R N ( k ) x\left(n\right)=x\left(-n\right)=x\left(\left(-n\right)\right)_NR_N\left(n\right)\rightarrow X\left(k\right)=X\left(-k\right)=X\left(\left(N-k\right)\right)_NR_N\left(k\right) x(n)=x(−n)=x((−n))NRN(n)→X(k)=X(−k)=X((N−k))NRN(k)
普通序列 x ( n ) x\left(n\right) x(n) 的共轭对称分量和共轭反对称分量分别为
x e ( n ) = 1 2 [ x ( n ) + x ∗ ( − n ) ] , x o ( n ) = 1 2 [ x ( n ) − x ∗ ( − n ) ] x_e\left(n\right)=\frac{1}{2}\left[x\left(n\right)+x^\ast\left(-n\right)\right],\ \ x_o\left(n\right)=\frac{1}{2}\left[x\left(n\right)-x^\ast\left(-n\right)\right] xe(n)=21[x(n)+x∗(−n)], xo(n)=21[x(n)−x∗(−n)]对有限长序列的 DFT 进行分析时,定义周期共轭对称分量和周期共轭反对称分量分别为
x e p ( n ) = 1 2 [ x ( ( n ) ) N + x ∗ ( ( − n ) ) N ] R N ( n ) = 1 2 [ x ( n ) + x ∗ ( N − n ) ] x_{ep}\left(n\right)=\frac{1}{2}\left[x\left(\left(n\right)\right)_N+x^\ast\left(\left(-n\right)\right)_N\right]R_N\left(n\right)=\frac{1}{2}\left[x\left(n\right)+x^\ast\left(N-n\right)\right] xep(n)=21[x((n))N+x∗((−n))N]RN(n)=21[x(n)+x∗(N−n)] x o p ( n ) = 1 2 [ x ( ( n ) ) N − x ∗ ( ( − n ) ) N ] R N ( n ) = 1 2 [ x ( n ) − x ∗ ( N − n ) ] x_{op}\left(n\right)=\frac{1}{2}\left[x\left(\left(n\right)\right)_N-x^\ast\left(\left(-n\right)\right)_N\right]R_N\left(n\right)=\frac{1}{2}\left[x\left(n\right)-x^\ast\left(N-n\right)\right] xop(n)=21[x((n))N−x∗((−n))N]RN(n)=21[x(n)−x∗(N−n)]二者关系为
x e p ( n ) = [ x e ( n ) + x e ( n − N ) ] R N ( n ) , x o p ( n ) = [ x o ( n ) + x o ( n − N ) ] R N ( n ) x_{ep}\left(n\right)=\left[x_e\left(n\right)+x_e\left(n-N\right)\right]R_N\left(n\right),\ \ x_{op}\left(n\right)=\left[x_o\left(n\right)+x_o\left(n-N\right)\right]R_N\left(n\right) xep(n)=[xe(n)+xe(n−N)]RN(n), xop(n)=[xo(n)+xo(n−N)]RN(n)
D F T [ x ∗ ( n ) ] = X ∗ ( ( N − k ) ) N \mathrm{DFT}\left[x^\ast\left(n\right)\right]=X^\ast\left(\left(N-k\right)\right)_N DFT[x∗(n)]=X∗((N−k))N D F T [ x ∗ ( − n ) ] = X ∗ ( k ) \mathrm{DFT}\left[x^\ast\left(-n\right)\right]=X^\ast\left(k\right) DFT[x∗(−n)]=X∗(k)证明:
D F T [ x ∗ ( n ) ] = ∑ n = 0 N − 1 x ∗ ( n ) W N k n = [ ∑ n = 0 N − 1 x ( n ) W N − k n ] ∗ = X ∗ ( − k ) = X ∗ ( ( N − k ) ) N \mathrm{DFT}\left[x^\ast\left(n\right)\right]=\sum_{n=0}^{N-1}{x^\ast\left(n\right)W_N^{kn}}=\left[\sum_{n=0}^{N-1}{x\left(n\right)W_N^{-kn}}\right]^\ast=X^\ast\left(-k\right)=X^\ast\left(\left(N-k\right)\right)_N DFT[x∗(n)]=n=0∑N−1x∗(n)WNkn=[n=0∑N−1x(n)WN−kn]∗=X∗(−k)=X∗((N−k))N D F T [ x ∗ ( − n ) ] = ∑ n = 0 N − 1 x ∗ ( − n ) W N k n = [ ∑ n = 0 N − 1 x ( − n ) W N − k n ] ∗ = [ ∑ m = − N + 1 0 x ( m ) W N k m ] ∗ = [ ∑ n = 0 N − 1 x ( n ) W N k n ] ∗ = X ∗ ( k ) \begin{aligned} \mathrm{DFT}\left[x^\ast\left(-n\right)\right]&=\sum_{n=0}^{N-1}{x^\ast\left(-n\right)W_N^{kn}}=\left[\sum_{n=0}^{N-1}{x\left(-n\right)W_N^{-kn}}\right]^\ast \\ &=\left[\sum_{m=-N+1}^{0}{x\left(m\right)W_N^{km}}\right]^\ast=\left[\sum_{n=0}^{N-1}{x\left(n\right)W_N^{kn}}\right]^\ast=X^\ast\left(k\right) \end{aligned} DFT[x∗(−n)]=n=0∑N−1x∗(−n)WNkn=[n=0∑N−1x(−n)WN−kn]∗=[m=−N+1∑0x(m)WNkm]∗=[n=0∑N−1x(n)WNkn]∗=X∗(k)
x ( n ) = x r ( n ) + j x i ( n ) x\left(n\right)=x_r\left(n\right)+jx_i\left(n\right) x(n)=xr(n)+jxi(n) ↕ ↕ \quad\quad\quad\updownarrow\qquad\quad \updownarrow ↕↕ X ( k ) = X e p ( k ) + X o p ( k ) X\left(k\right)=X_{ep}\left(k\right)+X_{op}\left(k\right) X(k)=Xep(k)+Xop(k)证明:
X e p ( k ) = D F T [ x r ( n ) ] = 1 2 D F T [ x ( n ) + x ∗ ( n ) ] = 1 2 [ X ( k ) + X ∗ ( N − k ) ] X_{ep}\left(k\right)=\mathrm{DFT}\left[x_r\left(n\right)\right]=\frac{1}{2}\mathrm{DFT}\left[x\left(n\right)+x^\ast\left(n\right)\right]=\frac{1}{2}\left[X\left(k\right)+X^\ast\left(N-k\right)\right] Xep(k)=DFT[xr(n)]=21DFT[x(n)+x∗(n)]=21[X(k)+X∗(N−k)] X o p ( k ) = D F T [ j x i ( n ) ] = 1 2 D F T [ x ( n ) − x ∗ ( n ) ] = 1 2 [ X ( k ) + X ∗ ( N − k ) ] X_{op}\left(k\right)=\mathrm{DFT}\left[{jx}_i\left(n\right)\right]=\frac{1}{2}\mathrm{DFT}\left[x\left(n\right)-x^\ast\left(n\right)\right]=\frac{1}{2}\left[X\left(k\right)+X^\ast\left(N-k\right)\right] Xop(k)=DFT[jxi(n)]=21DFT[x(n)−x∗(n)]=21[X(k)+X∗(N−k)]且由 3.8.5.3 共轭复序列的 DFT 可推知
X e p ( k ) = X e p ∗ ( N − k ) ( 实 部 相 等 , 虚 部 相 反 ) X_{ep}\left(k\right)=X_{ep}^\ast\left(N-k\right)\ \ \ (实部相等,虚部相反) Xep(k)=Xep∗(N−k) (实部相等,虚部相反) X o p ( k ) = − X o p ∗ ( N − k ) ( 实 部 相 反 , 虚 部 相 等 ) X_{op}\left(k\right)=-X_{op}^\ast\left(N-k\right)(实部相反,虚部相等) Xop(k)=−Xop∗(N−k)(实部相反,虚部相等)
x ( n ) x(n) x(n) | X ( k ) X(k) X(k) |
---|---|
偶 | 偶 |
奇 | 奇 |
实 | 实部为偶,虚部为奇 |
虚 | 实部为奇,虚部为偶 |
实偶 | 实偶 |
实奇 | 虚奇 |
虚偶 | 虚偶 |
虚奇 | 实奇 |
注:此处用 ⊙ \odot ⊙ 表示圆周卷积,不同教材中圆周卷积的符号表述可能不同。
x ( n ) = x 1 ( n ) ⊙ x 2 ( n ) = y ~ ( n ) = ∑ m = 0 N − 1 x 1 ( m ) [ x 2 ( ( n − m ) ) N R N ( n ) ] = I D F T [ X 1 ( k ) ⋅ X 2 ( k ) ] \begin{aligned} x\left(n\right)=x_1\left(n\right)\odot x_2\left(n\right)&=\widetilde{y}\left(n\right)=\sum_{m=0}^{N-1}{x_1\left(m\right)\left[x_2\left(\left(n-m\right)\right)_NR_N\left(n\right)\right]} \\ &=\mathrm{IDFT}\left[X_1\left(k\right)\cdot X_2\left(k\right)\right] \end{aligned} x(n)=x1(n)⊙x2(n)=y (n)=m=0∑N−1x1(m)[x2((n−m))NRN(n)]=IDFT[X1(k)⋅X2(k)]
X ( k ) = X 1 ( k ) ⊙ X 2 ( k ) = X ~ ( k ) R N ( k ) = 1 N ∑ l = 0 N − 1 X 1 ( l ) [ X 2 ( ( k − l ) ) N R N ( k ) ] = D F T [ x 1 ( n ) ⋅ x 2 ( n ) ] \begin{aligned} X\left(k\right)=X_1\left(k\right)\odot X_2\left(k\right)&=\widetilde{X}\left(k\right)R_N\left(k\right)=\frac{1}{N}\sum_{l=0}^{N-1}{X_1\left(l\right)\left[X_2\left(\left(k-l\right)\right)_NR_N\left(k\right)\right]} \\ &=\mathrm{DFT}\left[x_1\left(n\right)\cdot x_2\left(n\right)\right] \end{aligned} X(k)=X1(k)⊙X2(k)=X (k)RN(k)=N1l=0∑N−1X1(l)[X2((k−l))NRN(k)]=DFT[x1(n)⋅x2(n)]
长度为 L L L 的序列 x 1 ( n ) x_1\left(n\right) x1(n) 和长度为 M M M 的序列 x 2 ( n ) x_2\left(n\right) x2(n) 的周期卷积是二者的线性卷积的以 N N N 为周期的周期延拓,若满足
N ⩾ L + M − 1 N\geqslant L+M-1 N⩾L+M−1则周期卷积的主值序列即圆周卷积与线性卷积完全相同,即 x 1 ( n ) ⊙ x 2 ( n ) = x 1 ( n ) ∗ x 2 ( n ) x_1\left(n\right)\odot x_2\left(n\right)=x_1\left(n\right)\ast x_2\left(n\right) x1(n)⊙x2(n)=x1(n)∗x2(n)
y = h ⊙ x = [ h 1 0 ⋯ 0 h m ⋯ h 2 h 1 ⋯ 0 0 ⋯ ⋮ ⋮ ⋮ ⋮ ⋯ h m h m − 1 ⋯ 0 0 ⋯ 0 h m ⋯ h 1 0 ⋯ 0 0 ⋮ h 1 ⋯ ⋮ ⋮ h m − 1 ⋮ ⋯ 0 0 ⋯ h m h m − 1 ⋯ ] N × N ⋅ [ x 1 x 2 ⋮ x n 0 ⋮ 0 ] N × 1 y=h\odot x=\left[\begin{matrix}h_1&0&\cdots&0&h_m&\cdots\\h_2&h_1&\cdots&0&0&\cdots\\\vdots&\vdots&&\vdots&\vdots&\cdots\\h_m&h_{m-1}&\cdots&0&0&\cdots\\0&h_m&\cdots&h_1&0&\cdots\\0&0&&\vdots&h_1&\cdots\\\vdots&\vdots&&h_{m-1}&\vdots&\cdots\\0&0&\cdots&h_m&h_{m-1}&\cdots\\\end{matrix}\right]_{N\times N}\cdot\left[\begin{matrix}x_1\\x_2\\\vdots\\x_n\\0\\\vdots\\0\\\end{matrix}\right]_{N\times1} y=h⊙x=⎣⎢⎢⎢⎢⎢⎢⎢⎢⎢⎢⎢⎢⎢⎡h1h2⋮hm00⋮00h1⋮hm−1hm0⋮0⋯⋯⋯⋯⋯00⋮0h1⋮hm−1hmhm0⋮00h1⋮hm−1⋯⋯⋯⋯⋯⋯⋯⋯⎦⎥⎥⎥⎥⎥⎥⎥⎥⎥⎥⎥⎥⎥⎤N×N⋅⎣⎢⎢⎢⎢⎢⎢⎢⎢⎢⎢⎡x1x2⋮xn0⋮0⎦⎥⎥⎥⎥⎥⎥⎥⎥⎥⎥⎤N×1也可先计算线性卷积以 N N N 为周期进行周期化后取主值得到圆周卷积。注意周期化时 N < m + n − 1 N
例 已知序列
x ( n ) = { 2 , − 3 , 4 , 5 , − 6 , 7 , 8 , − 9 , − 10 , 11 , − 12 , − 13 , − 14 } ( 0 ⩽ n ⩽ 12 ) x\left(n\right)=\left\{2,-3,4,5,-6,7,8,-9,-10,11,-12,-13,-14\right\}\left(0\leqslant n\leqslant12\right) x(n)={2,−3,4,5,−6,7,8,−9,−10,11,−12,−13,−14}(0⩽n⩽12) h ( n ) = { 1 , − 2 , − 3 } ( 0 ⩽ n ⩽ 2 ) h\left(n\right)=\left\{1,-2,-3\right\}(0\leqslant n\leqslant2) h(n)={1,−2,−3}(0⩽n⩽2) 试分别用重叠相加法和重叠保留法计算线性卷积,取分段长度 L = 5 L=5 L=5。
解:①重叠相加法
将长序列 x ( n ) x\left(n\right) x(n) 分段,每段长度为 5 5 5
x 1 ( n ) = { 2 , − 3 , 4 , 5 , − 6 } x 2 ( n ) = { 7 , 8 , − 9 , − 10 , 11 } x 3 ( n ) = { − 12 , − 13 , − 14 } \begin{aligned} &x_1\left(n\right)=\left\{2,-3,4,5,-6\right\} \\ &x_2\left(n\right)=\left\{7,8,-9,-10,11\right\} \\ &x_3\left(n\right)=\left\{ -12,-13,-14\right\} \end{aligned} x1(n)={2,−3,4,5,−6}x2(n)={7,8,−9,−10,11}x3(n)={−12,−13,−14} 用圆周卷积计算计算各段与 h ( n ) h\left(n\right) h(n) 的线性卷积,下划线标注部分是需要重叠相加的部分
y 1 ( n ) = { 2 , − 7 , 4 , 6 , − 28 , − 3 , 18 ‾ } y 2 ( n ) = { 7 , − 6 ‾ , − 46 , − 16 , 58 , 8 , − 33 ‾ } y 3 ( n ) = { − 12 , 11 ‾ , 48 , 67 , 42 } \begin{aligned} &y_1\left(n\right)=\left\{2,-7,4,6,-28,\underline{-3,18}\right\}\\ &y_2\left(n\right)=\left\{\underline{7,-6},-46,-16,58,\underline{8,-33}\right\}\\ &y_3\left(n\right)=\left\{\underline{-12,11},48,67,42\right\} \end{aligned} y1(n)={2,−7,4,6,−28,−3,18}y2(n)={7,−6,−46,−16,58,8,−33}y3(n)={−12,11,48,67,42} 将各段结果重叠相加,连接成线性卷积结果
y ( n ) = { 2 , − 7 , 4 , 6 , − 28 , 4 , 12 , − 46 , − 16 , 58 , − 4 , − 22 , 48 , 67 , 42 } y\left(n\right)=\left\{2,-7,4,6,-28,\mathbf{4},\mathbf{12},-46,-16,58,-\mathbf{4},-\mathbf{22},48,67,42\right\} y(n)={2,−7,4,6,−28,4,12,−46,−16,58,−4,−22,48,67,42}
②重叠保留法
将长序列 x ( n ) x\left(n\right) x(n) 分段,每段长度为 5 5 5
x 1 ( n ) = { 0 , 0 , 2 ‾ , − 3 , 4 } x 2 ( n ) = { − 3 , 4 ‾ , 5 , − 6 , 7 } x 3 ( n ) = { − 6 , − 7 ‾ , 8 , − 9 , − 10 } x 4 ( n ) = { − 9 , − 10 ‾ , 11 , − 12 , − 13 } x 5 ( n ) = { − 12 , − 13 ‾ , − 14 , 0 , 0 } \begin{aligned} &x_1\left(n\right)=\left\{\underline{0,0,2},-3,4\right\}\\ &x_2\left(n\right)=\left\{\underline{-3,4},5,-6,7\right\}\\ &x_3\left(n\right)=\left\{\underline{-6,-7},8,-9,-10\right\}\\ &x_4\left(n\right)=\left\{\underline{-9,-10},11,-12,-13\right\}\\ &x_5\left(n\right)=\left\{\underline{-12,-13},-14,0,0\right\} \end{aligned} x1(n)={0,0,2,−3,4}x2(n)={−3,4,5,−6,7}x3(n)={−6,−7,8,−9,−10}x4(n)={−9,−10,11,−12,−13}x5(n)={−12,−13,−14,0,0} 用圆周卷积计算计算各段与 h ( n ) h\left(n\right) h(n) 的线性卷积,下划线标注部分是需要舍去的部分
y 1 ( n ) = { 1 , − 12 ‾ , 2 , − 7 , 4 } y 2 ( n ) = { 1 , − 11 ‾ , 6 , 28 , 4 } y 3 ( n ) = { 41 , 49 ‾ , 12 , − 46 , − 16 } y 4 ( n ) = { 53 , 47 ‾ , 58 , − 4 , − 22 } y 5 ( n ) = { − 12 , 11 ‾ , 48 , 67 , 42 } \begin{aligned} &y_1\left(n\right)=\left\{\underline{1,-12},2,-7,4\right\}\\ &y_2\left(n\right)=\left\{\underline{1,-11},6,28,4\right\}\\ &y_3\left(n\right)=\left\{\underline{41,49},12,-46,-16\right\}\\ &y_4\left(n\right)=\left\{\underline{53,47},58,-4,-22\right\}\\ &y_5\left(n\right)=\left\{\underline{-12,11},48,67,42\right\} \end{aligned} y1(n)={1,−12,2,−7,4}y2(n)={1,−11,6,28,4}y3(n)={41,49,12,−46,−16}y4(n)={53,47,58,−4,−22}y5(n)={−12,11,48,67,42} 将各段重叠部分舍去,连接成线性卷积结果
y ( n ) = { 2 , − 7 , 4 , 6 , − 28 , 4 , 12 , − 46 , − 16 , 58 , − 4 , − 22 , 48 , 67 , 42 } y\left(n\right)=\left\{2,-7,4,6,-28,4,12,-46,-16,58,-4,-22,48,67,42\right\} y(n)={2,−7,4,6,−28,4,12,−46,−16,58,−4,−22,48,67,42}
∑ n = 0 N − 1 x 2 ( n ) = 1 N ∑ k = 0 N − 1 ∣ X ( k ) ∣ 2 \sum_{n=0\ }^{N-1}{x^2\left(n\right)}=\frac{1}{N}\sum_{k=0}^{N-1}\left|X\left(k\right)\right|^2 n=0 ∑N−1x2(n)=N1k=0∑N−1∣X(k)∣2
X ( k ) = ∑ n = 0 N − 1 x ( n ) W N n k = ∑ n = 0 N − 1 x ( n ) e − j 2 π N n k = ∑ n = 0 N − 1 x ( n ) z − n ∣ z = e j 2 π N k = X ( z ) ∣ z = e j 2 π N k = ∑ n = 0 N − 1 x ( n ) e − j ω n ∣ ω = 2 π N k ( k = 0 , 1 , ⋯ , N − 1 ) \begin{aligned} X\left(k\right)&=\sum_{n=0}^{N-1}{x\left(n\right)W_N^{nk}}=\sum_{n=0}^{N-1}{x\left(n\right)e^{-j\frac{2\pi}{N}nk}}=\left.\sum_{n=0}^{N-1}{x\left(n\right)z^{-n}}\right|_{z=e^{j\frac{2\pi}{N}k}} \\ &=\left.X\left(z\right)\right|_{z=e^{j\frac{2\pi}{N}k}}=\left.\sum_{n=0}^{N-1}{x\left(n\right)e^{-j\omega n}}\right|_{\omega=\frac{2\pi}{N}k}\left(k=0,1,\cdots,N-1\right) \end{aligned} X(k)=n=0∑N−1x(n)WNnk=n=0∑N−1x(n)e−jN2πnk=n=0∑N−1x(n)z−n∣∣∣∣∣z=ejN2πk=X(z)∣z=ejN2πk=n=0∑N−1x(n)e−jωn∣∣∣∣∣ω=N2πk(k=0,1,⋯,N−1)因此 x ( n ) x\left(n\right) x(n) 的 DFT 的 N N N 个系数即为 x ( n ) x\left(n\right) x(n) 的 z z z 变换 X ( z ) X\left(z\right) X(z) 在单位圆上 N N N 等分的取样点。
设 M M M 点序列 x ( n ) x\left(n\right) x(n) 的 z z z 变换为 X ( z ) X\left(z\right) X(z),DTFT 为 X ( e j ω ) X\left(e^{j\omega}\right) X(ejω),则有
在 X ( z ) X\left(z\right) X(z) 的单位圆上均匀采样 N N N 点,其 IDFT 是序列 x ( n ) x\left(n\right) x(n) 以周期 N N N 进行周期延拓后的主值序列;
在 X ( e j ω ) X\left(e^{j\omega}\right) X(ejω) 的一个周期内均匀采样 N N N 点,其 IDFT 是序列 x ( n ) x\left(n\right) x(n) 以周期 N N N 进行周期延拓后的主值序列;
在 X ( e j ω ) X\left(e^{j\omega}\right) X(ejω) 的一个周期内均匀采样 M M M 点,其 IDFT 是序列 x ( n ) x\left(n\right) x(n) 本身。
由此,对于列长为M的有限长序列 x ( n ) x\left(n\right) x(n),频域取样不失真的条件是取样点数 N N N 满足
N ⩾ M N\geqslant M N⩾M并且对于无限长序列 x ( n ) x\left(n\right) x(n),无论 N N N 取值如何,都不可能消除混叠,只能随着取样点 N N N 增加而接近 x ( n ) x\left(n\right) x(n)。
用 DFT 表示 ZT
X ( z ) = ∑ n = 0 N − 1 x ( n ) z − n = ∑ n = 0 N − 1 [ 1 N ∑ k = 0 N − 1 X ( k ) W N − n k ] z − n = 1 N ∑ k = 0 N − 1 [ X ( k ) ∑ n = 0 N − 1 ( W N − k z − 1 ) n ] = 1 N ∑ k = 0 N − 1 X ( k ) 1 − W N − k n z − N 1 − W N − k z − 1 = 1 N ∑ k = 0 N − 1 X ( k ) 1 − z − N 1 − W N − k z − 1 = 1 − z − N N ∑ k = 0 N − 1 X ( k ) 1 − W N − k z − 1 = ∑ k = 0 N − 1 X ( k ) φ k ( z ) \begin{aligned} X\left(z\right)&=\sum_{n=0}^{N-1}{x\left(n\right)z^{-n}}=\sum_{n=0}^{N-1}{\left[\frac{1}{N}\sum_{k=0}^{N-1}{X\left(k\right)W_N^{-nk}}\right]z^{-n}}=\frac{1}{N}\sum_{k=0}^{N-1}\left[X\left(k\right)\sum_{n=0}^{N-1}\left(W_N^{-k}z^{-1}\right)^n\right] \\ &=\frac{1}{N}\sum_{k=0}^{N-1}{X\left(k\right)\frac{1-W_N^{-kn}z^{-N}}{1-W_N^{-k}z^{-1}}}=\frac{1}{N}\sum_{k=0}^{N-1}{X\left(k\right)\frac{1-z^{-N}}{1-W_N^{-k}z^{-1}}} \\ &=\frac{1-z^{-N}}{N}\sum_{k=0}^{N-1}\frac{X\left(k\right)}{1-W_N^{-k}z^{-1}}=\sum_{k=0}^{N-1}{X\left(k\right)\varphi_k\left(z\right)} \end{aligned} X(z)=n=0∑N−1x(n)z−n=n=0∑N−1[N1k=0∑N−1X(k)WN−nk]z−n=N1k=0∑N−1[X(k)n=0∑N−1(WN−kz−1)n]=N1k=0∑N−1X(k)1−WN−kz−11−WN−knz−N=N1k=0∑N−1X(k)1−WN−kz−11−z−N=N1−z−Nk=0∑N−11−WN−kz−1X(k)=k=0∑N−1X(k)φk(z)其中 X ( z ) X\left(z\right) X(z) 的内插公式
φ k ( z ) = 1 N ⋅ 1 − z − N 1 − W N − k z − 1 \varphi_k\left(z\right)=\frac{1}{N}\cdot\frac{1-z^{-N}}{1-W_N^{-k}z^{-1}} φk(z)=N1⋅1−WN−kz−11−z−N 用 DFT 表示 DTFT
X ( e j ω ) = X ( z ) ∣ z = e j ω = ∑ k = 0 N − 1 X ( k ) φ k ( e j ω ) = ∑ k = 0 N − 1 X ( k ) φ ( ω − k 2 π N ) X\left(e^{j\omega}\right)=\left.X\left(z\right)\right|_{z=e^{j\omega}}=\sum_{k=0}^{N-1}{X\left(k\right)\varphi_k\left(e^{j\omega}\right)}=\sum_{k=0}^{N-1}X\left(k\right)\varphi\left(\omega-k\frac{2\pi}{N}\right) X(ejω)=X(z)∣z=ejω=k=0∑N−1X(k)φk(ejω)=k=0∑N−1X(k)φ(ω−kN2π)其中内插函数
φ ( ω ) = 1 N sin ( ω N 2 ) sin ( ω 2 ) e − j ω ( N − 1 2 ) \varphi\left(\omega\right)=\frac{1}{N}\frac{\sin{\left(\frac{\omega N}{2}\right)}}{\sin{\left(\frac{\omega}{2}\right)}}e^{-j\omega\left(\frac{N-1}{2}\right)} φ(ω)=N1sin(2ω)sin(2ωN)e−jω(2N−1)时域取样定理说明,对频域带限的信号,可对其进行时域取样而不丢失任何信息。频域取样理论说明,时间有限的信号(有限长序列),也可对其进行频域取样(DFT)而不丢失任何信息。
时域采样会引起频谱周期化,通过 f s ⩾ 2 f h f_s\geqslant 2f_h fs⩾2fh 消除。
取用有限个数据,即将信号截断的过程,等同于将信号乘以窗函数。如果窗函数是矩形窗,在时域内将信号截断相当于乘以矩形窗,而在频域中则相当于原信号的频谱与矩形窗的频谱卷积,使得原信号的频谱被展宽,造成频谱泄露。通常通过选择频谱特性更接近于 δ ( k ) \delta\left(k\right) δ(k) 的函数来减少频谱泄露。
用 DFT 计算频谱时,采样点为基频的整数倍,由此观察到的频谱特征时有限的,若在两个取样点之间有剧烈的频谱变化,将无法检测出来。通常通过在原序列的末端添加一些零值点来改变周期内的点数,从而在保持原有频谱连续形式不变的情况下,变更了谱线的位置,原来看不到的频谱分量就能移动到可见的位置上。
f s ⩾ 2 f h f_s\geqslant 2f_h fs⩾2fh
T = 1 f s ⩽ 1 2 f h T=\frac{1}{f_s}\leqslant\frac{1}{2f_h} T=fs1⩽2fh1
F = f s N F=\frac{f_s}{N} F=Nfs F F F 越小,频率分辨率越高。
t p = 1 F = N T t_p=\frac{1}{F}=NT tp=F1=NT
N ⩾ 2 f h F N\geqslant\frac{2f_h}{F} N⩾F2fh
注:最高频率 f h f_h fh 和频率分辨率 F F F 存在矛盾,即
f h ↑ → f s ⩾ 2 f h f s ↑ → T = 1 f s T ↑ → N 给定时 t p ↓ ⟶ F ↑ ( 频率分辨率 ↓ ) f_h\uparrow \xrightarrow{f_s\geqslant 2f_h}f_s\uparrow \xrightarrow{T=\frac{1}{f_s}}T\uparrow \xrightarrow{N\text{给定时}}t_p\downarrow \longrightarrow F\uparrow \left( \text{频率分辨率}\downarrow \right) fh↑fs⩾2fhfs↑T=fs1T↑N给定时tp↓⟶F↑(频率分辨率↓)
上一篇:Part 2——离散傅里叶级数 DFS
下一篇:Part 4——快速傅里叶变换 FFT