Lab 8. Signal Analysis Using Matlab Simulink

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

Biomedical Signals. Signals and Images in Medicine Dr Nabeel Anwar

EE 451: Digital Signal Processing

Digital Signal Processing

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

DFT: Discrete Fourier Transform & Linear Signal Processing

Signal Processing Toolbox

Discrete Fourier Transform (DFT)

FFT analysis in practice

Signal Processing. Naureen Ghani. December 9, 2017

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

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

EE 451: Digital Signal Processing

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

Noise Measurements Using a Teledyne LeCroy Oscilloscope

Lab 6. Advanced Filter Design in Matlab

LABORATORY - FREQUENCY ANALYSIS OF DISCRETE-TIME SIGNALS

Topic 6. The Digital Fourier Transform. (Based, in part, on The Scientist and Engineer's Guide to Digital Signal Processing by Steven Smith)

EE 422G - Signals and Systems Laboratory

EE 403: Digital Signal Processing

Lab 4 Digital Scope and Spectrum Analyzer

Introduction to Simulink

Experiment 1 Introduction to MATLAB and Simulink

Signal segmentation and waveform characterization. Biosignal processing, S Autumn 2012

PROBLEM SET 6. Note: This version is preliminary in that it does not yet have instructions for uploading the MATLAB problems.

Experiments #6. Convolution and Linear Time Invariant Systems

Post-processing using Matlab (Advanced)!

Laboratory Assignment 4. Fourier Sound Synthesis

Digital Signal Processing. VO Embedded Systems Engineering Armin Wasicek WS 2009/10

Frequency Domain Representation of Signals

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

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

Digital Signal Processing

Multirate Digital Signal Processing

Theory of Telecommunications Networks

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

B.Tech III Year II Semester (R13) Regular & Supplementary Examinations May/June 2017 DIGITAL SIGNAL PROCESSING (Common to ECE and EIE)

Experiment 2 Effects of Filtering

Outline. Introduction to Biosignal Processing. Overview of Signals. Measurement Systems. -Filtering -Acquisition Systems (Quantisation and Sampling)

Electrical & Computer Engineering Technology

ELT Receiver Architectures and Signal Processing Fall Mandatory homework exercises

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

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

Introduction to Wavelet Transform. Chapter 7 Instructor: Hossein Pourghassem

University of Washington Department of Electrical Engineering Computer Speech Processing EE516 Winter 2005

System Identification and CDMA Communication

Digital Filters FIR and IIR Systems

! Multi-Rate Filter Banks (con t) ! Data Converters. " Anti-aliasing " ADC. " Practical DAC. ! Noise Shaping

Chapter 4 SPEECH ENHANCEMENT

CS3291: Digital Signal Processing

Lab 4 An FPGA Based Digital System Design ReadMeFirst

CHAPTER 2 FIR ARCHITECTURE FOR THE FILTER BANK OF SPEECH PROCESSOR

Fourier Signal Analysis

The Discrete Fourier Transform. Claudia Feregrino-Uribe, Alicia Morales-Reyes Original material: Dr. René Cumplido

Outline. Design Procedure. Filter Design. Generation and Analysis of Random Processes

C.8 Comb filters 462 APPENDIX C. LABORATORY EXERCISES

Signals and Systems Using MATLAB

DSP First Lab 08: Frequency Response: Bandpass and Nulling Filters

Objectives. Presentation Outline. Digital Modulation Lecture 03

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

Signals A Preliminary Discussion EE442 Analog & Digital Communication Systems Lecture 2

DSP First. Laboratory Exercise #7. Everyday Sinusoidal Signals

EE 791 EEG-5 Measures of EEG Dynamic Properties

EE216B: VLSI Signal Processing. Wavelets. Prof. Dejan Marković Shortcomings of the Fourier Transform (FT)

Lakehead University. Department of Electrical Engineering

Practice 2. Baseband Communication

Team proposals are due tomorrow at 6PM Homework 4 is due next thur. Proposal presentations are next mon in 1311EECS.

Sampling and Reconstruction of Analog Signals

Basic Signals and Systems

y(n)= Aa n u(n)+bu(n) b m sin(2πmt)= b 1 sin(2πt)+b 2 sin(4πt)+b 3 sin(6πt)+ m=1 x(t)= x = 2 ( b b b b

Understanding Digital Signal Processing

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

Laboratory Manual 2, MSPS. High-Level System Design

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

Biosignal filtering and artifact rejection. Biosignal processing, S Autumn 2012

Signal Processing for Speech Applications - Part 2-1. Signal Processing For Speech Applications - Part 2

Evoked Potentials (EPs)

Advanced Digital Signal Processing Part 2: Digital Processing of Continuous-Time Signals

Frequency Analysis of Spoken Urdu Numbers Using MATLAB and Simulink

A Novel Approach for MRI Image De-noising and Resolution Enhancement

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

Chapter 5. Signal Analysis. 5.1 Denoising fiber optic sensor signal

EECS 452 Midterm Exam Winter 2012

ECE 2713 Homework 7 DUE: 05/1/2018, 11:59 PM

Problem Set 1 (Solutions are due Mon )

DIGITAL SIGNAL PROCESSING TOOLS VERSION 4.0

2015 HBM ncode Products User Group Meeting

EE 215 Semester Project SPECTRAL ANALYSIS USING FOURIER TRANSFORM

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

DESIGN AND IMPLEMENTATION OF AN ALGORITHM FOR MODULATION IDENTIFICATION OF ANALOG AND DIGITAL SIGNALS

Short-Time Fourier Transform and Its Inverse

Chapter 2. Signals and Spectra

Digital Processing of Continuous-Time Signals

Lab 1: Analog Modulations

Design of FIR Filters

The quality of the transmission signal The characteristics of the transmission medium. Some type of transmission medium is required for transmission:

Laboratory 5: Spread Spectrum Communications

System analysis and signal processing

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

Signal processing preliminaries

Transcription:

E E 2 7 5 Lab June 30, 2006 Lab 8. Signal Analysis Using Matlab Simulink Introduction The Matlab Simulink software allows you to model digital signals, examine power spectra of digital signals, represent LTI systems in different formats, help turn specifications for IIR and FIR filters into working designs, and other operations. This lab will briefly describe how to use Matlab s Simulink software for signal analysis. Computer Setup You will need to make sure some examples and exercises are available on your computer before beginning the lab. 1. Start Matlab. 2. Put the CD in the CD-ROM drive. 3. Set the Matlab current directory to the CD-ROM drive. 4. Run the Matlab install script install training on the CD. To do so, type the name at the Matlab command prompt: install training 5. The script should open a graphical user interface (GUI) that will guide you through the installation procedure. In the GUI, you have these options: Choose a class root directory for the files. Choose the courses for which you want to install the files. Add the course directory to your Matlab path and edit your startup.m file so that the files are on the path each time you start Matlab. The installation creates a subdirectory of your chosen root directory (the default is C:\class) called coursefiles. This directory has subdirectories for each of the courses you install, labeled by course number. These individual course directories contain the examples and exercises for the courses. You may want to change the work directory to your M: drive and put it in the path. c 2006GM

Matlab Setup for Building Signal Processing Blockset Models When you create a model using blocks from the Signal Processing Blockset, you may want to adjust certain Simulink settings to reflect the discrete time nature of a digital model. The Signal Processing Blockset provides an M-file, dspstartup.m, that lets you automate this configuration process so that every new model you create is preconfigured for simulating a digital (discrete) system. Statistical Signal Processing Repeated observations (or simulations within the Simulink environment) of a random process X under the same environmental conditions yield different results. The signal value of a simulation, x(n), at sample n is not constant among the realizations in an ensemble; rather, the ensemble is characterized by a set of probability density functions. Each individual signal value x(n) of a specific realization in the ensemble can be thought of as the outcome of an underlying random variable. The collection of these random variables, one for each sample time, comprise the random process. Working with random signals is easier when one or both of the following properties can be shown to hold. A signal is said to be stationary if the statistics over the simulation do not change with a shift in time, i.e., if the random variables x(n) and x(n + N) have the same statistics for every integer value of N. A signal is said to be ergodic if the ensemble averages are equal to the time averages of any sample function. In other words, the statistics for any given realization in the ensemble are the same as the statistics for the ensemble. Note that an ergodic signal must be stationary, but a stationary signal is not necessarily ergodic. Statistics The Signal Processing Blockset has blocks to extract basic statistics from stochastic signals, such as mean, median, variance, and correlation. These are the building blocks for much of statistical signal processing. Simple Mean Standard Deviation and Variance µ x = EX σx 2 = E{X 2 } E 2 {X}

Minimum and Maximum Correlation Autocorrelation and Cross-Correlation R xy (τ) = E{X(t)Y (t + τ)} Trending Detrend Histogram Sort Example: Crosscorrelation In a simple target ranging system, a transmitted signal x is compared with a received signal y. y is modeled by the equation y(n) = αx(n d) + β where α is an attenuation factor, d is a time delay, and β is channel noise. If T is the return time for the signal, then x and y should be correlated at n = T. The target will be located at a distance of vt, where v is the channel speed of the signal. multipathcorr Example: Mean Block The Mean block in the Signal Processing Blockset performs calculates the mean for a portion of the input sequence. You can use this block with the Buffer block as an averaging filter. The Buffer block generates a sliding window. The output buffer size N indicates the length of the window, while N M (where M is the buffer ovelap), specifies the number of samples the window slides at each time step. The Mean block also has a running mean option that performs a cumulative muean calculation on the input sequence. running mean

Example: Median Block The Median block in the Signal Processing Blockset performs basic median operation on the input sequence. You can use this block with the Buffer Block as a median filter. A median filter is a nonlinear filtering technique that uses a sliding window on a sequence. The filter replaces the center value in the window with the median value of all the points within the window. The advantage of median filters over linear filters such as averaging filters comes from the robustness of the median with respect to outliers. Outlying data has much less effect on the center of a data set when the center is measured by the median rather than the mean. As a result, median filters are useful for removing spike noise involving extreme outliers while otherwise preserving the shape of the signal. edit medianfilter medianfilter Discrete Fourier Transform (DFT) The DFT of a real-valued N-point signal y is a complex-valued N-point conjugate-symmetric signal Y, defined by the formula where e j 2π N Y (n) = N 1 k=0 are the complex N th roots of unity. y(k)e j 2π N kn The points of the DFT correspond to the N discrete frequencies from 0 to 2π, or the DC frequency to the Sampling Frequency respectively. Note The DFT defines the discrete frequencies of a sampled periodic signal. The Discrete-Time Fourier Transform (DTFT), on the other hand, defines all frequencies of a sampled aperiodic signal. fftgui Drag the mouse to move some of the points in the real window and see how the other windows change.

Fast Fourier Transform (FFT) The FFT block in the Signal Processing Blockset uses an algorithm to calculate efficiently the DFT of an input signal. The algorithm requires that the input is frame-based with a power-of-two column length. The FFT operation requires approximately 2n 2 floating-point operations, where n is the FFT length. Modern-day FFT algorithms have reduced the computational complexity from n 2 to nlog 2 n. By restricting n to be a power of 2, an FFT of length n requires fewer than 3nlog 2 n floating-point operations using the new algorithms. For n = 2 20 or 1,048,576, the calculation is faster by a factor of almost 35,000 times. In this example, the Buffer block sets the FFT window size by creating each windowed signal as a frame-based input. The FFT block returns a complex-valued sample-based signal containing the frequency domain data. The Vector Scope blocks are adjusted to display this frequency input. The Matlab fft function is based on FFTW, The Fastest Fourier Transform in the West, developed by MIT graduate students Matteo Frigo and Steven G. Johnson. For information about FFTW, including a C subroutine library, go to: http://www.fftw.org Example: DFT In this example, we use the FFT block to analyze signals in the frequency domain: 1. Open medianfilter and running mean from previous examples. 2. Take the FFT of the signals before and after the filtering operations and use the Vector Scope block to observe the signals in the frequency domain. 3. Set the input domain of the vector scope to Frequency Sample time of the original time series to the proper rate. 4. Insert a Complex to Magnitude block before the Vector Scope block. 5. Use the IFFT block to view the original signal. fft running mean fft median

Use the following blocks to perform the frequency analysis: Buffer, FFT, Complex to Magnitude-Angle, Freq, IFFT, Time FFT demos: sigdemo1 phone Aliasing Sampling an analog signal in the time domain has the effect of producing spectral copies at multiples of the sampling frequency. When the sampling frequency is less than the signal bandwidth, aliasing will occur. The example fft aliasing illustrates a 5Hz sine wave sampled at 15Hz and the same 5Hz signal sampled at 7.5Hz. In the first case, the original 5Hz signal is reconstructed without aliasing while in the second case, the 5Hz signal is aliased to 2.5Hz. fftaliasing Additional Transforms One of the drawbacks of the Fourier transform is that time information is lost when obtaining the frequency content. This is trivial for stationary signals since the signal s statistics do not change with shifts in time, but for time-varying or bursty signals, the time information may be important to the user. The Short-Time FFT block is one solution to this problem. By applying the FFT to a sliding window in the time domain, time is preserved by taking snapshots of the FFT spectrum throughout the simulation. The disadvantage of this method is that it is uniform on all time intervals and is not robust to the local idiosyncrasies in the frequency content. As a result, some nonstationary characteristics of a signal can go undetected. Wavelet analysis uses a more adaptable method, and is capable of revealing trends, breakdown points, and discontinuities in higher derivatives that Fourier analysis might be unable to capture. A wavelet is a waveform of effectively limited duration that has an average value of zero. Wavelet analysis uses filters to separate the signal into its low and high frequency content. These signal components are manipulated with the sliding wavelet to produce the wavelet coefficients of similarity. The Discrete Wavelet Transform (DWT) block decomposes the signal into a combination

of the approximation and detail coefficients, which describe the relation of low and high frequency respectively with the wavelet. dspxfrm3 (The material in this lab handout was put together by Paul Beliveau and derives principally from the MathWorks training document Simulink for Signal Processing, 2006.) c 2006GM