绘制如下锯齿波并给出它的时域波形和频谱图。
13 views (last 30 days)
Show older comments
Answers (1)
Jiahao CHANG
on 19 Jun 2020
Edited: Jiahao CHANG
on 19 Jun 2020
Hi 文杰,
关于实现您的问题的代码如下
T = 4; % Sampling period
Fs = 1/T; % Sampling frequency
L = 1500; % Length of signal
t = (0:L-1)*T/L; % Time vector
y2 = 2*t(1:find(t==1));
y2 = [y2,4-2*t(find(t==1)+1:find(t==3))];
y2 = [y2,2*t(find(t==3)+1:end)-8];
ff = fft(y2);
f = Fs*(0:L-1)/L;
figure
subplot(2,1,1);
plot(t,y2);
subplot(2,1,2);
stem(f,ff);
关于这一问题我建议您使用matlab的help命令搜索fft来获取快速傅里叶变换相关的命令及例子以便更好地完成您这边的任务。
祝您学业有成。
Jiahao CHANG
0 Comments
See Also
Categories
Find more on 频谱测量 in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!