ECEGR Lab #8: Introduction to Simulink

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

Experiment 1 Introduction to MATLAB and Simulink

Introduction to Simulink

ENSC327 Communication Systems Fall 2011 Assignment #1 Due Wednesday, Sept. 28, 4:00 pm

EXPERIMENT 4 INTRODUCTION TO AMPLITUDE MODULATION SUBMITTED BY

ES442 Final Project AM & FM De/Modulation Using SIMULINK

Appendix B. Design Implementation Description For The Digital Frequency Demodulator

Electrical & Computer Engineering Technology

Sampling and Reconstruction of Analog Signals

CME 312-Lab Communication Systems Laboratory

Experiment # 4. Frequency Modulation

CME312- LAB Manual DSB-SC Modulation and Demodulation Experiment 6. Experiment 6. Experiment. DSB-SC Modulation and Demodulation

Introduction to Simulink Assignment Companion Document

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

Lecture 3 Review of Signals and Systems: Part 2. EE4900/EE6720 Digital Communications

Contents. Introduction 1 1 Suggested Reading 2 2 Equipment and Software Tools 2 3 Experiment 2

FYS3240 PC-based instrumentation and microcontrollers. Signal sampling. Spring 2015 Lecture #5

Signals and Systems Using MATLAB

Brief Introduction to Signals & Systems. Phani Chavali

Experiment 2 Effects of Filtering

Laboratory Experiment #1 Introduction to Spectral Analysis

ESE 150 Lab 04: The Discrete Fourier Transform (DFT)

Sound synthesis with Pure Data

Laboratory Assignment 1 Sampling Phenomena

YEDITEPE UNIVERSITY ENGINEERING FACULTY COMMUNICATION SYSTEMS LABORATORY EE 354 COMMUNICATION SYSTEMS

Discrete-Time Signal Processing (DTSP) v14

Fourier Signal Analysis

Laboratory Assignment 5 Amplitude Modulation

Spectrum Analysis - Elektronikpraktikum

EMBEDDED DOPPLER ULTRASOUND SIGNAL PROCESSING USING FIELD PROGRAMMABLE GATE ARRAYS

Experiment 02: Amplitude Modulation

Lab 4 An FPGA Based Digital System Design ReadMeFirst

Experiment 6: Multirate Signal Processing

Figure 1: Block diagram of Digital signal processing

ESE 150 Lab 04: The Discrete Fourier Transform (DFT)

EECS 307: Lab Handout 2 (FALL 2012)

FM Superheterodyne Receiver

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

Lab 1B LabVIEW Filter Signal

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

Presentation Outline. Advisors: Dr. In Soo Ahn Dr. Thomas L. Stewart. Team Members: Luke Vercimak Karl Weyeneth. Karl. Luke

Project 2 - Speech Detection with FIR Filters

EE 215 Semester Project SPECTRAL ANALYSIS USING FOURIER TRANSFORM

Final Exam Solutions June 14, 2006

Scanning Digital Radar Receiver Project Proposal. Ryan Hamor. Project Advisor: Dr. Brian Huggins

LAB #7: Digital Signal Processing

Signal Processing Toolbox

ELT COMMUNICATION THEORY

Recap of Last 2 Classes

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

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

Agilent Vector Signal Analysis Basics. Application Note

Amplitude Modulation Chapter 2. Modulation process

Laboratory Assignment 4. Fourier Sound Synthesis

FAST Fourier Transform (FFT) and Digital Filtering Using LabVIEW

Discrete Fourier Transform (DFT)

BIOE 198MI Biomedical Data Analysis. Spring Semester Lab6: Signal processing and filter design

EE452 Senior Capstone Project: Integration of Matlab Tools for DSP Code Generation. Kwadwo Boateng Charles Badu. May 8, 2006

Modulating Signal by Matlab. Amplitude modulation(am)

Chapter 7 Single-Sideband Modulation (SSB) and Frequency Translation

Signal Processing. Level IV/V CITE, BTS/DUT/Licence. i_5. i_6 LOWPASS. 5 in2. w0 =6000rad/s xi =.8; G =3 lp2a1. mul0. Filtre passe-bas.

Reading: Johnson Ch , Ch.5.5 (today); Liljencrants & Lindblom; Stevens (Tues) reminder: no class on Thursday.

