ImageVerifierCode 换一换
格式:DOCX , 页数:15 ,大小:59.13KB ,
资源ID:9608787      下载积分:1 金币
快捷下载
登录下载
邮箱/手机:
温馨提示:
快捷下载时,用户名和密码都是您填写的邮箱或者手机号,方便查询和重复下载(系统自动生成)。 如填写123,账号就是123,密码也是123。
特别说明:
请自助下载,系统不会自动发送文件的哦; 如果您已付费,想二次下载,请登录后访问:我的下载记录
支付方式: 支付宝    微信支付   
验证码:   换一换

加入VIP,免费下载
 

温馨提示:由于个人手机设置不同,如果发现不能下载,请复制以下地址【https://www.bingdoc.com/d-9608787.html】到电脑端继续下载(重复下载不扣费)。

已注册用户请登录:
账号:
密码:
验证码:   换一换
  忘记密码?
三方登录: 微信登录   QQ登录  

下载须知

1: 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。
2: 试题试卷类文档,如果标题没有明确说明有答案则都视为没有答案,请知晓。
3: 文件的所有权益归上传用户所有。
4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
5. 本站仅提供交流平台,并不能对任何下载内容负责。
6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

版权提示 | 免责声明

本文(matlab dtft dft等代码实验报告.docx)为本站会员(b****8)主动上传,冰点文库仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。 若此文所含内容侵犯了您的版权或隐私,请立即通知冰点文库(发送邮件至service@bingdoc.com或直接QQ联系客服),我们立即给予删除!

matlab dtft dft等代码实验报告.docx

1、matlab dtft dft等代码实验报告Laboratory Report of Digital Signal ProcessingLab II. Fourier analysis in MATLABName: 廖艺灵 No.: 5100309716 Date: 2013/4/6 SHANGHAI JIAOTONG UNIVERSITYDepartment of Instrument Science & EngineeringContent1 Introduction 12 Exercises 1Ex. 1 Create a Triangle Signal 1Ex. 2 CTFT And

2、CTFS 1Ex. 3 DTFT 1Ex. 4 DFT 13 Results and Discussion 2Ex. 1 Create a Triangle Signal 2Ex. 2 CTFT And CTFS 2Ex. 3 DTFT 4Ex. 4 DFT 54 Summary 75 Reference 76 Appendix 8Ex. 1 Create a Triangle Signal 8Ex. 3 DTFT 9Ex. 4 DFT 101 IntroductionThis lab concentrates mainly on the Fourier analysis in MATLAB.

3、 For each kind of signals, e.g. discrete or continuous time signals and periodic or non-periodic signals, the corresponding Fourier analysis may be Continuous-Time Fourier Series (CTFS), Discrete-Time Fourier Series (DTFS), Continuous-Time Fourier Transform (CTFT), Discrete-Time Fourier Transform (D

4、TFT) and Discrete Fourier Transform (DFT). Refer to the example which uses square signal as the input signal, we will use a triangle wave to achieve same goals, that is find its CTFS, DTFS, CTFT, DTFT and DFT to compare the differences between them. The Matlab codes for these Fourier analysis calcul

5、ations are provided in script files as follows.2 ExercisesEx. 1 Create a Triangle Signal1.1 Refer to mySquare.m, develop a sub-function myTriangle.m for a periodic isosceles triangle (see Fig. 1 as demonstration) with proper inputs and outputs. Provide the whole codes in the report appendix.1.2 Run

6、myTriangle.m to create a continuous periodic triangle with the height H = 1.5, length L = 2 and period T = 5. Show the result with at least 3 cycles.Fig. 1 Triangle WaveEx. 2 CTFT And CTFS2.1 Run CTFS.m for this periodic triangle and CTFT.m for only one triangle signal. Calculate and show the Fourie

7、r coefficients (including at least 99% average power) and spectrum (including at least 99% of energy), respectively.2.2 Explain the relationship between the CTFT and CTFS.Ex. 3 DTFT3.1 Refer to CTFT.m, develop DTFT.m for discrete-time Fourier transform. A discrete-time triangle signal obtained from

