You are on page 1of 1

N=128;

f1=150;
f2=450;
f3=1500;
fs=8000;
n=[0:1:N-1];
y1=sin(2*pi*f1*(n/fs));
y2=sin(2*pi*f2*(n/fs));
y3=sin(2*pi*f3*(n/fs));
y4=y1+y2;
y5=y1.*y3;
subplot(4,2,1);
stem(n,y1);
xlabel('sample');
ylabel('amplitude');
subplot(4,2,2);
stem(n,y3);
xlabel('sample');
ylabel('amplitude');
subplot(4,2,3);
stem(n,y4);
xlabel('sample');
ylabel('amplitude');
subplot(4,2,4);
stem(n,y5);
xlabel('sample');
ylabel('amplitude');
subplot(4,2,5);
stem(n+20,y1);
xlabel('sample');
ylabel('amplitude');
subplot(4,2,6);
stem(n-10,y1);
xlabel('sample');
ylabel('amplitude');

You might also like