ECEN 2250 Introduction to Circuits & Electronics Fall 2011

Similar documents
Analog and Digital Signals, Time and Frequency Representation of Signals

Frequency Response of FIR Filters

Signal Processing First Lab 01: Introduction to MATLAB. 3. Learn a little about advanced programming techniques for MATLAB, i.e., vectorization.

Lab 1. The Fourier Transform

The Calculation of G rms

MATERIALS. Multisim screen shots sent to TA.

Computer Networks and Internets, 5e Chapter 6 Information Sources and Signals. Introduction

Q1. The graph below shows how a sinusoidal alternating voltage varies with time when connected across a resistor, R.

LABORATORY 10 TIME AVERAGES, RMS VALUES AND THE BRIDGE RECTIFIER. Bridge Rectifier

EDEXCEL NATIONAL CERTIFICATE/DIPLOMA UNIT 5 - ELECTRICAL AND ELECTRONIC PRINCIPLES NQF LEVEL 3 OUTCOME 4 - ALTERNATING CURRENT

B3. Short Time Fourier Transform (STFT)

Electrical Resonance

PHASOR DIAGRAMS HANDS-ON RELAY SCHOOL WSU PULLMAN, WA. RON ALEXANDER - BPA

ε: Voltage output of Signal Generator (also called the Source voltage or Applied

Diode Applications. As we have already seen the diode can act as a switch Forward biased or reverse biased - On or Off.

Rectifier circuits & DC power supplies

Department of Electrical and Computer Engineering Ben-Gurion University of the Negev. LAB 1 - Introduction to USRP

DIODE CIRCUITS LABORATORY. Fig. 8.1a Fig 8.1b

Digital Transmission of Analog Data: PCM and Delta Modulation

LAB 7 MOSFET CHARACTERISTICS AND APPLICATIONS

VCO Phase noise. Characterizing Phase Noise

Inductors in AC Circuits

Sampling and Interpolation. Yao Wang Polytechnic University, Brooklyn, NY11201

SIGNAL GENERATORS and OSCILLOSCOPE CALIBRATION

RMS Power. The Meaning of Average

S. Boyd EE102. Lecture 1 Signals. notation and meaning. common signals. size of a signal. qualitative properties of signals.

SGN-1158 Introduction to Signal Processing Test. Solutions

EXPERIMENT NUMBER 8 CAPACITOR CURRENT-VOLTAGE RELATIONSHIP

The Fourier Analysis Tool in Microsoft Excel

Experiment #11: LRC Circuit (Power Amplifier, Voltage Sensor)

Oscilloscope, Function Generator, and Voltage Division

CIRCUITS LABORATORY EXPERIMENT 3. AC Circuit Analysis

chapter Introduction to Digital Signal Processing and Digital Filtering 1.1 Introduction 1.2 Historical Perspective

Lock - in Amplifier and Applications

Title : Analog Circuit for Sound Localization Applications

TCOM 370 NOTES 99-4 BANDWIDTH, FREQUENCY RESPONSE, AND CAPACITY OF COMMUNICATION LINKS

BASIC ELECTRONICS AC CIRCUIT ANALYSIS. December 2011

MICROPHONE SPECIFICATIONS EXPLAINED

Laboratory 4: Feedback and Compensation

Agilent PN Extending Vector Signal Analysis to 26.5 GHz with 20 MHz Information Bandwidth

Current and Temperature Ratings

Trigonometric functions and sound

AC : MEASUREMENT OF OP-AMP PARAMETERS USING VEC- TOR SIGNAL ANALYZERS IN UNDERGRADUATE LINEAR CIRCUITS LABORATORY

Using the Impedance Method

ANALYTICAL METHODS FOR ENGINEERS

AC Measurements Using the Oscilloscope and Multimeter by Mr. David Fritz

In order to describe motion you need to describe the following properties.

ENGR-4300 Electronic Instrumentation Quiz 4 Spring 2011 Name Section

ANALYZER BASICS WHAT IS AN FFT SPECTRUM ANALYZER? 2-1

The Phase Modulator In NBFM Voice Communication Systems

Lesson 3 DIRECT AND ALTERNATING CURRENTS. Task. The skills and knowledge taught in this lesson are common to all missile repairer tasks.

Adding Sinusoids of the Same Frequency. Additive Synthesis. Spectrum. Music 270a: Modulation

Alternating-Current Circuits

Worksheet 1. What You Need to Know About Motion Along the x-axis (Part 1)

Lab 3 Rectifier Circuits

electronics fundamentals

Modulation and Demodulation

Computing Fourier Series and Power Spectrum with MATLAB

DIGITAL-TO-ANALOGUE AND ANALOGUE-TO-DIGITAL CONVERSION

ECEN 1400, Introduction to Analog and Digital Electronics

ANADOLU UNIVERSITY DEPARTMENT OF ELECTRICAL AND ELECTRONICS ENGINEERING

Experiment 3: Double Sideband Modulation (DSB)

INTERFERENCE OF SOUND WAVES

Lecture 8 ELE 301: Signals and Systems

Electronics. Basic Concepts. Yrd. Doç. Dr. Aytaç GÖREN Yrd. Doç. Dr. Levent ÇETİN

Chapter 12 Driven RLC Circuits

= V peak 2 = 0.707V peak

USB 3.0 CDR Model White Paper Revision 0.5

PYKC Jan Lecture 1 Slide 1

Using an Oscilloscope

Spike-Based Sensing and Processing: What are spikes good for? John G. Harris Electrical and Computer Engineering Dept

Curve Fitting, Loglog Plots, and Semilog Plots 1

HITACHI INVERTER SJ/L100/300 SERIES PID CONTROL USERS GUIDE

RF Measurements Using a Modular Digitizer

Homework Assignment 03

ES250: Electrical Science. HW7: Energy Storage Elements

Timing Analysis of X-ray Lightcurves

Lecture - 4 Diode Rectifier Circuits

CMPT 468: Matlab Tutorial 3: Analysis with the Fast Fourier Transform (FFT)

Electricity & Electronics 5: Alternating Current and Voltage

CBS RECORDS PROFESSIONAL SERIES CBS RECORDS CD-1 STANDARD TEST DISC

EXPERIMENT NUMBER 5 BASIC OSCILLOSCOPE OPERATIONS

Switch Mode Power Supply Topologies

Circuits with inductors and alternating currents. Chapter 20 #45, 46, 47, 49

Lab E1: Introduction to Circuits

Unit2: Resistor/Capacitor-Filters

PCM Encoding and Decoding:

Step response of an RLC series circuit

Properties of electrical signals

SERIES-PARALLEL DC CIRCUITS

Lab 3: Introduction to Data Acquisition Cards

RISH EM 3490 DS Dual Source Energy Meter RISH EM 3490 DS. Application : Product Features:

Frequency Response of Filters

Statistics, Probability and Noise

See Horenstein 4.3 and 4.4

Experiment 2 Diode Applications: Rectifiers

Physics Lab Report Guidelines

Beginner s Matlab Tutorial

Analyses: Statistical Measures

Cell Phone Vibration Experiment

Transcription:

ECEN 225 Introduction to Circuits & Electronics Fall 2 9-5- P. Mathys Waveforms in Matlab Sampled Waveforms Signals like speech, music, sensor outputs, etc., are broadly classified as continuous-time (CT) or discrete-time (DT), depending on whether the times for which the signal is defined are continuous or discrete. Correspondingly, a CT waveform is referred to as s(t) or x(t), etc., where t is a (continuous) real number, and a DT waveform is denoted as s n, s[n] or x n, x[n], etc., where n is a (discrete) integer. Example: CT and DT sine with frequency f. A CT sine waveform with amplitude and frequency f in Hz can be written as x(t) = sin(2πf t). To obtain a DT sine waveform with the same parameters, x(t) can be sampled at times t = nt s = n/f s, where F s = /T s is the sampling frequency in Hz. This yields x(nt s ) = x n = sin(2πf nt s ) = sin(2πf n/f s ) = sin(2πφ n), where Φ = f /F s is a normalized (with respect to F s ) frequency. The signals x(t) and x n are shown in the following graphs for f = Hz and F s = 8 Hz. Continuous and Discrete Time (CT, DT) Signals x(t) and x n, F s =8 Hz x(t)=sin(2πf t), f = Hz.5.5.2.4.6.8.2.4.6.8 2 t [ms] x n =sin(2πφ n), Φ =/8.5.5 2 4 6 8 2 4 6 n

A soundcard in a computer, for example, performs the process of sampling for all signals that are applied to its input. The reverse process, which is called interpolation, is then performed by the soundcard when a DT signal is played back through a speaker or headphones, both of which require a CT signal. 2 Waveform Parameters Waveforms are often characterized (partially) in terms of their amplitude parameters. Let x(t) be a CT waveform. Then the minimum and the maximum amplitude values of x(t) are defined as X min = min x(t), and X max = max x(t). t t The peak-to-peak value describes the maximum excursion of x(t) and is defined as X pp = X max X min. Note that X pp is always positive. The peak value is the maximum deviation of x(t) from zero. It is defined as X p = max{ X min, X max }, and it is also always positive. The average value of x(t) is defined as X avg = lim T 2T T T x(t) dt, if the limit exists. If x(t) is periodic with period T then this simplifies to X avg = T T x(t) dt, where the integral can be taken over any convenient time interval of length T. The graph on the next page shows X min, X max, X pp, X p, and X avg for an example waveform x(t). Another quantity of interest is the average power carried by a waveform x(t). Instantaneous power is defined as p(t) = v(t) i(t). Using Ohm s law, v(t) = R i(t) or i(t) = v(t)/r. Thus, the instantaneous power delivered to a resistor R is p(t) = v2 (t) R = R i2 (t). Note that p(t) is proportional to the square of the voltage and current waveforms. 2

.6 Parameters X min, X max, X p, X pp, and X avg of waveform x(t) X p.4 X max.2 X pp x(t).2 X avg.4.6 X min.8.5.5 2 2.5 3 3.5 4 4.5 t [ms] The average power delivered to R is P avg = lim T 2T T T p(t) dt, if the limit exists. If p(t) is periodic with period T, then P avg = T T p(t) dt. This motivates the definition of the root-mean-square value as (if the limit exists) T X rms = lim x T 2T 2 (t) dt, to characterize the average power carried by x(t). If x(t) is periodic with period T, then the definition of X rms simplifies to X rms = x T 2 (t) dt, T where the integral is taken over any interval of lengh T. T 3

3 Waveforms in Matlab Whenever a digital computer is used to record, process, and/or generate CT waveforms, the internal representation of these waveforms will be as DT waveforms by necessity. The sampling theorem asserts that as long as the sampling frequency F s is at least twice the highest frequency contained in the original CT waveform x(t), x(t) can be recovered uniquely and without loss from its samples x n = x(n/f s ). As a result, it is very common to use digital signal processing (DSP) for CT waveforms that have been sampled at a high enough sampling rate. A typical example are modern cell phones that generate and process all signals using DSP and only the shifting to and from the carrier frequency of about -2 GHz is done using analog electronics and CT waveforms. The rest of this section describes ways to handle CT waveforms in Matlab by working with their DT representations, assuming that the sampling rate has been chosen large enough. To generate a DT approximation to the CT waveform x(t) = X + A cos(2πf t + θ), in Matlab with sampling frequency F s, the following Matlab commands can be used (with F s = 44 Hz, X =.2, A =.6, f = Hz, θ = 9 ): Fs = 44; Ts = /Fs; tlen =.5; A =.6; f = ; theta = -9; X = -.2; %Sampling frequency in Hz %Sampling time interval in sec %Signal duration in sec %Amplitude of sinusoid %Frequency of sinusoid in Hz %Phase of sinusoid in degrees %DC offset of sinusoid tt = [:round(tlen*fs)-]/fs; %Time axis xt = X + A*cos(2*pi*f*tt+(pi/8)*theta); %DT approximation for x(t) This creates a signal xt of.5 sec duration. You can listen to this signal and/or write it to a wav file using the Matlab commands: sound(xt,fs) %Play x(t) through soundcard wavwrite(xt,fs,6, Signal.wav ); %Write x(t) to Signal.wav Note that the amplitude range for 6-bit wav files is limited to the range x(t) < +. To read a wav file and plot the waveform in a graph you can use the Matlab commands: 4

[xt Fs] = wavread( Signal.wav ); %Read wav file Signal.wav tt = [:length(xt)-]/fs; %Create time axis plot(tt,xt, -b ) %Plot x(t) versus tt grid %Add a grid xlabel( t [s] ) %Label x-axis ylabel( x(t) ) %Label y-axis title( Plot of Waveform in Signal.wav ) If you run these commands you will obtain a graph that is all blue for amplitude values between -.8 and.4 (try it!). In general, if a signal is long enough to listen to, then it is too long for a detailed graph. A useful command to reduce the length of the waveform before it is printed is find as shown below: td =.; %Start of display time in sec td2 =.+4e-3; %End of display time in sec ix = find(tt>=td&tt<td2); %Indexes for display plot(tt(ix),xt(ix), -b ) %Plot x(t) versus t<=tt<t2 grid %Add a grid xlabel( t [s] ) %Label x-axis ylabel( x(t) ) %Label y-axis title( Plot of Waveform in Signal.wav for t<=tt<t2 ) The resulting graph is shown in the following figure..6 Plot of Waveform in Signal.wav for t<=tt<t2.4.2 x(t).2.4.6.8..5..5.2.25.3.35.4.45 t [s] 5

Finding X min and X max for a waveform like Signal.wav in Matlab is fairly straightforward. Just use the Matlab commands min(xt) and max(xt). The quantities X pp and X p can then be readily computed. To computation of X avg and X rms requires a little more explanation because of the integrations which need to be approximated by sums because only a sampled version of x(t) is available. If x(t) is available from t to t 2, the average value for that time interval is computed as X avg = t2 x(t) dt n 2 x(nt s ) T s = t 2 t t t 2 t n=n n 2 x(nt s ), n 2 n n=n where n T s = t, n 2 T s = t 2, x(nt s ) = x n, and T s = /F s. In Matlab the following command can be used, assuming x(t) is represented by the vector xt of length length(xt) (corresponding to n 2 n ): Xavg = sum(xt)/length(xt); %Average value of xt The following labeled graph that shows x(t) for t t < t 2 and X avg.6 Plot of Waveform in Signal.wav for t<=tt<t2.4.2 x(t).2 X avg =.2.4.6.8..5..5.2.25.3.35.4.45 t [s] can be obtained using the Matlab commands: subplot(2) %Sub-plot in upper half plot(tt(ix),xt(ix), -b,tt(ix),xavg*ones(size(xt(ix))), --r ) %Plot x(t) and Xavg vs t grid %Add a grid xlabel( t [s] ),ylabel( x(t) ) %Label x,y-axis title( Plot of Waveform in Signal.wav for t<=tt<t2 ) text(tt(ix(end))-e-4,xavg+.,[ X_{avg}= num2str(xavg)]) %Label Xavg line As always, if there is a command in Matlab which you do not know or for which you need to review the syntax, type help command at Matlab s command prompt. The computation of X rms from xt in Matlab is very similar to the computation of X avg and is left as an exercise. c 2 2, P. Mathys. Last revised: 9-8-, PM. 6