Nothing Special   »   [go: up one dir, main page]

Final Biosignal Lab Report One and Two

Download as pdf or txt
Download as pdf or txt
You are on page 1of 19

JIMMA INSTITUTE OF TECHNOLOGY

THE SCHOOL OF BIOMEDICAL ENGINEERING

BIO SIGNAL PROCESSING LAB REPORT

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

Submitted to:Ms. Eden T.


Submission Date: 23/12/2022G.C
INTRODUCTION
To perform these experiments, we used MATLAB software. MATHLAB is
software that works on a matrix-based language allowing the most natural
expression of computational mathematics. It is high level language and
programming platform designed specifically for engineers and scientists to
analyze and design systems and products. It’s main tool for signal processing.

OBJECTIVE OF THE EXPERIMENT

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

During our experiment session we plotted different graphs using MATLAB. To


examine plot different graph, we use many exercises. Based on that we
managed to do continuous signal using plot command and identify the
difference between stem and plot. Other than that, we figured out the effect of
number variation on the shape of a given graph and get the knowhow about 3D
space plotting on MATLAB. Generally, the basic concept of the experiment
was performing different signal processing by using functions on MATLAB.

EXAMPLE 1. Plot the following functions in mat lab.


A. Y= sin(x), o<x<2pi

MAT LAB code

Published with MATLAB®


R2018b

2
B. Generation of sine wave MAT LAB code

t=0:0.1:10; % specify range and interval x=sin(2*pi*t); %define


output function x plot(t,x); %plot (t,x) xlabel('Time');
ylabel('Amplitude');% title('Sine wave');

Published with MATLAB® R2018b

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

Published with MATLAB® R2018b

Example2 A: Real valued exponential sequence: a^n

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

Published with MATLAB® R2018b

B. Real valued exponential sequence: a^n MATLAB code

n=-3:5 %define interval a1=0.8;


%define value of a x1=a1.^n; a2=1.2;
x2=a2.^n; plot(n,x1,':',n,x2,'-');
legend('x1','x2');
out put

Exercise 1

C
MATLAB code

Out put:

D
Exercise 2

Generation of Impulse sequence

MAT LAB code

Output

5
Example 3: Discrete-time signal

MAT Lab code:

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

Published with MATLAB® R2018b

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

Published with MATLAB® R2018b

Example 4 linear convolution

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

Published with MATLAB® R2018b

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

You might also like