Sie sind auf Seite 1von 8

%% script 1

t1=-20:1:20 ;
x1=[zeros(1,20),ones(1,1),zeros(1,20)];
figure(1);
stem(t1,x1,'fill'); %Plot discrete
sequence data
grid on;
axis([-20 20 0 3]);
xlabel('Temps indexé en n');
ylabel('amplitude');

%% script 2
t2=-10:10 ;
x2=[zeros(1,10),ones(1,11)];
figure(2);
stem(t2,x2); Plot discrete sequence
data
grid on;
axis([-10 10 -0.5 1.5]);
xlabel('n');
ylabel('amplitude');

%% script 3
t3=-1:1e-5:1 ;
x3=rectpuls(t3,0.05);rectangle of width
w
figure(3);
plot(t3,x3);
grid on;
axis([-0.1 0.1 -0.2 1.2]);
xlabel('temps (sec)');
ylabel('amplitude');

%% script 4
t4=-1:1e-5:1 ;
x4=tripuls(t4,0.04);triangular pulse of
width w
figure(4);
plot(t4,x4);
grid on;
axis([-0.1 0.1 -0.2 1.2]);
xlabel('temps(sec)');
ylabel('amplitude');
%% script 5
fs=10000;
t5=0:1/fs:1.5;
x5=sawtooth(2*pi*50*t5);
figure(5);
plot(t5,x5);
grid on;
axis([0 0.1 -1.2 1.2]);
xlabel('temps(sec)');
ylabel('amplitude');

%% script 6
fs=10000;
t5=0:1/fs:50;
x5=sawtooth(2*pi*t5,0.5);
figure(6);
plot(t5,x5);
grid on;
axis([0 10 -3 3]);
xlabel('temps(sec)');
ylabel('amplitude');
Pour N=20
B= [eye(5)] ;
C=[ones(5,2) zeros(5,3)] ;
D=[zeros(5,3) ones(5,2)] ;
G=[1 :5 ;6 :10 ;11 :15 ;16 :20 ;21:25] ;
E=G’ ;
A=[B C ;E D]
t=[0:0.001:(pi/2)];
x1=cos(2*pi*3*t);
x2=sin(2*pi*4*t);
figure
plot(t,x1,t,x2);
grid
axis([0 0.6 -1.5 1.5]);
legend('cos','sin');

t=[0:0.001:(pi/2)];
x1=1+cos(2*pi*3*t);
x2=sin(2*pi*4*t);
figure
plot(t,x1,t,x2);
grid
axis([0 0.6 -1.5 2]);
legend('cos','sin');

t=[0:0.001:(pi/2)];
x1=1+cos(2*pi*3*(t-
0.2));
x2=sin(2*pi*4*(t-0.3));
figure
plot(t,x1,t,x2);
grid
axis([0 0.6 -1.5 2]);
legend('cos','sin');
t=[0:0.001:(pi/2)];
x1=cos(2*pi*3*(t-0.2));
x2=sin(2*pi*4*(t-0.2));
figure
subplot(2,1,1);
plot(t,x1);
grid
subplot(2,1,2);
plot(t,x2);
grid

Das könnte Ihnen auch gefallen