8、myTriangle is chosen as an example signal in DTFT. Provide the whole codes in the report appendix.3.2 Run DTFT.m of the sampled one triangle of Ex.1 with a sampling frequency of fs = 10. Show and compare the DTFT results with those from CTFT of the corresponding CT triangle. 3.3 Explain the relation

9、ship between the DTFT and CTFT.Ex. 4 DFT4.1 Refer to CTFT.m, develop a sub-function of myDFT.m for discrete Fourier transform with proper inputs and outputs. Provide the whole codes in the report appendix.4.2 Run DFT.m of the sampled one triangle of Ex.1 with a sampling frequency of fs = 10. Show an

10、d compare the DFT results with those from DTFT. 4.3 Explain the relationship between the DFT and DTFT.3 Results and DiscussionEx. 1 Create a Triangle SignalThe function codes are put in the appendix. Following is the output figure of the function.Fig. 2 The Triangle SignalEx. 2 CTFT And CTFS CTFTCTF

11、STime DomainContinuousAperiodicContinuousPeriodicFrequency DomainContinuousAperiodicDiscreteAperiodicBetween the CTFS and CTFT, we prefer to have the CTFT because it has all theinformation contained in the CTFS on the assumption that the CTFS consists ofthe samples of CTFT . Besides, the CTFS is not

12、 so practical because it is hard to find the period.Fig.3 Fourier Coefficients Fig.4 The Reconstructed Triangle Wave with 10-order Harmonics.Fig.5 Fourier Transform of a Continuous Triangle Signal.Ex. 3 DTFTCTFTDTFTTime DomainContinuousAperiodicDiscreteAperiodicFrequency DomainContinuousAperiodicCon

13、tinuousPeriodicthe DTFT of xn = x(nT ) is qualitatively the periodic extension of the CTFT of x(t) (with period 2/T in analog frequency or 2 in digital frequency ), the sum of infinitely many shifted version of CTFT. This explains how the DTFT strays from the CTFT because of frequency-aliasing Discr

14、ete-Time Fourier AnalysisFig.6 DTFT of a Triangle SignalEx. 4 DFTDTFTDFTTime DomainDiscreteAperiodicDiscreteAperiodicFrequency DomainContinuousPeriodicDiscretePeriodicDTFT after transformation frequency of a graphic is generally sequential, and interval sampling, such as DFT is DTFT is discrete poin

