L A B 3 : G E N E R A T I N G S I N U S O I D S

Similar documents
Electrical & Computer Engineering Technology

LABORATORY - FREQUENCY ANALYSIS OF DISCRETE-TIME SIGNALS

DSP First. Laboratory Exercise #2. Introduction to Complex Exponentials

ELT COMMUNICATION THEORY

Discrete Fourier Transform (DFT)

LAB 2 SPECTRUM ANALYSIS OF PERIODIC SIGNALS

Biomedical Signals. Signals and Images in Medicine Dr Nabeel Anwar

Universiti Malaysia Perlis EKT430: DIGITAL SIGNAL PROCESSING LAB ASSIGNMENT 1: DISCRETE TIME SIGNALS IN THE TIME DOMAIN

Digital Signal Processing

LAB 4 GENERATION OF ASK MODULATION SIGNAL

1. In the command window, type "help conv" and press [enter]. Read the information displayed.

EXPERIMENT 4 INTRODUCTION TO AMPLITUDE MODULATION SUBMITTED BY

EEL 4350 Principles of Communication Project 2 Due Tuesday, February 10 at the Beginning of Class

EE 422G - Signals and Systems Laboratory

THE HONG KONG POLYTECHNIC UNIVERSITY Department of Electronic and Information Engineering. EIE2106 Signal and System Analysis Lab 2 Fourier series

Problem Set 1 (Solutions are due Mon )

Fourier Series and Gibbs Phenomenon

Laboratory Assignment 4. Fourier Sound Synthesis

Digital Signal Processing Laboratory 1: Discrete Time Signals with MATLAB

Jawaharlal Nehru Engineering College

It is the speed and discrete nature of the FFT that allows us to analyze a signal's spectrum with MATLAB.

Complex Numbers in Electronics

Frequency Domain Representation of Signals

Lab P-4: AM and FM Sinusoidal Signals. We have spent a lot of time learning about the properties of sinusoidal waveforms of the form: ) X

Fourier Transform. Prepared by :Eng. Abdo Z Salah

Fourier Signal Analysis

DFT: Discrete Fourier Transform & Linear Signal Processing

Fall Music 320A Homework #2 Sinusoids, Complex Sinusoids 145 points Theory and Lab Problems Due Thursday 10/11/2018 before class

ECEGR Lab #8: Introduction to Simulink

EE 215 Semester Project SPECTRAL ANALYSIS USING FOURIER TRANSFORM

Figure 1: Block diagram of Digital signal processing

Here are some of Matlab s complex number operators: conj Complex conjugate abs Magnitude. Angle (or phase) in radians

DSP First. Laboratory Exercise #7. Everyday Sinusoidal Signals

Basic Signals and Systems

DSP First Lab 03: AM and FM Sinusoidal Signals. We have spent a lot of time learning about the properties of sinusoidal waveforms of the form: k=1

Digital Video and Audio Processing. Winter term 2002/ 2003 Computer-based exercises

EECS 452 Midterm Exam Winter 2012

MATLAB Assignment. The Fourier Series

ECEn 487 Digital Signal Processing Laboratory. Lab 3 FFT-based Spectrum Analyzer

Lab 4 Fourier Series and the Gibbs Phenomenon

Lab 3 FFT based Spectrum Analyzer

Signal Processing First Lab 20: Extracting Frequencies of Musical Tones

PART I: The questions in Part I refer to the aliasing portion of the procedure as outlined in the lab manual.

Signal Processing First Lab 02: Introduction to Complex Exponentials Multipath. x(t) = A cos(ωt + φ) = Re{Ae jφ e jωt }

Concordia University. Discrete-Time Signal Processing. Lab Manual (ELEC442) Dr. Wei-Ping Zhu

George Mason University Signals and Systems I Spring 2016

Sound synthesis with Pure Data

DSP First. Laboratory Exercise #11. Extracting Frequencies of Musical Tones

Sampling and aliasing Amplitude modulation

Project 2 - Speech Detection with FIR Filters

Signal Processing. Introduction

Discrete-Time Signal Processing (DTSP) v14

ME 365 EXPERIMENT 8 FREQUENCY ANALYSIS

Lab S-8: Spectrograms: Harmonic Lines & Chirp Aliasing

ELECTRONOTES APPLICATION NOTE NO Hanshaw Road Ithaca, NY Nov 7, 2014 MORE CONCERNING NON-FLAT RANDOM FFT

Islamic University of Gaza. Faculty of Engineering Electrical Engineering Department Spring-2011

The Formula for Sinusoidal Signals

1 Introduction and Overview

Reference Sources. Prelab. Proakis chapter 7.4.1, equations to as attached

Additive Synthesis OBJECTIVES BACKGROUND

Lab 6: Sampling, Convolution, and FIR Filtering

Physics 115 Lecture 13. Fourier Analysis February 22, 2018

First, frequency is being used in terms of radians per second which is often called "j*w0". The relationship is as such.

Log Booklet for EE2 Experiments

ECE 5650/4650 MATLAB Project 1

Waveforms and Spectra in NBFM Receiver

