Lab5 (Signal & System) Instructor: Anan Osothsilp Date: 20 Feb 07 Due Date 09 March 07.

Slides:



Advertisements
Similar presentations
DCSP-13 Jianfeng Feng
Advertisements

Math Review with Matlab:
Fourier Series & Transforms
Department of Kinesiology and Applied Physiology Spectrum Estimation W. Rose
ECE 8443 – Pattern Recognition EE 3512 – Signals: Continuous and Discrete Objectives: Response to a Sinusoidal Input Frequency Analysis of an RC Circuit.
CSE 123 Plots in MATLAB. Easiest way to plot Syntax: ezplot(fun) ezplot(fun,[min,max]) ezplot(fun2) ezplot(fun2,[xmin,xmax,ymin,ymax]) ezplot(fun) plots.
Introduction to Engineering MATLAB – 11 Plotting - 4 Agenda Multiple curves Multiple plot.
Plotting Selim Aksoy Bilkent University Department of Computer Engineering
Introduction to Matlab
Lecture (4) Plotting & Programming (1) Eng. Osama Talaat 1.
2D Plots 1 ENGR 1181 MATLAB 12.
Welcome to MATLAB DigComm LAB
Introduction to Graphing Using MATLAB. Line Graphs  Useful for graphing functions  Useful for displaying data trends over time  Useful for showing.
Matlab Graphics S. Awad, Ph.D. M. Corless, M.S.E.E. E.C.E. Department University of Michigan-Dearborn Introduction to Matlab: 2D Graphics.
Ch.4 Fourier Analysis of Discrete-Time Signals
ENGR-43_Lec-06c_2ndOrder-Filter_MATLAB-BodePlots.pptx 1 Bruce Mayer, PE Engineering-43: Engineering Circuit Analysis Bruce Mayer,
1.3 ARRAYS, FILES, AND PLOTS + FOURIER SERIES BY MR. Q.
Signal and System I Magnitude-phase representation of Fourier Transform Magnitude-phase representation of frequency response of LTI systems.
MATLAB - Basics Centro de Informática Universidade Federal de Pernambuco Aprendizagem de Máquina – IN1102 Arley Ristar –
DFT/FFT and Wavelets ● Additive Synthesis demonstration (wave addition) ● Standard Definitions ● Computing the DFT and FFT ● Sine and cosine wave multiplication.
Math Review with Matlab:
Introduction to Matlab EE 2303 Lab. MATLAB stands for “Matrix Laboratory” APPLICATIONS OF MATLAB:  Mathematical Calculations  Data Analysis & Visualization.
MATLAB’s extensive, device-independent plotting capabilities are one of its most powerful features. They make it very easy to plot any data at any time.
Lab8 (Signal & System) Instructor: Anan Osothsilp Date: 17 April 07.
Lab1 (Signal & System) Instructor: Anan Osothsilp Date: 30 Jan 07.
Lab2 (Signal & System) Instructor: Anan Osothsilp Date: 07 Feb 07.
Lab9 (Signal & System) Instructor: Anan Osothsilp Date: 17 April 07.
Slide 1EE100 Summer 2008Bharathwaj Muthuswamy EE100Su08 Lecture #11 (July 21 st 2008) Bureaucratic Stuff –Lecture videos should be up by tonight –HW #2:
Lab7 (Signal & System) Instructor: Anan Osothsilp Date: 20 Feb 07 Due Date 03 April 07.
Vectors and Plotting Selim Aksoy Bilkent University Department of Computer Engineering
Lab3 (Signal & System) Instructor: Anan Osothsilp Date: 13 Feb 07.
CHAPTER 16 Fourier Series.
Dr. Jie Zou PHY Welcome to PHY 3320 Computational Methods in Physics and Engineering.
Where we’re going Speed, Storage Issues Frequency Space.
Introduction to MATLAB adapted from Dr. Rolf Lakaemper.
Motivation Music as a combination of sounds at different frequencies
Fourier series. The frequency domain It is sometimes preferable to work in the frequency domain rather than time –Some mathematical operations are easier.
Fundamentals of Electric Circuits Chapter 17
Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 1 Chapter 19.
ME- 495 Mechanical and Thermal Systems Lab Fall 2011 Chapter 4 - THE ANALOG MEASURAND: TIME-DEPENDANT CHARACTERISTICS Professor: Sam Kassegne.
Descriptive Statistics I: By the end of this class you should be able to: Palm: Section 7.1, 7.2 Program cords and delays in your music programs plot a.
INC 112 Basic Circuit Analysis Week 7 Introduction to AC Current.
Where we’ve been Attenuate, Amplify, Linearize, Filter.
Recap Sum and Product Functions Matrix Size Function Variance and Standard Deviation Random Numbers Complex Numbers.
INC 111 Basic Circuit Analysis Week 7 Introduction to AC Current.
Introduction to MATLAB adapted from Dr. Rolf Lakaemper.
Plot (x-values, y-values) >> x = linspace (-3, 3, 20); >> x = linspace (-3, 3, 20); >> y = 2*x – 1; >> y = 2*x – 1; >> plot (x, y) >> plot (x, y)
UW CSE 190p Section 7/26, Summer 2012 Dun-Yu Hsiao.
ES97H Biomedical Signal Processing
Gustavo Cancelo Analysis of the phase shift error between A and B signals in BPMs BPM project.
Matlab Tutorial Iman Moazzen First Session – September 11, 2013.
The Spectrum n Jean Baptiste Fourier ( ) discovered a fundamental tenet of wave theory.
1 Introduction to bx Program (BANAL) To accompany Exercise 2 C.T. Russell April 9, 2008.
Tim Hurley.  Spectrograms are used to identify and analyze sounds  Typically, x-axis represents time and y- axis represents frequency  Spectrograms.
Fourier Series & Transforms
Frequency Domain Representation of Biomedical Signals.
EGR 106 – Week 5 – 2-D Plots Question : Why do engineers use plots? Answer : To analyze, visualize, and present data. Matlab has many useful plotting options.
Welcome to the Fundamentals of Mathematics for Engineers Lab ENGR 2194 MATLAB Supplemental Instruction #1.
Fourier Series Prof. Brian L. Evans
Introduction to MATLAB
Computer Application in Engineering Design
Sinusoidal Waveform Phasor Method.
Net 222: Communications and networks fundamentals (Practical Part)
Net 222: Communications and networks fundamentals (Practical Part)
Net 222: Communications and networks fundamentals (Practical Part)
Microelectronics.
Lab 6: Sound Analysis Fourier Synthesis Fourier Analysis
Introduction to MATLAB Plotting LAB 3
Plotting Signals in MATLAB
Electrical and Computer Engineering Department SUNY – New Paltz
Presentation transcript:

Lab5 (Signal & System) Instructor: Anan Osothsilp Date: 20 Feb 07 Due Date 09 March 07

Anan OsothsilpPage 1 Lab5 Date: 20 Feb 07 Objective: Learn how to use for loop operation for signal manipulation Learn how to write Matlab code to generate waveform for Fourier series Learn how to write Matlab code to generate signal spectrum

Anan OsothsilpPage 2 Lab Instruction: Follow the video tutorial and do Lab exercises Lab5 Date: 20 Feb 07

Anan OsothsilpPage 3 Lab5 Date: 20 Feb 07 For loop programming in Matlab Usage: - perform repeated task such as printing and calculation - iterate or loop through particular signal sample Looping - Display value y = [ ]; for i = 1: 7 disp(y(i)); end Format for variable = start : stop //code end Iterating to find something -Find maximum y = [ ]; temp = 0; for i = 1: 7 if (temp) < y(i) temp = y(i); end

Anan OsothsilpPage 4 Lab5 Date: 20 Feb 07 Linear combination using for loop Fourier series using for loop with plot on the same figure - If “ hold on;” command is called, then - subsequence call for plot command will create plot in the same figure x = [ ] y = 0; for n = 2:10 y = y+ x(n)^2; end figure(1); x = [ ]; for i = 1:length(x) y = i*x; plot(x,y); hold on; pause(2); end

Anan OsothsilpPage 5 Lab5 Date: 20 Feb 07 Linear combination using for loop N = 10 Wo = 2*pi; for n = -N:1:N, Dn = 2/(j*n*Wo); % Fourier Series Coefficient y = y + real(Dn*exp(j*n*Wo*t)); end % Fourier Series computation end

Anan OsothsilpPage 6 Lab5 Date: 20 Feb 07 Fourier series of square wave Without for loop’s code t4=[-1.3:.001:2.3]; x4=round(mod(t4,1)); axis([ ]); a0=0.5*ones(size(t4)); a1=-2/pi*sin(2*pi*t4); a3=-2/3/pi*sin(6*pi*t4); a5=-2/5/pi*sin(10*pi*t4); plot(t4,a0,'g',t4,a0+a1,'r',t4,a0+a1+a3,'m',t4,a0+a1+a3+a5,'k',t4,x4,'b','Linewidth',2) xlabel('Time (sec)') ylabel('Signal amplitude (units)') title('Periodic square wave signal') legend('one term','two terms','three terms','four terms')

Anan OsothsilpPage 7 Lab5 Date: 20 Feb 07 Fourier series of square wave With for loop’s code t=[-1.3:.001:2.3]; x=round(mod(t,1)); %this command generate square wave axis([ ]); %this command set figure axis hold on; plot(t,x,'b','LineWidth',2); %blue color with linewidth =2 a0=0.5*ones(size(t4)); %DC component plot(t,a0,'k','LineWidth',2); %black color with linewidth =2 hold on; sum = a0; color = ['r','g','m']; i =1; for n = [1 3 5 ]; %alternative for n = 1:2:5 sum =sum+ (-2/(n*pi))*(sin(2*pi*n*t)); plot(t,sum,'LineWidth',2); %color according to color(i) hold on; pause(2); %delay to show our graph i = i+1; 'inc color indec'; end xlabel('Time (sec)') ylabel('Signal amplitude (units)') title('Periodic square wave signal') legend('x(t) with bias','n =1','n=2','n=3','n=4') grid on;

Anan OsothsilpPage 8 Lab5 Date: 20 Feb 07 Excerise1 -Using for loop technique, write Matlab code Fourier series of N = 100; -Plot Fourier summation For the following x(t) t=[-1.3:.001:2.3]; x=round(mod(t,1)); %this command generate square wave axis([ ]); %this command set figure axis

Anan OsothsilpPage 9 Lab5 Date: 20 Feb 07 Frequency Spectrum of Fourier series Matlab code x = [ ]; y = 2*x; stem(x,y); N = 10; Wo = pi; for n = -N:1:N, Dn = 2/(j*n*Wo); stem(n*Wo,abs(Dn)) hold on; pause(1); end Generate magnitude spectrum of signal

Anan OsothsilpPage 10 Lab5 Date: 20 Feb 07 N = 10; Wo = pi; for n = -N:1:N, Dn = 2/(j*n*Wo); stem(n*Wo,angle(Dn)*180/pi) hold on; end Generate phase spectrum of signal

Anan OsothsilpPage 11 Lab5 Date: 20 Feb 07 Exercise 2: Find Fourier series and plot its signal spectrum