15、ts. From the said, you can see that its function is expressed as X (k), and DTFT function is expressed as the X (exp (jw). (here gives prominence to the sampling interval, such as DFT is DTFT DTFT frequency response is generally straight after the change, after DFT transform of frequency response is

16、 discrete).DTFT is 2 PI for the cycle. And sequence of DFT X(k) is limited.Fig.7 Comparison of DFT and DTFT of a Triangle Signal.4 SummaryWe could make a table to show the major feature of these Fourier transforms.CTFTCTFSDTFTDTFSDFTTime DomainContinuousAperiodicContinuousPeriodicDiscreteAperiodicDi

17、scretePeriodicDiscreteAperiodicFrequency DomainContinuousAperiodicDiscreteAperiodicContinuousPeriodicDiscretePeriodicDiscretePeriodicWhen analyze any signal, we should use proper Fourier transform to help us find the exact answer.5 Reference1 MATLAB Getting Started Guide COPYRIGHT 1984-2010 by The M

18、athWorks, Inc2 A.V. Oppenheim, A.S. Willsky and S.H. Nawab, Signals and Systems (Second Edition), Publishing House of Electrics Industry6 AppendixEx. 1 Create a Triangle Signal%=% MYTRIANGLE used to create a triangle wave with n cylces.% by Tramps, 30/03/2013 %=%function x,t = myTriangle(para)% inpu

19、t parametersparaDef = struct(H,1.5,T,5,L,2,n,3,fs,100);bDef = 0; % plot the signal? 0: no, 1: yes% no input parameterif nargin 1, para = paraDef; bDef = 1;end% get the parameters for the square signalif isstruct(para) H = para.H; T = para.T; L = para.L; n = para.n; fs = para.fs;else para = paraDef;

20、bDef = 1;end% create one period of the signaldt = 1/fs;tp = (-T/2+dt) : dt : T/2;xp = zeros(1,length(tp)lp = -L/2 : dt : L/2;for ii = 1:(length(lp)-1) xp(fs*(T-L)/2+ii) = H*(fs*L-ii)/fs; xp(fs*(T+L)/2-ii) = H*(fs*L-ii)/fs;end%plot(tp,xp);%return % Create all-time signal by replicating one cycle thro

21、ugh convolutionta = (-n*T/2+dt) : dt : n*T/2;xa = zeros(1,length(ta);for ii = 0:n-1 tmp = ii*fs*T; xa(tmp+1):(tmp+T*fs) = xp;end %plot(ta,xa);%return% output resultst = ta;x = xa; if(bDef) plot(t,x) set(gca,YLim,-H*0.1,H*1.1) title(Default Triangle Signal)end endEx. 3 DTFT%=% 1)Calculate the Discret

22、e-Time Fourier Transform(DTFT) of a triangle signal.% 2)Check the Parsevals relation for Fourier transform.% by Tramps, 30/03/2013 %=%clc,clear,close all% Create a triangle wave with just one cycle%(1) set parametersH = 1; % heightT = 5; % cycle timeL = 2; % lengthn = 1; % number of cycles(1.2.3.)fs

23、 = 10; % sampling frequency%(2) create the trianglepara = struct(H,H,T,T,L,L,n,n,fs,fs);xp,tp = myTriangle(para);%stem(tp,xp);% FTN = fs * T;k = -N:N;FT_w = -3*pi : 0.1 : 3*pi;DTFT_FT = 0;for ii = 1:N DTFT_FTtmp = xp(ii)*exp(-1j*FT_w*k(ii); DTFT_FT = DTFT_FT+DTFT_FTtmp;end % show resultsfigure;%subp

24、lot(211); % time domain stem(tp,xp,r);xlabel(t (s);ylabel(Amplitude);title(Discrete-Time Triangle Signal);grid on;%subplot(212); % frequency domainplot(FT_w/(2*pi),abs(DTFT_FT),r);xlabel(f);ylabel(|X(jomega)|);title(Spectrum(DTFT);grid on;% endEx. 4 DFT%=% DTFT vs DFT by triangle signal% by Tramps,

25、30/03/2013%=%clc,clear,close all% create a triangle signal%(1) set parametersH = 1; % heightT = 5; % cycle timeL = 2; % lengthn = 1; % number of cycles(1.2.3.)fs = 10; % sampling frequency%(2) create the signalspara = struct(H,H,T,T,L,L,n,1,fs,fs);x_D,t_D = myTriangle(para); %DTFT%stem(t_D,x_D);% DT

26、FTN = fs * T;k = -N:N;DTFT_w=-3*pi:0.1:3*pi;DTFT_FT = 0;for ii = 1:N DTFT_FTtmp = x_D(ii)*exp(-1j*DTFT_w*k(ii); DTFT_FT = DTFT_FT+DTFT_FTtmp;end%plot(DTFT_w/(2*pi),abs(DTFT_FT),r);% DFTN_DFT = 64;X_DFT,w,f = myDFT(x_D,N_DFT,100);%stem(w/(2*pi),abs(X_DFT),r);% show resultsfigure;%subplot(311);stem(t_

27、D,x_D,r); %DTFT time domainxlabel(t (s);ylabel(Amplitude);title(Discrete-Time Triangle Signal);grid on;%subplot(312);plot(DTFT_w/(2*pi),abs(DTFT_FT),r); %DTFT frequency domainxlabel(f);ylabel(|X(jomega)|);title(Spectrum(DTFT);grid on;%subplot(313);stem(w/(2*pi),abs(X_DFT),r); %DFT frequency domainxlabel(f);ylabel(|X(jomega)|);title(DFT);grid on; % end

copyright@ 2008-2023 冰点文库 网站版权所有

经营许可证编号:鄂ICP备19020893号-2