(i) Understanding the basic concepts of signal modeling, correlation, maximum likelihood estimation, least squares and iterative numerical methods

Lab P-3: Introduction to Complex Exponentials Direction Finding. zvect( [ 1+j, j, 3-4*j, exp(j*pi), exp(2j*pi/3) ] )

Wireless Communication Systems Laboratory Lab#1: An introduction to basic digital baseband communication through MATLAB simulation Objective

Department of Electronic Engineering NED University of Engineering & Technology. LABORATORY WORKBOOK For the Course SIGNALS & SYSTEMS (TC-202)

Lecture 3 Complex Exponential Signals

PHYC 500: Introduction to LabView. Exercise 9 (v 1.1) Spectral content of waveforms. M.P. Hasselbeck, University of New Mexico

AC : FIR FILTERS FOR TECHNOLOGISTS, SCIENTISTS, AND OTHER NON-PH.D.S

Notes on Experiment #1

Frequency Division Multiplexing Spring 2011 Lecture #14. Sinusoids and LTI Systems. Periodic Sequences. x[n] = x[n + N]

STANFORD UNIVERSITY. DEPARTMENT of ELECTRICAL ENGINEERING. EE 102B Spring 2013 Lab #05: Generating DTMF Signals

Memorial University of Newfoundland Faculty of Engineering and Applied Science. Lab Manual

Signal Processing First Lab 02: Introduction to Complex Exponentials Direction Finding. x(t) = A cos(ωt + φ) = Re{Ae jφ e jωt }

LAB #7: Digital Signal Processing

Armstrong Atlantic State University Engineering Studies MATLAB Marina Sound Processing Primer

Lab S-7: Spectrograms of AM and FM Signals. 2. Study the frequency resolution of the spectrogram for two closely spaced sinusoids.

Experiments #6. Convolution and Linear Time Invariant Systems

Midterm 1. Total. Name of Student on Your Left: Name of Student on Your Right: EE 20N: Structure and Interpretation of Signals and Systems

UNIVERSITY OF WARWICK

DIGITAL SIGNAL PROCESSING TOOLS VERSION 4.0

FFT Analyzer. Gianfranco Miele, Ph.D

Massachusetts Institute of Technology Dept. of Electrical Engineering and Computer Science Spring Semester, Introduction to EECS 2

Lab 4 Digital Scope and Spectrum Analyzer

Lakehead University. Department of Electrical Engineering

UNIVERSITY OF WARWICK

EECS 452 Midterm Exam (solns) Fall 2012

Lab 1B LabVIEW Filter Signal

Experiment 8: Sampling

Digital Signal Processing ETI

Filter Banks I. Prof. Dr. Gerald Schuller. Fraunhofer IDMT & Ilmenau University of Technology Ilmenau, Germany. Fraunhofer IDMT

Spectrum Analysis: The FFT Display

LABORATORY WORK BOOK (TC-202)

George Mason University ECE 201: Introduction to Signal Analysis

Knowledge Integration Module 2 Fall 2016

Laboratory Experiment #1 Introduction to Spectral Analysis

Transcription:

L A B 3 : G E N E R A T I N G S I N U S O I D S NAME: DATE OF EXPERIMENT: DATE REPORT SUBMITTED: 1/7

1 THEORY DIGITAL SIGNAL PROCESSING LABORATORY 1.1 GENERATION OF DISCRETE TIME SINUSOIDAL SIGNALS IN MATLAB In this lab, discrete-time sinusoidal signal has been introduced. A discrete sinusoidal signal can be either sine or cosine time discrete signal and it can be expressed by: X(n) = A*sin(wn+ ), - < n < Where w = 2*pi*f; Therefore X(n) = A*sin(2πfn+ ), - < n < Similarly, discrete-time sinusoidal signal for a cosine function can be expressed as X(n) = A*cos(2*pi*fn+ ) - < n < Where n = integer variable called the sampler no A = Amplitude of the sinusoid w = frequency in radian per sample = Phase in radians As the mamaximum value of the functions SINE & COSINE is unity, the A acts as a scaling factor giving maximum and minimum values of ±A. 1.2 OBJECTIVES To learn the generation of discrete time sinusoidal signals To perform the elementary operations of shifting (advanced and delayed) To learn the techniques of doing scaling(time and amplitude) 2/7

To learn the application of some basic commands of MATLAB for simple digital signal processing problems 1.3 MATLAB SCRIPT n=0:40; f=0.1; phase=0; A=1.5; arg=2*pi*f*n-phase; x=a*cos(arg); clf; stem(n,x); axis([0 40-2 2]); grid; title('sinusoidal Sequence'); xlabel('time index n'); ylabel('amplitude'); axis; 1.4 ANSWERS TO THE QUESTIONS a) What is the period of the sequence? b) What command line controls the frequency in the program? c) What parameter controls the phase of this sequence? d) What parameter controls the amplitude of the sequence? e) What is the frequency of this sequence? 1.5 GENERATING AND SAMPLING CONTINOUS TIME SIGNALS Most signals in a DSP model are discrete-time signals. However, it is common that the discrete-time signal is a sampled version of a continuous-time signal. The following MATLAB m-file illustrates the generation of a continuous-time sinusoidal signal that is the sum of two separate sinusoids. S1 is a 240 Hz sinusoid and S2 is a 360 Hz sinusoid, which are summed to create Xa. Xa is plotted along with its components S1 and S2. Note that the time step of 100 s could easily be made smaller, say 1 s, to more closely approximate a continuous waveform. a) Create a script file on matlab and write to the shown codes and check it. 3/7