ECE 203 LAB 2 PRACTICAL FILTER DESIGN & IMPLEMENTATION

(i) Understanding of the characteristics of linear-phase finite impulse response (FIR) filters

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

EE 422G - Signals and Systems Laboratory

Discrete-time Signals & Systems

Digital Filters IIR (& Their Corresponding Analog Filters) Week Date Lecture Title

Sampling and Signal Processing

Frequency Domain Representation of Signals

Final Exam Solutions June 7, 2004

Introduction to Lab Instruments

(i) Understanding of the characteristics of linear-phase finite impulse response (FIR) filters

Experiment 1 Introduction to Simulink

Lecture Schedule: Week Date Lecture Title

6.02 Practice Problems: Modulation & Demodulation

ME scope Application Note 01 The FFT, Leakage, and Windowing

Subtractive Synthesis. Describing a Filter. Filters. CMPT 468: Subtractive Synthesis

Project I: Phase Tracking and Baud Timing Correction Systems

Topic. Filters, Reverberation & Convolution THEY ARE ALL ONE

Biomedical Signals. Signals and Images in Medicine Dr Nabeel Anwar

Lab 1: Simulating Control Systems with Simulink and MATLAB

Data Acquisition Systems. Signal DAQ System The Answer?

DSP Laboratory (EELE 4110) Lab#10 Finite Impulse Response (FIR) Filters

Sampling and aliasing Amplitude modulation

Amplitude Modulation. Amplitude Modulation. Amplitude Modulation. Amplitude Modulation. A. Introduction. A. Introduction

SAMPLING AND RECONSTRUCTING SIGNALS

6 Sampling. Sampling. The principles of sampling, especially the benefits of coherent sampling

ELEC3104: Digital Signal Processing Session 1, 2013

FYS3240 PC-based instrumentation and microcontrollers. Signal sampling. Spring 2017 Lecture #5

DSP First. Laboratory Exercise #7. Everyday Sinusoidal Signals

Experiment 8: Sampling

FFT Analyzer. Gianfranco Miele, Ph.D

SAMPLING THEORY. Representing continuous signals with discrete numbers

Fourier Theory & Practice, Part I: Theory (HP Product Note )

Experiment 4 Sampling and Aliasing

OKAN UNIVERSITY FACULTY OF ENGINEERING AND ARCHITECTURE. EEE 403 Digital Signal Processing 10 Periodic Sampling

Signal Processing. Introduction

Instruction Manual for Concept Simulators. Signals and Systems. M. J. Roberts

Practical issue: Group definition. TSTE17 System Design, CDIO. Quadrature Amplitude Modulation (QAM) Components of a digital communication system

Transcription:

Page 1 ECEGR 317 - Lab #8: Introduction to Simulink Objective: By: Joe McMichael This lab is an introduction to Simulink. The student will become familiar with the Help menu, go through a short example, and finally implement a modulation and demodulation circuit in Simulink. Procedure: Part 1: Using the Help menu 1) Start and go to Help -> Matlab Help. Expand the Simulink folder and scan read through the following sections: What is Simulink? Building a Model Setting Simulink Preferences Simulink Basics Figure 1: Matlab Help: What is Simulink?

Page 2 Figure 2: Matlab Help: Building a Model 2) Build and simulate the example in the help page Building a Model. Figure 3: Matlab Help: Building a Model Simulink Schematic

Page 3 Figure 4: Matlab Help: Building a Model Simulink Output Figure 5: Matlab Help: Setting Simulink Preferences

Page 4 Figure 6: Matlab Help: Simulink Basics Figure 7: Matlab Help: Modeling and Simulating Discrete Systems

Page 5 Figure 8: Matlab Help: Signal Processing Blockset: Discrete- Time Signals Part 2: Creating and displaying signals 3) Create a model that adds 2 sinusoids, stores the result in the Workspace, and displays the result on the scope. Change the parameters of the Sine Waves, the To Workspace block, the Scope, and the Simulation. Run the model for 0.1 seconds. Figure 9: Simulink Schematic for Adder

