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

Lab-Assignment 4

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

BMED-M3142:- Signals and Systems-Lab

Lab: Frequency Content of Continuous-Time


Signal

Addis Ababa University


Addis Ababa Institute of Technology (AAiT)
Center of Biomedical Engineering

Yidnekachew S. 2024
Frequency Content
Fourier Series (periodic signals)

Time Frequency
Domain Domain

Fourier Transform

*Fourier Transform in MATLab can be obtained by fft().


**There is a relationship between Fourier Series and Fourier Transform.
Notations and abbreviations
Fourier Transform of sin(5t)

dt = .05;
t = -10:dt:10;
x = sin(5*t);
X = fft(x)*dt;
X = fftshift(X);
Nw = length(X);
k = -(Nw-1)/2:1:(Nw-1)/2;
w = k*2*pi/Nw/dt; %rad./sample
plot(w,abs(X)); grid on;
Frequency response of the continuous-time LTI
system described by the differential equation:

First, we define coefficient matrices:

A=[a3 a2 a1 a0] B=[b3 b2 b1 b0]

Second, we use the following function:


[h,w] = freqs(B,A);
plot(w, abs(h))
Question 3 – assignment 7:

a0 = 121868727358.1180, a1 = 48890434.5196
a2 = 6209.9310, a3 = 1, b0 = 121868727358.1180;
a0 = 121868727358.1180;
a1 = 48890434.5196;
a2 = 6209.9310;
a3 = 1;
a = [a3 a2 a1 a0];
b0 = 121868727358.1180;
b = [0 0 0 b0];
[h,w] = freqs(b,a);
plot(w,abs(h)); grid on;
Example
Let x1(1) = sin(5t) and x2(t) = sin(7t), −10 ≤ t ≤ 10, Use matlab to find the
Fourier transform,

Compare your results with what you expect.


clear all; x(t) = x1(t/2) .
close all;
%*******************************
dt = .05;
t = -10:dt:10;
Nt = length(t);
x1 = sin(5*t);
x = upsample(x1,2);
X = fft(x,max(1001,Nt))*dt;
X = fftshift(X);
Nw = length(X);
k = -(Nw-1)/2:1:(Nw-1)/2;
w = k*2*pi/Nw/dt;
figure(2)
subplot(211);plot(x);grid
xlabel('x(t)=x(t/2)')
subplot(212);plot(w,abs(X));grid
xlabel('frequency')
clear all; x(t) = x1(t) + x2(t).
close all;
%*******************************
dt = .05;
t = -10:dt:10;
Nt = length(t);
x1 = sin(5*t);
x2 = sin(7*t);
x = x1+x2;
X = fft(x,max(1001,Nt))*dt;
X = fftshift(X);
Nw = length(X);
k = -(Nw-1)/2:1:(Nw-1)/2;
w = k*2*pi/Nw/dt;
figure(2)
subplot(211);plot(t,x);grid
xlabel('x1+x2')
subplot(212);plot(w,abs(X));grid
xlabel('frequency')
clear all;
x(t) = x1(t) . x2(t).
close all;
%*******************************
dt = .05;
t = -10:dt:10;
Nt = length(t);
x1 = sin(5*t);
x2 = sin(7*t);
x = x1.*x2;
X = fft(x,max(1001,Nt))*dt;
X = fftshift(X);
Nw = length(X);
k = -(Nw-1)/2:1:(Nw-1)/2;
w = k*2*pi/Nw/dt;
figure(2)
subplot(211);plot(t,x);grid
xlabel('x1+x2')
subplot(212);plot(w,abs(X));grid
xlabel('frequency')
Exercise 1
Find the amplitude spectrum of the two-frequency signal:

x(t) = cos(2 π 100t) + cos(2 π 500t)

Begin by creating a vector, x, with sampled values of the continuous time


function. If we want to sample the signal every 0.0002 seconds and create
a sequence of length 250, this will cover a time interval of length
250*0.0002 = 0.05 seconds.
Exercise 2
The END

You might also like