1、实验3 用FFT对信号作频谱分析实验3 用FFT对信号作频谱分析实验三:用FFT对信号作频谱分析 10.3.1 实验指导 1(实验目的 学习用FFT对连续信号和时域离散信号进行谱分析的方法,了解可能出现的分析 误差及其原因,以便正确应用FFT。 2. 实验原理 用FFT对信号作频谱分析是学习数字信号处理的重要内容。经常需要进行谱分析的信号是模拟信号和时域离散信号。对信号进行谱分析的重要问题是频谱分辨率D和分析误差。频谱分辨率直接和FFT的变换区间N有关,因为FFT能够实现的频率分辨率是,因此要求。可以根据此式选择FFT的变换区间N。误差主要来自于用FFT作频谱分析时,得到的是离散谱,而信号(周
2、期信号除外)是连续谱,只有当N较大时离散谱的包络才能逼近于连续谱,因此N要适当选择大一些。 周期信号的频谱是离散谱,只有用整数倍周期的长度作FFT,得到的离散谱才能代表周期信号的频谱。如果不知道信号周期,可以尽量选择信号的观察时间长一些。 对模拟信号进行谱分析时,首先要按照采样定理将其变成时域离散信号。如果是模拟周期信号,也应该选取整数倍周期的长度,经过采样后形成周期序列,按照周期序列的谱分析进行。 3(实验步骤及内容 (1)对以下序列进行谱分析。 选择FFT的变换区间N为8和16 两种情况进行频谱分析。分别打印其幅频特性曲线。 并进行对比、分析和讨论。 (2)对以下周期序列进行谱分析。 选择
3、FFT的变换区间N为8和16 两种情况分别对以上序列进行频谱分析。分别打印其幅频特性曲线。并进行对比、分析和讨论。 feel free to listen to their voices and help the masses solve problems, we were officially opened on May 10 12345 Mayor calls, formulated rules and regulations, equipped with a full-time staff, a 24-hour on-duty system, people to call to rece
4、ive, reply, action, reminders, feedback and so on. By year end, handled the crowd calls 1076, 94.7% feedback rate. By Mayor calls active coordination to solve a large number of bears on the immediate interests of the people and issues of great lives, but also for leadership research and decision to
5、collect a lot of good ideas and suggestions, by all sectors of the community alike. Second, start Municipal Government Affairs Hall built. On May 11, we built and launched the city-government lobby, were settled in 12 departments, strict implementation of first asking duty system, service system, sy
6、stem of gratuitous, receiving, internal coordination, head of the window handle, limited time concluded one-stop service. By the end of today to accept various types of 3,273, originally of up to 100%. Running Government Affairs Hall, the convenience of the masses, promoting open Government, improve
7、 the investment environment and solve their practical problems, and so did a lot of work, masses, serve the community for the Government to play a very good window, link, model. Third, create a city government public affairs network. We rely on the Government Web site, was completed on May 24, the p
8、rovinces first public affairs network. Over (3)对模拟周期信号进行谱分析 选择 采样频率 ,变换区间N=16,32,64 三种情况进行谱分析。分别打印其幅频特性,并进行分析和讨论。 4(思考题 (1)对于周期序列,如果周期不知道,如何用FFT进行谱分析, (2)如何选择FFT的变换区间,(包括非周期信号和周期信号) (3)当N=8时, 和 的幅频特性会相同吗,为什么,N=16 呢, 5(实验报告要求 (1)完成各个实验任务和要求。附上程序清单和有关曲线。 (2)简要回答思考题。 = %第10章实验3程序exp3.m % 用FFT对信号作频谱分析 c
9、lear all;close all %实验内容(1)= x1n=ones(1,4); %产生序列向量x1(n)=R4(n) M=8;xa=1:(M/2); xb=(M/2):-1:1; x2n=xa,xb; %产生长度为8的三角波序列x2(n) x3n=xb,xa; feel free to listen to their voices and help the masses solve problems, we were officially opened on May 10 12345 Mayor calls, formulated rules and regulations, equi
10、pped with a full-time staff, a 24-hour on-duty system, people to call to receive, reply, action, reminders, feedback and so on. By year end, handled the crowd calls 1076, 94.7% feedback rate. By Mayor calls active coordination to solve a large number of bears on the immediate interests of the people
11、 and issues of great lives, but also for leadership research and decision to collect a lot of good ideas and suggestions, by all sectors of the community alike. Second, start Municipal Government Affairs Hall built. On May 11, we built and launched the city-government lobby, were settled in 12 depar
12、tments, strict implementation of first asking duty system, service system, system of gratuitous, receiving, internal coordination, head of the window handle, limited time concluded one-stop service. By the end of today to accept various types of 3,273, originally of up to 100%. Running Government Af
13、fairs Hall, the convenience of the masses, promoting open Government, improve the investment environment and solve their practical problems, and so did a lot of work, masses, serve the community for the Government to play a very good window, link, model. Third, create a city government public affair
14、s network. We rely on the Government Web site, was completed on May 24, the provinces first public affairs network. Over X1k8=fft(x1n,8); %计算x1n的8点DFT X1k16=fft(x1n,16); %计算x1n的16点DFT X2k8=fft(x2n,8); %计算x1n的8点DFT X2k16=fft(x2n,16); %计算x1n的16点DFT X3k8=fft(x3n,8); %计算x1n的8点DFT X3k16=fft(x3n,16); %计算x
15、1n的16点DFT %以下绘制幅频特性曲线 subplot(2,2,1);mstem(X1k8); %绘制8点DFT的幅频特性图 title(1a) 8点DFTx_1(n);xlabel(/);ylabel(幅度); axis(0,2,0,1.2*max(abs(X1k8) subplot(2,2,3);mstem(X1k16); %绘制16点DFT的幅频特性图 title(1b)16点DFTx_1(n);xlabel(/);ylabel(幅度); axis(0,2,0,1.2*max(abs(X1k16) figure(2) subplot(2,2,1);mstem(X2k8); %绘制8点
16、DFT的幅频特性图 title(2a) 8点DFTx_2(n);xlabel(/);ylabel(幅度); axis(0,2,0,1.2*max(abs(X2k8) subplot(2,2,2);mstem(X2k16); %绘制16点DFT的幅频特性图 title(2b)16点DFTx_2(n);xlabel(/);ylabel(幅度); axis(0,2,0,1.2*max(abs(X2k16) subplot(2,2,3);mstem(X3k8); %绘制8点DFT的幅频特性图 title(3a) 8点DFTx_3(n);xlabel(/);ylabel(幅度); axis(0,2,0,
17、1.2*max(abs(X3k8) subplot(2,2,4);mstem(X3k16); %绘制16点DFT的幅频特性图 feel free to listen to their voices and help the masses solve problems, we were officially opened on May 10 12345 Mayor calls, formulated rules and regulations, equipped with a full-time staff, a 24-hour on-duty system, people to call to
18、 receive, reply, action, reminders, feedback and so on. By year end, handled the crowd calls 1076, 94.7% feedback rate. By Mayor calls active coordination to solve a large number of bears on the immediate interests of the people and issues of great lives, but also for leadership research and decisio
19、n to collect a lot of good ideas and suggestions, by all sectors of the community alike. Second, start Municipal Government Affairs Hall built. On May 11, we built and launched the city-government lobby, were settled in 12 departments, strict implementation of first asking duty system, service syste
20、m, system of gratuitous, receiving, internal coordination, head of the window handle, limited time concluded one-stop service. By the end of today to accept various types of 3,273, originally of up to 100%. Running Government Affairs Hall, the convenience of the masses, promoting open Government, im
21、prove the investment environment and solve their practical problems, and so did a lot of work, masses, serve the community for the Government to play a very good window, link, model. Third, create a city government public affairs network. We rely on the Government Web site, was completed on May 24,
22、the provinces first public affairs network. Over title(3b)16点DFTx_3(n);xlabel(/);ylabel(幅度); axis(0,2,0,1.2*max(abs(X3k16) %实验内容(2) 周期序列谱分析= N=8;n=0:N-1; %FFT的变换区间N=8 x4n=cos(pi*n/4); x5n=cos(pi*n/4)+cos(pi*n/8); X4k8=fft(x4n); %计算x4n的8点DFT X5k8=fft(x5n); %计算x5n的8点DFT N=16;n=0:N-1; %FFT的变换区间N=16 x4n
23、=cos(pi*n/4); x5n=cos(pi*n/4)+cos(pi*n/8); X4k16=fft(x4n); %计算x4n的16点DFT X5k16=fft(x5n); %计算x5n的16点DFT figure(3) subplot(2,2,1);mstem(X4k8); %绘制8点DFT的幅频特性图 title(4a) 8点DFTx_4(n);xlabel(/);ylabel(幅度); axis(0,2,0,1.2*max(abs(X4k8) subplot(2,2,3);mstem(X4k16); %绘制16点DFT的幅频特性图 title(4b)16点DFTx_4(n);xlab
24、el(/);ylabel(幅度); axis(0,2,0,1.2*max(abs(X4k16) subplot(2,2,2);mstem(X5k8); %绘制8点DFT的幅频特性图 title(5a) 8点DFTx_5(n);xlabel(/);ylabel(幅度); axis(0,2,0,1.2*max(abs(X5k8) feel free to listen to their voices and help the masses solve problems, we were officially opened on May 10 12345 Mayor calls, formulate
25、d rules and regulations, equipped with a full-time staff, a 24-hour on-duty system, people to call to receive, reply, action, reminders, feedback and so on. By year end, handled the crowd calls 1076, 94.7% feedback rate. By Mayor calls active coordination to solve a large number of bears on the imme
26、diate interests of the people and issues of great lives, but also for leadership research and decision to collect a lot of good ideas and suggestions, by all sectors of the community alike. Second, start Municipal Government Affairs Hall built. On May 11, we built and launched the city-government lo
27、bby, were settled in 12 departments, strict implementation of first asking duty system, service system, system of gratuitous, receiving, internal coordination, head of the window handle, limited time concluded one-stop service. By the end of today to accept various types of 3,273, originally of up t
28、o 100%. Running Government Affairs Hall, the convenience of the masses, promoting open Government, improve the investment environment and solve their practical problems, and so did a lot of work, masses, serve the community for the Government to play a very good window, link, model. Third, create a
29、city government public affairs network. We rely on the Government Web site, was completed on May 24, the provinces first public affairs network. Over subplot(2,2,4);mstem(X5k16); %绘制16点DFT的幅频特性图 title(5b)16点DFTx_5(n);xlabel(/);ylabel(幅度); axis(0,2,0,1.2*max(abs(X5k16) %实验内容(3) 模拟周期信号谱分析= figure(4) F
30、s=64;T=1/Fs; N=16;n=0:N-1; %FFT的变换区间N=16 x6nT=cos(8*pi*n*T)+cos(16*pi*n*T)+cos(20*pi*n*T); %对x6(t)16点采样 X6k16=fft(x6nT); %计算x6nT的16点DFT %将零频率移到频谱中心 X6k16=fftshift(X6k16); Tp=N*T;F=1/Tp; %频率分辨率F k=-N/2:N/2-1;fk=k*F; %产生16点DFT对应的采样点频率(以零频率为中心) subplot(3,1,1);stem(fk,abs(X6k16),.);box on %绘制8点DFT的幅频特性图
31、 title(6a) 16点|DFTx_6(nT)|);xlabel(f(Hz);ylabel(幅度); axis(-N*F/2-1,N*F/2-1,0,1.2*max(abs(X6k16) N=32;n=0:N-1; %FFT的变换区间N=16 x6nT=cos(8*pi*n*T)+cos(16*pi*n*T)+cos(20*pi*n*T); %对x6(t)32点采样 X6k32=fft(x6nT); %计算x6nT的32点DFT X6k32=fftshift(X6k32); %将零频率移到频谱中心 Tp=N*T;F=1/Tp; %频率分辨率F k=-N/2:N/2-1;fk=k*F; %产生16点DFT对应的采样点频率(以零频率为中心) feel free to listen to their voices and help the masses solve problems, we were officially opened on May 10 12345 Mayor calls, formulat
copyright@ 2008-2022 冰豆网网站版权所有
经营许可证编号:鄂ICP备2022015515号-1