Page 6 Figure 10: Scope Output (Summation of Two Sine Waves) at Sample Time of 1e-5 First Window: 100 Hz, Amplitude 10 Second Window: 800 Hz, Amplitude 3 Third Window: Summation 4) Plot the twosinewaves variable in the workspace. Figure 11: Matlab Workspace Displaying twosinewaves variable

Page 7 Figure 12: Matlab Plot of twosinewaves with respect to time 15 10 5 0-5 -10-15 0 2000 4000 6000 8000 10000 12000 Figure 13: Matlab Plot of twosinewaves with respect to time (zoomed in) 15 10 5 0-5 -10-15 0 500 1000 1500 2000 2500 3000

Page 8 5) To observe the samples change the sample time for both sine waves to 1e-3 seconds and run the simulation for 0.1 seconds. Figure 14: Scope Output (Summation of Two Sine Waves) at Sample Time of 1e-3 First Window: 100 Hz, Amplitude 10 Second Window: 800 Hz, Amplitude 3 Third Window: Summation 6) Next, leave one of the sample times at 1e-3 seconds and change the other sample time to 5e-3 seconds. Go to Simulation- >Configuration Parameters and change the discrete solver to a variable step. Run the model.

Page 9 Figure 15: Scope Output (Summation of Two Sine Waves) with Samples Time of 1e-3 and 1e-5 and Variable Step Solver First Window: 100 Hz, Amplitude 10, Ts=1e-5 Second Window: 800 Hz, Amplitude 3, Ts=1e-3 Third Window: Summation 7) Next, add to our model 3 more blocks: Matrix Sum, Sine Wave block, and Scope. The Sine Wave block can be configured to give you 2 or more different signals by entering vectors for the amplitude and frequency.

Page 10 Figure 16: Scope Output (Summation of Two Sine Waves) using the Matrix Sum block First Window: 100 Hz, Amplitude 10, Ts=1e-5 and 800 Hz, Amplitude 3, Ts=1e-3 Second Window: Summation 8) Finally, add to our model 3 more blocks: Matrix Sum, Signal Processing Sine Wave block, and Scope. The Sine Wave block can be configured to give you 2 or more different signals by entering vectors for the amplitude and frequency.

Page 11 Figure 17: Scope Output (Summation of Two Sine Waves) using the Matrix Sum block and DSP sine wave block First Window: 100 Hz, Amplitude 10, Ts=1e-5 and 800 Hz, Amplitude 3, Ts=1e-3 Second Window: Summation

Figure 18: Schematic for Part 2 Joe McMichael Page 12 Part 3: Computing the Fourier Transform of a Signal 9) Go through the FFT Example you can find by going to: Help- >Matlab Help->Signal Processing Blockset->Transforms->Signals in the Time Domain->Transforming Time-Domain Data into the Frequency Domain. The model is called doc_fft_tut.mdl. Figure 19: Schematic of Doc_fft_tut.mdl Example 10) Draw and run the model for 3 sinusoids with equal amplitude and frequencies of 1000, 2000, and 4000 Hz. Figure out the sample time you need to use to avoid aliasing. Answers to Questions: Nyquist Frequency = 4,000 Hz * 2 = 8 khz

Page 13 11) Use the FFT program to investigate the relationship between sampling frequency (Fs), samples/frame, and resolution. Remember to autoscale all plots. Figure 20: FFT of Three Sinusoids at 1000 Hz, 2000 Hz, and 4000 Hz Fs = 240 khz Sample Time = 1.1667e-6 128 samples/frame

Page 14 Figure 21: FFT of Three Sinusoids at 1000 Hz, 2000 Hz, and 4000 Hz Fs = 240 khz Sample Time = 1.1667e-6 2048 samples/frame

Page 15 Figure 22: FFT of Three Sinusoids at 1000 Hz, 2000 Hz, and 4000 Hz Fs = 40 khz Sample Time = 2.5e-5 128 samples/frame

Page 16 Figure 23: FFT of Three Sinusoids at 1000 Hz, 2000 Hz, and 4000 Hz Fs = 40 khz Sample Time = 2.5e-5 2048 samples/frame

Page 17 Figure 24: FFT of Three Sinusoids at 1000 Hz, 2000 Hz, and 4000 Hz Fs = 8.8 khz Sample Time = 1.13636e-4 128 samples/frame

