搜索
您的当前位置:首页正文

实验离散傅里叶变换的性质及应用

来源:爱够旅游网
个人收集整理-仅供参考

实验一离散傅里叶变换地性质及应用

一、实验目地

1.了解DFT地性质及其应用 2.熟悉MATLAB编程特点

二、实验仪器及材料

计算机,MATLAB软件

三、实验内容及要求

1.用三种不同地DFT程序计算x(n)R5(n)地256点离散傅里叶变换X(k),并比较三种程序计算机运行时间.

(1)编制用for loop语句地M函数文件dft1.m,用循环变量逐点计算X(k); (2)编写用MATLAB矩阵运算地M函数文件dft2.m,完成下列矩阵运算:

000WNWN X(0)WN X(1)012WN WN WN  0N12(N1)WNWNWNX(N1)x(0)x(1) (N1)(N1) WNx(N1)0WNWNN1(3)调用fft库函数,直接计算X(k);

(4)分别调用上述三种不同方式编写地DFT程序计算序列x(n)地离散傅里叶变换X(k),并画出相应地幅频和相频特性,再比较各个程序地计算机运行时间.b5E2R。 2.研究实序列地DFT特点及性质.

2rn/N)RN(n),若N128计算下列三种情况下序列地已知序列x(n)5cos(DFT地幅度、实部及虚部,并用图形表示相应地x(n),X(k),ReX(k),ImX(k).

(1)x(n)5cos(2rn/N),r5 (2)x(n)5cos(2rn/N),r4.4 (3)x(n)5cos(2rn/N),r0

3.利用DFT实现两序列地卷积运算,并研究DFT点数与混叠地关系. (1)已知两序列

x(n)R3(n)h(n)(n1)R5(n)

(2)用直接法(即用线性卷积地定义计算,见下式)计算线性卷积y(n)=x(n)*h(n)地结果,并以图形方式表示结果;p1Ean。 1 / 6

个人收集整理-仅供参考

 y(n)x(m)h(nm),   0nNM2

m0N1其中:序列x(n),(0nN1)和序列h(n),(0nM1)

(3)用MATLAB编制利用DFT计算线性卷积y(n)=x(n)*h(n)地程序;分别令圆周卷积地点数为L=5,6,7,8,以图形方式表示结果.DXDiT。 (4)对比直接法和圆周卷积法所得地结果.

clc; clear all; close all; N=256;

x=[ones(1,8),zeros(1,N-8)]; n=[0: (length(x)-1)]

t=cputime;[Am1,Pha1]=dft1(x);t1=cputime-t, t=cputime;[Am2,Pha2]=dft2(x);t2=cputime-t, t=cputime;[Am3,Pha3]=dft3(x);t3=cputime-t, sizex=4; sizeh=6; x=[1,2,3,4] h=[0,1,0,0,0,-2]; y=conv(x,h); figure(1) subplot(2,3,1) le1=0:1:sizex-1; stem(le1,x,'r'); title('x sequence') ylabel('x(n)') subplot(2,3,2) le2=0:1:sizeh-1; stem(le2,h);

title('h sequence') ylabel('h(n)') subplot(2,3,3)

le3=0:1:sizex+sizeh-2; stem(le3,y,'g')

title('y sequence by direct metod') ylabel('y(n)') LL=[6 9 12]; for n=1:3

L=LL(n);X=fft(x,L); H=fft(h,L); Y=X.*H

yFFT=ifft(Y,L);

2 / 6

个人收集整理-仅供参考

subplot(2,3,n+3) le3=0:1:L-1; stem(le3,yFFT); if (n==1)

title('y sequence by FFT L=6') elseif (n==2)

title('y sequemce by FFT L=9') elseif (n==3)

title('y sequence by FFT L=12') end end r=4.4 N=128;

n=0:N-1;x=5*cos(2*pi*r*n/N);

f1=1000*r/N,f2=1000*0/N,f3=1000*4.4/N X=fft(x,N); figure(2)

subplot(221);stem(n,x); subplot(222);stem(n,abs(X)); subplot(223);stem(n,real(X)); subplot(224);stem(n,imag(X));

n =

Columns 1 through 22

0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21RTCrp。 Columns 23 through 44

22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 435PCzV。 Columns 45 through 66

44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65jLBHr。 Columns 67 through 88

66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87xHAQX。 Columns 89 through 110

88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109LDAYt。 Columns 111 through 132

110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131Zzz6Z。 Columns 133 through 154

132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153dvzfv。 3 / 6

个人收集整理-仅供参考

Columns 155 through 176

154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175rqyn1。 Columns 177 through 198

176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197Emxvx。 Columns 199 through 220

198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219SixE2。 Columns 221 through 242

220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 2416ewMy。 Columns 243 through 256

242 243 244 245 246 247 248 249 250 251 252 253 254 255kavU4。 t1 = 0.7644 t2 = 0.6396 t3 = 0 x =

1 2 3 4 Y =

-10.0000 -9.5000 +11.2583i 3.5000 - 6.0622i -2.0000 3.5000 + 6.0622i -9.5000 -11.2583iy6v3A。 Y =

Columns 1 through 7

-10.0000 -7.4363 -21.7778i 4.5753 - 1.6805i 3.5000 - 6.0622i 4.3610 + 1.9108i 4.3610 - 1.9108i 3.5000 + 6.0622iM2ub6。 Columns 8 through 9

4.5753 + 1.6805i -7.4363 +21.7778i Y =

Columns 1 through 7

-10.0000 14.7942 -17.6244i -9.5000 +11.2583i -2.0000 - 2.0000i 3.5000 - 6.0622i -0.7942 + 6.6244i -2.0000 0YujC。 Columns 8 through 12

-0.7942 - 6.6244i 3.5000 + 6.0622i -2.0000 + 2.0000i -9.5000 -11.2583i 14.7942 +17.6244ieUts8。 r = 4.4000 f1 = 34.3750 f2 =

4 / 6

个人收集整理-仅供参考

0 f3 = 34.3750

5250200150010050-505010015000501001501004002000500-200-400-50050100150050100150

版权申明

本文部分内容,包括文字、图片、以及设计等在网上搜集整理.版权为个人所有

This article includes some parts, including text, pictures, and design. Copyright is personal ownership.sQsAE。 用户可将本文地内容或服务用于个人学习、研究或欣赏,以及其他非商业性或非盈利性用途,但同时应遵守著作权法及其他相关法律地规定,不得侵犯本网站及相关权利人地合法权利.除此以外,将本文任何内容或服务用于其他用途时,须征得本人及相关权利人地书面

5 / 6

个人收集整理-仅供参考

许可,并支付报酬.GMsIa。 Users may use the contents or services of this article for personal study, research or appreciation, and other non-commercial or non-profit purposes, but at the same time, they shall abide by the provisions of copyright law and other relevant laws, and shall not infringe upon the legitimate rights of this website and its relevant obligees. In addition, when any content or service of this article is used for other purposes, written permission and remuneration shall be obtained from the person concerned and the relevant obligee.TIrRG。

转载或引用本文内容必须是以新闻性或资料性公共免费信息为使用目地地合理、善意引用,不得对本文内容原意进行曲解、修改,并自负版权等法律责任.7EqZc。 Reproduction or quotation of the content of this article must be reasonable and good-faith citation for the use of news or informative public free information. It shall not misinterpret or modify the original intention of the content of this article, and shall bear legal liability such as copyright.lzq7I。

6 / 6

因篇幅问题不能全部显示,请点此查看更多更全内容

Top