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

7 Ansichten (letzte 30 Tage)
文杰 唐
文杰 唐 am 13 Jun. 2020
Bearbeitet: Jiahao CHANG am 19 Jun. 2020

Antworten (1)

Jiahao CHANG
Jiahao CHANG am 19 Jun. 2020
Bearbeitet: Jiahao CHANG am 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

Kategorien

Mehr zu 傅里叶分析和滤波 finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!