绘制如下锯齿波并给出它的时域波形和频谱图。

9 vues (au cours des 30 derniers jours)
文杰 唐
文杰 唐 le 13 Juin 2020
Modifié(e) : Jiahao CHANG le 19 Juin 2020

Réponses (1)

Jiahao CHANG
Jiahao CHANG le 19 Juin 2020
Modifié(e) : Jiahao CHANG le 19 Juin 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

Catégories

En savoir plus sur 傅里叶分析和滤波 dans Help Center et File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!