?? demothree.m
字號:
%% Sampling & Signal Operations
%% Sampling
t1=[0:1/6:2];
x1=cos(2*pi*3*t1);
t2=[0:1/10:2];
x2=cos(2*pi*5*t2);
t3=[0:1/24:2];
x3=cos(2*pi*3*t3);
t4=[0:1/10:2];
x4=cos(2*pi*3*t4);
t5=[0:1/4:2];
x5=cos(2*pi*3*t5);
subplot(511);stem(t1,x1);axis([0 2 -1 1]);
title('Frequency f = 3Hz and Sampling Rate fs = 6 Hz');
subplot(512);stem(t2,x2);axis([0 2 -1 1]);
title('Frequency f = 5Hz and Sampling Rate fs = 10 Hz');
subplot(513);stem(t3,x3);axis([0 2 -1 1]);
title('Frequency f = 3Hz and Sampling Rate fs = 24 Hz');
subplot(514);stem(t4,x4);axis([0 2 -1 1]);
title('Frequency f = 3Hz and Sampling Rate fs = 10 Hz');
subplot(515);stem(t5,x5);axis([0 2 -1 1]);
title('Frequency f = 3Hz and Sampling Rate fs = 4 Hz');
grid on
%% Signal Operations
n1=[-7:5];
n2=[-4:8];
x1=sin(2*pi*0.1*n1);
x2=cos(2*pi*0.1*n2);
[y,n]=sigadd(x1.^2,n1,x2.^2,n2);
subplot(311)
stem(n1,x1)
axis([-10 10 -2 2])
subplot(312)
stem(n2,x2)
axis([-10 10 -2 2])
subplot(313)
stem(n,y)
axis([-10 10 -2 2])
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -