Net 222: Communications and networks fundamentals (Practical Part)

Slides:



Advertisements
Similar presentations
Math Review with Matlab:
Advertisements

Lecture 5.
ECE 8443 – Pattern Recognition EE 3512 – Signals: Continuous and Discrete Objectives: Response to a Sinusoidal Input Frequency Analysis of an RC Circuit.
Introduction to Matlab
Analog and Digital Signals AD/DA conversion BME 1008 Introduction to Biomedical Engineering FIU, Spring 2015 Feb 5 Lesson 3.
Lecture 7: Basis Functions & Fourier Series
Lab5 (Signal & System) Instructor: Anan Osothsilp Date: 20 Feb 07 Due Date 09 March 07.
Lecture 15 Orthogonal Functions Fourier Series. LGA mean daily temperature time series is there a global warming signal?
CMPS1371 Introduction to Computing for Engineers PROCESSING SOUNDS.
3.1 Chapter 3 Data and Signals Computer Communication & Networks.
Math Review with Matlab:
Time and Frequency Representation
Unit 7 Fourier, DFT, and FFT 1. Time and Frequency Representation The most common representation of signals and waveforms is in the time domain Most signal.
Frequency Domain Representation of Sinusoids: Continuous Time Consider a sinusoid in continuous time: Frequency Domain Representation: magnitude phase.
Where we’re going Speed, Storage Issues Frequency Space.
MATLAB INTRO CONTROL LAB1  The Environment  The command prompt Getting Help : e.g help sin, lookfor cos Variables Vectors, Matrices, and Linear Algebra.
Introduction to MATLAB Session 1 Prepared By: Dina El Kholy Ahmed Dalal Statistics Course – Biomedical Department -year 3.
Motivation Music as a combination of sounds at different frequencies
EE2010 Fundamentals of Electric Circuits Lecture 13 Sinusoidal sources and the concept of phasor in circuit analysis.
ELG 3120 Signal and System Analysis 1 Introduction to MATLAB TAs Wei Zhang Ozgur Ekici (Section A)(Section B) ELG 3120 Lab Tutorial 1.
Lecture 3 MATLAB LABORATORY 3. Spectrum Representation Definition: A spectrum is a graphical representation of the frequency content of a signal. Formulae:
Fourier series. The frequency domain It is sometimes preferable to work in the frequency domain rather than time –Some mathematical operations are easier.
Wireless and Mobile Computing Transmission Fundamentals Lecture 2.
Numerical Computation Lecture 2: Introduction to Matlab Programming United International College.
Matlab Basics Tutorial. Vectors Let's start off by creating something simple, like a vector. Enter each element of the vector (separated by a space) between.
MAE 1202: AEROSPACE PRACTICUM An Introduction to MATLAB: Part 2 Mechanical and Aerospace Engineering Department Florida Institute of Technology Developed.
Lecture 2 - Matlab Introduction CVEN 302 June 5, 2002.
Scientific Computing Introduction to Matlab Programming.
Fourier series: Eigenfunction Approach
Course Outline (Tentative) Fundamental Concepts of Signals and Systems Signals Systems Linear Time-Invariant (LTI) Systems Convolution integral and sum.
Fourier Series Fourier Transform Discrete Fourier Transform ISAT 300 Instrumentation and Measurement Spring 2000.
MATLAB – PT1 The purpose of this workshop is to get you started and to have fun with MATLAB! Let’s talk a little and decide on what we will be covering.
Introduction to Matlab  Matlab is a software package for technical computation.  Matlab allows you to solve many numerical problems including - arrays.
Sin & Cos with Amplitude and Phase.. In the equation, 2 is a multiplier and called an amplitude. Amplitude describes the “height” of the trigonometric.
Geology 6600/7600 Signal Analysis 30 Sep 2015 © A.R. Lowry 2015 Last time: The transfer function relating linear SISO input & output signals is given by.
NET 222: COMMUNICATIONS AND NETWORKS FUNDAMENTALS ( NET 222: COMMUNICATIONS AND NETWORKS FUNDAMENTALS (PRACTICAL PART) Lab 2 : potting to Matlab Networks.
Chapter 2. READING ASSIGNMENTS This Lecture: Chapter 2, pp Appendix A: Complex Numbers Appendix B: MATLAB or Labview Chapter 1: Introduction.
Fourier Analysis Patrice Koehl Department of Biological Sciences National University of Singapore
Digital Image Processing Lecture 8: Fourier Transform Prof. Charlene Tsai.
Sinusoids.
Linear Algebra Review.
Chapter 2. Signals and Linear Systems
Introduction to Transforms
CS 591 S1 – Computational Audio – Spring 2017
Introduction to MATLAB
Computer Application in Engineering Design
Signals in Matlab Matlab as a name stands for Matrix Laboratory.
COMPLEX NUMBERS and PHASORS
MECH 373 Instrumentation and Measurements
EE Audio Signals and Systems
MATLAB DENC 2533 ECADD LAB 9.
Sinusoidal Waveform Phasor Method.
Net 222: Communications and networks fundamentals (Practical Part)
Copyright © Cengage Learning. All rights reserved.
Sinusoids: continuous time
Signals and Systems Networks and Communication Department Chapter (1)
Net 222: Communications and networks fundamentals (Practical Part)
OptiSystem-MATLAB data interchange model and features
Use of Mathematics using Technology (Maltlab)
LECTURE #2 Phase & Time-Shift Delay & Attenuation
MATLAB Tutorial Dr. David W. Graham.
Net 222: Communications and networks fundamentals (Practical Part)
Communication and Coding Theory Lab(CS491)
Introduction to MATLAB
EEE 244-6: Fourier Transform (FFT) and Signal Processing
Rectangular Sampling.
Net 222: Communications and networks fundamentals (Practical Part)
Matlab Basics Tutorial
Lec.6:Discrete Fourier Transform and Signal Spectrum
ENEE222 Elements of Discrete Signal Analysis Lab 9 1.
Presentation transcript:

Net 222: Communications and networks fundamentals (Practical Part) Networks and Communication Department Lab 3: Matlab – Sinusoidal&Exercises

Lab Contents Basic exercises Arrays & Matrices Plotting Sinusoidal signal Networks and Communication Department

Basic exercises Let vector x = [5 2 1 6]: Add 16 to each element Let y = [4 1 3 5], multiply x*y Networks and Communication Department

Solution A. B. Adding 16 to vector x in matlab Multiplying two vectors x and y Networks and Communication Department

Basic exercises Evaluate the following MATLAB expressions by your hand and use MATLAB for checking your ans.: 2 / 2 * 3 (6 - 2 ) / 5 + 7 ^ 2 – 1 A. B. Hands calculation: 2/2=1 1*3 = 3 In Matlab:

How to evaluate an expression ? (6 - 2 ) / 5 + 7 ^ 2 – 1 Networks and Communication Department

Basic exercises Let vector t= 2, 4, 6, 8…20: Compute cos^2(t) %Notice that vector t is a starting form 2 and incremented by 2 till 20 Networks and Communication Department

Solution % cos^2(t) is written as cos(t).^2 Networks and Communication Department

Basic exercises Let vector t= 2, 4, 6, 8…20: Exp^t(1+ cos(3t)) %Notice that vector t is a starting form 2 and incremented by 2 till 20 exp Exponential. exp(X) is the exponential of the elements of X, e to the X.

How to write an expression in matlab % exp^t is written as exp(t). Networks and Communication Department

Arrays & Matrices Given an array A = [ 2 4 1 6 7 2 3 5 9] provide the commands needed to: assign the first row of A to a vector called x1 Networks and Communication Department

Solution %Array in matlab written as each rows separated by ; %assign the first row till end Networks and Communication Department

Arrays & Matrices Given an array A = [ 2 4 1 6 7 2 3 5 9] provide the commands needed to: assign the last 2 rows of A to an array called y % end-1 is row before the last row % end is the last row Networks and Communication Department

Arrays & Matrices Given an array A = [ 2 4 1 6 7 2 3 5 9] provide the commands needed to: compute the square-root of each element of A sqrt(X) is the square root of the elements of X. Networks and Communication Department

Group work ! Given an array A = [ 2 4 1 6 7 2 3 5 9] provide the commands needed to: compute the square-root of the first row of A Networks and Communication Department

Arrays & Matrices Transpose the following matrices: B=[3 2 6 8] A. B. Networks and Communication Department

Plotting Plot sin(x2) on the interval [-5,5] step 0.01 Networks and Communication Department

Solution Networks and Communication Department

Plotting The curve equations: 2. Create three curve on the interval [0,2π] step π/100 add legends to the plot The curve equations: y1 = sin(x) y2 = sin(x-0.25) y3 = sin(x-0.5)

Solution Networks and Communication Department

Sinusoidal Time & Frequency domain continuous or discrete signals Sinusoid Sampling Networks and Communication Department

continuous or discrete signals Continuous-Time Signals: A signal is continuous-time signal if the independent variable t is continuous. Discrete-Time Signals: A signal is defined at discrete times, a discrete-time signal is often identified as a sequence of numbers, denoted by A very important class of discrete-time signals is obtained by sampling a continuous-time signal IN MATLAB: command plot used to sketch the continuous time signals IN MATLAB: command stem used to sketch the discrete time signals Networks and Communication Department

Plotting Time domain using Matlab concept A general sine wave in time domain can be represented by three parameters : Peak amplitude (A) Frequency (f) Phase (φ) s(t) = A sin(2π f t +Φ) Networks and Communication Department

Plotting Time domain using Matlab Example: Plot and stem the time domain signal 7*sin(2*pi*2000*t+pi), t=0:0.05:3 To open the editor click on New -> Script

Matlab code Networks and Communication Department f=2000; t=0:0.05:3; x=7*sin(2*3.14*f*t+3.14); subplot(2,1,1); plot(t,x); xlabel('t'); ylabel('x(t)'); title('time domine continuous'); subplot(2,1,2); stem(t,x); xlabel('n'); ylabel('x[n]'); title('time domine discrete'); Networks and Communication Department

Run and save After writing the code click on Run button to save the code and run it .

Figure 1 Networks and Communication Department

Plotting Frequency domain using Matlab concept Using discipline Known as Fourier analysis (any signal is made up of components at various frequencies, in which each component is a sinusoid ). Eg. s(t) = [(4/π) x (sin(2πft) + (1/3) sin(2π(3f)t)] Networks and Communication Department

Plotting Frequency domain using Matlab example Plot each signals alone the show the frequency domain( Fourier) signal s(t)=[6*sin(2pi*t+pi)+4*sin(2*pi*3t+pi)+ 2*sin(2*pi*5t+3*pi)] Networks and Communication Department

Matlab code f1=1; f2=3; f3=5; t=0:0.01:5; pi=3.14; %############################# 1 s1=6*sin(2*pi*f1*t+pi); s2=4*sin(2*pi*f2*t+pi); s3=2*sin(2*pi*f3*t+3*pi); subplot(4,1,1); plot(t,s1,'linewidth',2); title('first signal '); grid on ; %############################## 2 subplot(4,1,2); plot(t,s2,'linewidth',2); title('second signal '); f1=1; f2=3; f3=5; t=0:0.01:5; pi=3.14; %############################# 1 s1=6*sin(2*pi*f1*t+pi); s2=4*sin(2*pi*f2*t+pi); s3=2*sin(2*pi*f3*t+3*pi); subplot(4,1,1); plot(t,s1,'linewidth',2); title('first signal '); grid on ; %############################## 2 subplot(4,1,2); plot(t,s2,'linewidth',2); title('second signal ');

Con. Matlab code %############################## 3 subplot(4,1,3); plot(t,s3,'linewidth',2); title('third signal '); grid on ; %############################## Fourier fd=(s1+s2+s3); subplot(4,1,4); plot(t,fd,'linewidth',2); title('Freqency Domaine '); grid on; Networks and Communication Department

Figure 2 Networks and Communication Department

Sampling In signal processing, sampling is the reduction of a continuous signal to a discrete signal. A sample is a value or set of values at a point in time and/or space. Networks and Communication Department

Con. Sampling The sampling frequency or sampling rate, fs, is the average number of samples obtained in one second For functions that vary with time, let s(t) be a continuous function (or "signal") to be sampled, and let sampling be performed by measuring the value of the continuous function every T seconds, which is called the sampling interval dt= 1/fs Networks and Communication Department

Sampling rate Networks and Communication Department

Con. Sampling rate Networks and Communication Department

Sinusoid Sampling Sample the sinusoid x = sin(2 pi f t), where f = 2 kHz. And t=0:5T Let x1 be the signal sampled at rate of 10 kHz. f=2000; T=1/f; dt1= 1/10000; t1=0:dt1:5*T; x1=sin(2*3.14*f*t1); stem(t1,x1);

Matlab code Networks and Communication Department Discrete-Time Signals Networks and Communication Department

Figure Networks and Communication Department f=2000; T=1/f; dt1= 1/10000; t1=0:dt1:5*T; x1=sin(2*3.14*f*t1); plot(t1,x1); Networks and Communication Department

Sinusoid Sampling Sample the sinusoid x = sin(2 pi f t), where f = 2 kHz. And t=0:5T Let x2 be the signal sampled at 3 kHz f=2000; T=1/f; dt2= 1/3000; t2=0:dt2:5*T; x2=sin(2*3.14*f*t2); stem(t2,x2); Networks and Communication Department

Sinusoid Sampling Plot frequency domain sinusoid x = sin(2 pi f t), where sampling frequency Fs = 8000 Hz. At different frequency tones start from 0 till 3, then multiplying the tones with 2 Note : The sampling frequency is sample rate In the form of an FT it’s easy to filter sound.  For example, when you adjust the equalizer on your sound system, like when changing the bass or treble, what you’re really doing is telling the device to multiply the different frequencies by different amounts before sending the signal to the speakers.

Matlab code f=8000; % sampling frequency t1=0:1/f:3; % time axis %############################ 1 s1=sin(2*3.14*f*t1); s2=sin(2*3.14*f*2*t1); subplot(3,1,1); plot(t1,s1,'linewidth',2); title('first f tone'); grid on ; Networks and Communication Department

Con. Matlab code %########################## 2 subplot(3,1,2); plot(2*t1,s1,'linewidth',2); title('second f tone'); grid on ; fd = (s1+s2); subplot(3,1,3); plot(t1,fd,'linewidth',2); title(' frequncey domain ' ) ; Networks and Communication Department

Figure Networks and Communication Department

The End Any Questions ? Networks and Communication Department