Page 18 Figure 25: FFT of Three Sinusoids at 1000 Hz, 2000 Hz, and 4000 Hz Fs = 8.8 khz Sample Time = 1.13636e-4 2048 samples/frame Answers to Questions: One must pick a sampling rate just above the Nyquist rate in order to achieve higher spectral resolution. Oversampling will often distort the FFT, because the algorithm only calculates a finite number of points. During oversampling, these points will be too far apart (because they must span a higher frequency), and will cause the FFT to have a lower spectral resolution. When a signal is undersampled, it will not meet the Nyquist theorem and will be aliased. Taking more samples per frame will increase the spectral resolution. To achieve the best results, one must sample slightly above the Nyquist rate with a large number of samples/frame.

Page 19 For example, at an 8.8 khz sampling rate with 128 samples/frame, the spectral components are wide and slightly off, but with an 8.8 khz sampling rate with 2048 samples/frame, the spectral components are right on, at 1 khz, 2 khz, and 4 khz. The size of the frame increases with a higher sampling frequency. However, above the Nyquist frequency this is unnecessary and can make it hard to see the spectral components. Part 4: Modeling the modulator and demodulator system from previous labs 12) Create a model for the modulation, frequency division multiplexing, and demodulation system that you built in a previous lab. 13) For the modulator and demodulator simply use the multiplier blocks. Model the bandpass filter with the transfer function you had from a previous lab. Model the lowpass filter with a transfer function. Figure 26: Matlab Program for Computing Fourier Coefficients for Bandpass Filter %Compute the Transfer Function Values for a Bandpass Filter %Joe McMichael %November 27th, 2007 clear clc f0 = 20000; BW = 3000; Q = 6.667; Gain = 88.8889; C = 0.000000001; R2 = 106103.4; R1 = 596.83; w0 = (2*pi*f0); numerator = -(2*Q*w0) denominator_s2 = 1 denominator_s = w0/q denominator_1 = w0^2

Page 20 Figure 27: Matlab Output Computing Fourier Coefficients for Bandpass Filter numerator = -1.6756e+006 denominator_s2 = 1 denominator_s = 1.8849e+004 denominator_1 = 1.5791e+010 >> Figure 28: Matlab Program for Computing Fourier Coefficients for Lowpass Filter %Compute the Transfer Function Values for a Lowpass Filter %Joe McMichael %November 27th, 2007 clear clc fc = 2000; wc = (2*pi*fc); numerator = wc^2 denominator_s2 = 1 denominator_s = 2*0.707*wc denominator_1 = wc^2 Figure 29: Matlab Output Computing Fourier Coefficients for Lowpass Filter numerator = 1.5791e+008 denominator_s2 = 1 denominator_s = 1.7769e+004 denominator_1 = 1.5791e+008 >>

Page 21 Figure 30: Simulink Schematic Carrier 1: 20 khz Message 1: 1 khz Carrier 2: 10 khz Message 2: 3 khz

Joe McMichael December 4th, 2007 Page 22 Figure 31: Output in the Time Domain Carrier 1: 20 khz Message 1: 1 khz Carrier 2: 10 khz Message 2: 3 khz 1st Panel: Output of Adder Circuit 2nd Panel: Output of Bandpass Filter 3rd Panel: Output of Demodulator 4th Panel: Ouput of Low Pass Filter

Figure 32: FFT of Adder Circuit Output Carrier 1: 20 khz Message 1: 1 khz Carrier 2: 10 khz Message 2: 3 khz Joe McMichael Page 23

Figure 33: FFT of Bandpass Filter Carrier 1: 20 khz Message 1: 1 khz Carrier 2: 10 khz Message 2: 3 khz Bandpass Filter Center = 20 khz Bandwidth = 3 khz Joe McMichael Page 24

Figure 34: FFT of Demodulator Carrier 1: 20 khz Message 1: 1 khz Carrier 2: 10 khz Message 2: 3 khz Joe McMichael Page 25

Figure 35: FFT of Low Pass Filter Carrier 1: 20 khz Message 1: 1 khz Carrier 2: 10 khz Message 2: 3 khz Cutoff Frequency = 2 khz Joe McMichael Page 26 Modulation & Demodulation Successful!