t = 0:100E-6:15E-3; S1 = sin(480*pi*t); S2 = 3*sin(720*pi*t); Xa = S1 + S2; plot(t,s1,'*'); hold on; plot(t,s2,'o'); hold on; plot(t,xa); hold off; xlabel('time'); ylabel('amplitude'); title('continuous Time Example'); grid; b) Now let s consider a sampled version of Xa. There are at least two ways to accomplish this in matlab. The first is to create an m-file that generates a discrete version of Xa given the sampling rate. And now Assume a sampling rate of 5 khz, which is much greater than the Nyquist rate of 720 Hz. Then x(n) = Xa(nT) where T = 1/5000 is the discrete version of the Xa. According to given datas that generate a script file and write matlab code where discrete version of Xa. 1.6 GENERATION OF WHITE NOISE WITH GAUSSIAN DISTRIBUTION Generate the white noise with the Gaussian distribution using the following code: x = 5*randn([1,4096]) ; % generate 4096 noise samples a) Make a plot of the white noise. Plot the first 50 samples (discrete-time signal style) using the Matlab function stem(). HINT : subplot(2,1,1); stem(x(1:50)); b) Use fft() to compute DFT coefficients, and plot and examine the magnitude spectrum of the signal x(n) assuming the sampling rate is 8000 Hz. To obtain frequency components: Ak = abs(fft(x))/length(x); To plot the spectrum: fs=8000; k=0:1:length(x)-1; f=k*fs/length(x); %frequency index % convert it to Hz subplot(2,1,2); plot(f,ak); Label and plot your graph. 4/7

What frequency range should you read? What is the frequency resolution? 1.7 GENERATION OF THE SUM OF DIGITAL SINUSOIDS Generate three sinusoids with the following amplitudes and phases x 1 ( t ) 5cos[2 (500) t ] ; x 2 ( t ) 5cos[2 (1200) t 0.25 ] ; x 3 ( t ) 5cos[2 (1800) t 0.5 ] a) Make a plot of all three signals over a range of t that will exhibit approximately 0.01 second. Each signal will be sampled using a sampling rate of 8000 Hz, a step size (sampling period) for time t is 1/8000=0.000125 second HINT : t=0:(1/8000):0.5; figure; subplot(3,1,1);plot(t,x1); axis([0 0.01 6 6]); Verify that the phases of all three signals are correct, and verify that each one has the correct maximum amplitude. Calculated x 1 ( 0) x 1max Measured x 1 ( 0) x 1max Calculated x 2 ( 0) x 2max Measured x 2 ( 0) x 2max Calculated x 3 ( 0) x 3max Measured x 3 ( 0) x 3max b) Create a program to generate the sum of sinusoids by adding three generated sinusoids x( t) x ( t) x ( t) x ( t). 1 2 3 Make a plot of x(t) over the same range of time as used in (1.7). figure; subplot(2,1,1);plot(t,x);axis([0 0.01-6 6]); What is the sampling rate? c) Use fft() to compute DFT coefficients, plot and examine the spectrum of the signal xn ( ) (frequency components). To obtain frequency components: Ak = abs(fft(x))/length(x); 5/7

To plot the spectrum: fs=8000; k=0:1:length(x)-1; %k is the frequency bin (frequency index) f=k*fs/length(x); % convert xx to Hz subplot(2,1,2);plot(f,ak); Label and plot your graph. What frequencies are shown in the signal spectral plot? What is the maximum frequency value that you can see? What is the frequency resolution based on the matlab program? INSTRUCTOR VERIFICATION 1.8 SCRIPT FILES Check the students script file to see if it is correct 1.9 FUNCTION FILES Check the students function file to see if it is correct. 2 LAB WRITEUP Please send me a write-up of your code in pdf format. You can write it as a word file, then save as pdf. Each lab grade consists of two sections. 50% of your grade is for coming to the lab. 50% is for your write-up. If you do not send the write-up within 2 weeks of the lab, you will not be allowed to submit a lab writeup. If your lab writeup is found to be substantially identical to another students using our special forensics team, you and the other student will receive a substantial reduction in your grade. 6/7

At the top of your code you should have your name, student number, lab number, date you performed the lab. In the lab writeup you should answer all questions in the body of the lab report. Please clearly label every question. You will not get credit for sections that are not clearly labeled. You must copy figures from Matlab and paste them into your word file, or save them as jpeg and import them into your word file. All figures must have captions inside which clearly describe what the figure is. Place print-outs of your code in the appendix, clearly mark what section and problem number the code was for. 7/7