Final Biosignal Lab Report One and Two
Final Biosignal Lab Report One and Two
Final Biosignal Lab Report One and Two
EXPERIMENT: 1 and 2
SECTION ONE
Group members ID No
1.Bethlehem Mitiku…………………………………………………………RU4095/11
2.Eyerusalem Ayele…………………………………………………………RU3613/11
3.Ermias Assefa……………………………………………………………...RU3332/11
4.Firomsa Idris……………………………………………………………….RU3302/11
5.Melat Fiseha…………………………………………………………….…RU3967/1
6.Nuhamin Mekonnen……………………………………………..………...RU4255/11
GENERAL OBJECTIVE
The general objective of the experiment was to implement signal
processing methods in MATLAB.
SPECIFIC OBJECTIVE
The specific objective of the experiment was to;
To be familiar with MATLAB environment.
To implement continuous, exponential and other different functions
signal processing by using plot on MATLAB.
To implement folding, shifting and folding of a given signal in
MATLAB.
To understand how to implement convolution on MATLAB.
PROCEDURE
Before doing the experiment, we reviewed the basic concepts while using math
lab and identify the main windows that are found on MATLAB such as,
command window, workspace, command history and current window. In
addition to that we assigned different variables to examine the effect of who and
who’s in the workspace.
1
EXPERIMENT CONCEPT
2
B. Generation of sine wave MAT LAB code
3
Generation of cosine wave MATLAB code
t=0:0.1:10; %define interval x=cos(2*pi*t);
%define output x plot(t,x); %plot(x,y)
xlabel('time'); ylabel('Amplitude');
title('Cosine Wave');
out put
MATLAB code
n=-3:5 %define interval -3 up to 5 a1=0.8;
x1=a1.^n; %exponential
subplot(1,2,1); plot(n,x1); a2=1.2;
x2=a2.^n; subplot(1,2,2); plot(n,x2);
B
Out put
Exercise 1
C
MATLAB code
Out put:
D
Exercise 2
Output
5
Example 3: Discrete-time signal
Output:
6
Home work1:
MATLAB code
Output:
7
Home work 2
MATLAB Code:
Out put:
8
EXPERIMENT TWO
Example 1.shifting a non-function Discrte time signal
MATLAB code
n=0:8;
x=[0 1 5 2 1 3 6 4 5];
subplot(2,1,1); stem(n,x);
title('x(n) signal'); xlabel('n');
ylabel('x(n)');
m=n-2; %shift by 2 y=x;
subplot(2,1,2); stem(m,y);
title('y(n)=x(n+2) signal'); xlabel('n');
ylabel('y(n)');
output
9
Example 2 Folding discrete-time signal
MATLAB code
n=0:8;
x=[0 0 1 2 3 4 5 4 3];
subplot(2,1,1); stem(n,x);
title('x(n) signal');
m=-fliplr(n); %folding y=fliplr(x);
%folding subplot(2,1,2); stem(m,y);
title('y(n)=x(-n) signal')
output
10
Example 3 convolution MATLAB code
t=0:.01:5; h1=ones(size(t));
h2=2*exp(-2*t); y=conv(h1,h2); %
h(t)* x(t)
plot(0:.01:10,y); title('h_1(t)*h_2(t)');
output
11
MATLAB code
x=input('Enter the input sequence:'); %ask the user input n1=input('Enter the
input sequence interval:'); h=input('Enter the impulse responce;'); n2=input('Enter
the impulse responce interval:'); subplot(2,2,1); stem(n1,x); %instead of plot we use
stem xlabel('Time'); ylabel('Amplitude'); title('Input sequence'); subplot(2,2,2);
stem(n2,h); xlabel('Time'); ylabel('Amplitude'); title('Impulse sequence');
subplot(2,1,2);
n=min(n1)+min(n2):1:max(n1)+max(n2);
y=conv(x,h); stem(n,y); xlabel('Time');
ylabel('Amplitude'); title('Linear convolution');
disp(x);disp(h);disp(y);
Out put
Exercise 1
12
13
Homework 1 :Matlab code
Output:
Home work 2:
MAT Lab code
14
Output:
15
Conclusion
As we have observed from the above experiment, MATLAB allows the
most natural expression of computational mathematics for different types
of signals.
16