Lab 7: Let s Make a Little Noise

Similar documents
Lab 8: Beer Bottle Symphony

Name: Resistors and Basic Resistive Circuits. Objective: To gain experience with data acquisition proto-boards physical resistors. Table of Contents:

Lab 1: DC Measurements (R, V, I)

Lab Session 4 Hardware

Fig. 1 Tachometer Built from Old CD, DC Motor, and Photogate

Name: First-Order Response: RC Networks Objective: To gain experience with first-order response of RC circuits

Assignment 11. 1) Using the LM741 op-amp IC a circuit is designed as shown, then find the output waveform for an input of 5kHz

Fig. 1. NI Elvis System

Lab 9 RF Wireless Communications

GEORGIA INSTITUTE OF TECHNOLOGY SCHOOL of ELECTRICAL and COMPUTER ENGINEERING. ECE 3084 Fall 2017 Lab #2: Amplitude Modulation

Pre-Lab. Introduction

OPERATIONAL AMPLIFIERS (OP-AMPS) II

EECS 216 Winter 2008 Lab 2: FM Detector Part II: In-Lab & Post-Lab Assignment

Materials. Eight pin DIP socket 0.1 µf capacitor

Auntie Spark s Guide to creating a Data Collection VI

Function Generator Op-amp Summing Circuits Pulse Width Modulation LM311 Comparator

EE 233 Circuit Theory Lab 3: First-Order Filters

Operational Amplifiers: Part II

1.0 Introduction to VirtualBench

Lab 4: Analysis of the Stereo Amplifier

9 Feedback and Control

University of North Carolina, Charlotte Department of Electrical and Computer Engineering ECGR 3157 EE Design II Fall 2009

EE 368 Electronics Lab. Experiment 10 Operational Amplifier Applications (2)

H represents the value of the transfer function (frequency response) at

Easy Transfer Function Measurements with LabVIEW 6i (Lab Skill Exercise X-1)

Lab 6: Building a Function Generator

UNIVERSITY OF NORTH CAROLINA AT CHARLOTTE Department of Electrical and Computer Engineering

Lab 2: Introduction to NI ELVIS, Multisim, and LabVIEW

Exercise 1: AC Waveform Generator Familiarization

BME/ISE 3512 Bioelectronics Laboratory Two - Passive Filters

Experiment A8 Electronics III Procedure

Experiment #2 Half Wave Rectifier

ECE 2274 Lab 2. Your calculator will have a setting that will automatically generate the correct format.

Laboratory Exercises for Analog Circuits and Electronics as Hardware Homework with Student Laptop Computer Instrumentation

Lab 2: Optical Theremin Team 2 Flyback By Brian Pugh, Andrew Baker, and Michael Betts

BME/ISE 3512 Bioelectronics. Laboratory Five - Operational Amplifiers

Lab 2: Designing an Optical Theremin. EE 300W Section 5 Team #3: Penn Power United Gregory Hodgkiss, Nasser Aljadeed 10/23/15

EE431 Lab 1 Operational Amplifiers

Experiment No. 4 The LM 741 Operational Amplifier

Rowan University Freshman Clinic I Lab Project 2 The Operational Amplifier (Op Amp)

RC Filters and Basic Timer Functionality

Laboratory 4: Amplification, Impedance, and Frequency Response

Optical Theremin CDR

The object of this experiment is to become familiar with the instruments used in the low noise laboratory.

Fill in the following worksheet-style pages. A colored pen or pencil works best. The procedure is:

ECE 6416 Low-Noise Electronics Orientation Experiment

Contents. CALIBRATION PROCEDURE NI 5421/ MS/s Arbitrary Waveform Generator

Lab 9: Operational amplifiers II (version 1.5)

BME/ISE 3511 Laboratory One - Laboratory Equipment for Measurement. Introduction to biomedical electronic laboratory instrumentation and measurements.

ECEN 325 Lab 5: Operational Amplifiers Part III

Math and Music: Understanding Pitch

EE 300W 001 Lab 2: Optical Theremin. Cole Fenton Matthew Toporcer Michael Wilson

Experiment A8 Electronics III Procedure

OPERATIONAL AMPLIFIERS LAB

EE 300W Lab 2: Optical Theremin Critical Design Review

NI mydaq. Contents USER GUIDE AND SPECIFICATIONS. ni.com/manuals

ECE 3155 Experiment I AC Circuits and Bode Plots Rev. lpt jan 2013

1) Consider the circuit shown in figure below. Compute the output waveform for an input of 5kHz

University of Michigan EECS 311: Electronic Circuits Fall 2008 LAB 4 SINGLE STAGE AMPLIFIER

Electronics I. laboratory measurement guide

University of Utah Electrical Engineering Department ECE 2100 Experiment No. 2 Linear Operational Amplifier Circuits II

Lab #1 Lab Introduction

Lab 7: DELTA AND SIGMA-DELTA A/D CONVERTERS

Contents CALIBRATION PROCEDURE NI PXI-5422

EE283 Electrical Measurement Laboratory Laboratory Exercise #7: Digital Counter

On-Line Students Analog Discovery 2: Arbitrary Waveform Generator (AWG). Two channel oscilloscope

Part 1. Using LabVIEW to Measure Current

Laboratory Manual. ELEN-325 Electronics

Lab Exercise # 9 Operational Amplifier Circuits

LAB II. INTRODUCTION TO LABVIEW

LLS - Introduction to Equipment

Laboratory 9. Required Components: Objectives. Optional Components: Operational Amplifier Circuits (modified from lab text by Alciatore)

Class #3: Experiment Signals, Instrumentation, and Basic Circuits

Stereo Tone Controller

Lab 10: Oscillators (version 1.1)

Sampling and Reconstruction

THE PENNSYLVANIA STATE UNIVERSITY. Lab 2: Designing Optical Theremin Instrument. EE 300W Section 001. Nathaniel Houtz, Ji Eun Shin, Peter Wu 2/22/2013

Designing Information Devices and Systems II Fall 2018 Elad Alon and Miki Lustig Homework 4

ECE 2274 Lab 2 (Network Theorems)

Exercise 3 Operational Amplifiers and feedback circuits

Experiment No. 6. Audio Tone Control Amplifier

Operational Amplifiers 2 Active Filters ReadMeFirst

Audio Power Amplifiers with Feedback Linearization

Laboratory Assignment 1 Sampling Phenomena

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

11. Audio Amp. LM386 Low Power Amplifier:

EE 233 Circuit Theory Lab 2: Amplifiers

Lab 2: Discrete BJT Op-Amps (Part I)

INTRODUCTION TO ENGINEERING AND LABORATORY EXPERIENCE Spring, 2015

Project 1 Final System Design and Performance Report. Class D Amplifier

H BRIDGE INVERTER. Vdc. Corresponding values of Va and Vb A+ closed, Va = Vdc A closed, Va = 0 B+ closed, Vb = Vdc B closed, Vb = 0 A+ B+ A B

ECE 2006 University of Minnesota Duluth Lab 11. AC Circuits

UNIVERSITY OF UTAH ELECTRICAL AND COMPUTER ENGINEERING DEPARTMENT ELECTROMYOGRAM (EMG) DETECTOR WITH AUDIOVISUAL OUTPUT

Spectrum Analysis: The FFT Display

Integrators, differentiators, and simple filters

Velleman Arbitrary Function Generator: Windows 7 by Mr. David Fritz

Introduction to Equalization

ET1210: Module 5 Inductance and Resonance

Instructions for the final examination:

Optical Theremin Critical Design Review Yanzhe Zhao, Mason Story, Nicholas Czesak March

Transcription:

Lab 7: Let s Make a Little Noise Introduction Ever had a piece of a song rattling around in your head, but when you tried to sing it, it just did not sound right? What you need is a little keyboard to explore your thoughts and bring out that tune. Fig. 1 LabVIEW Rendition of a Single Octave Piano Keyboard Purpose This Lab uses the analog output of mydaq to generate an audio signal from a LabVIEW keyboard (Fig. 1) of one or two octaves. A small electronic audio amplifier adds plenty of volume. Equipment NI mydaq 3.5 mm Sub-Minature Stereo Cable (comes with NI mydaq) ipod or Other Music Source and Earphones Stereo Computer Speaker Set (optional) LM386 or TI TPA301 Audio Amplifier Resistor: 10 kω Pot Capacitors: 1 µf, 1 nf, and 47 nf Capacitors (electrolytic): Three 10 µf 8Ω Speaker Stereo Audio Sub-Miniature Socket National Instruments Corporation 1

Solderless Breadboard Prerequisite Reference Materials Equipment Check (Analog Output(AO0,AO1) and Analog Input(AI0,AI1)): http://decibel.ni.com/content/docs/doc-12884 Equipment Check (Audio Output and Analog Input): http://decibel.ni.com/content/docs/doc-12885 Music Scales: http://en.wikipedia.org/wiki/piano_key_frequencies Audio Amplifiers: http://www.techlib.com/electronics/audioamps.html/ Exercise 7-1: Getting Started on a Piano Keyboard Audio Check Connect your ipod output to the mydaq (Audio In socket). Connect your earphones or external speakers to mydaq (Audio Out) Socket. Open and [Run] the LabVIEW program entitled Test Audio.vi. Start playing a favorite song on the ipod. Sound will tell you that the ipod signal is being streamed from your ipod through a LabVIEW program and back out to the earphones/speakers. Audio also can be played from a LabVIEW program to the analog output channel 0 (pins AO1 and AGND). Using two alligator cables, connect these two pins to your earphone or speaker cable. Launch the function generator FGEN and set it to Sine, 1000 Hz, and 0.5 Vpp. Press [Run] and hear the sine wave signal in your speakers or earphone. Now that the audio channels are set to go, let s build a LabVIEW program to generate some sounds. The Keyboard Load the program Piano.vi and look at the front panel (see Fig.1). 2 ni.com

A keyboard for one octave is made up of seven white keys and five black keys. The extra white key on the right side has been added so you can go from middle C (C4) to the higher C note (C5). The frequency for C5 is exactly twice the frequency for C4. The keys are just LabVIEW Boolean indicators shaped, colored, and placed into a keyboard arrangement. Whenever a key is pressed via the mouse pointer, a note is played to the analog output pins (AO 1 and AGND). [Run] the program and play the scale. Some Music Background There are 88 keys on a standard piano keyboard. The frequency range is separated into seven and one half octaves. An octave is the frequency interval between the same notes in two successive octaves. For example, the key middle A (A4) is 440.00 Hz. In the next higher octave, the note A5 is 880.00 Hz, and the next lower octave A3 is 220.00 Hz. There are eight white keys and five black keys in an octave where neighboring keys are separated in frequency by the 12th root of 2 (diatonic scale). For more information and the frequencies on all 88 notes, checkout Scales: http://www.phy.mtu.edu/~suits/scales.html Note Frequencies: http://www.phy.mtu.edu/~suits/notefreqs.html Simple Piano Keyboard Look at the block diagram for the program Piano.vi, as shown in Fig. 2. National Instruments Corporation 3

Fig. 2 Block Diagram for LabVIEW Program Piano.vi The musical note frequencies are stored in an array called Notes. The notes are entered in the array in the same sequence as the keys are laid out on the keyboard. Example: Middle C (C4) is element 0 of the array (261.63 Hz). The keys have a mechanical action of Switch Until Released. The output is True as long as a key is pressed. The keys C, C#,, C are built into a Boolean array whose value is 0 until a key is pressed. The Search 1D Array VI returns a value of 1 (no key pressed) or the integer number related to the key position. This number becomes an index into the Notes array to find the note frequency. The frequency data packet then passes on to the function generator (FGEN), which produces the sound and outputs it to the analog output sockets AO 0 and AGND. Note: FGEN VI cannot handle a negative frequency number ( 1) when no key is pressed, so for this case, a 10 Hz frequency is generated. The ear cannot hear this low a frequency. [Run] program and play a little jingle. You soon will hear the limitations of having only one octave. Modify the program for two octaves (C4 to C6). 4 ni.com

Exercise 7-2: Building an External Audio Amplifier Next we will look at building a low-cost audio amplifier that can drive an 8 Ω speaker, as shown in Fig. 3. Fig. 3 Audio Amp Reference: http://www.techlib.com/electronics/audioamps.html You will need the LM386 IC, a few resistors and capacitors, a small speaker, and a power supply. NI mydaq can provide +15 and 15 V at 2 ma. We will use the +15 V on the sockets labeled +15 V and AGND. The input for the amplifier will come from mydaq analog output sockets AO 0 and AGND. You can use the mydaq DMM(Ω) software instrument to verify the values of all your chosen resistors. The values of the capacitors are not critical, so the values stamped on the package are good enough. However, if you wish to measure the capacitors, you can use the Bode Analyzer (see Lab 2) and the 3 db cutoff point (or 45 degree phase point) to calculate the capacitance. Assemble all of your components on a breadboard, as shown in Fig. 4. National Instruments Corporation 5

Lab 7. Let s Make a Little Noise Fig. 4 Breadboard of Low-Cost Audio Amplifier (Single Channel) Try exploiting the mydaq instruments to make useful measurements to test and debug the circuit. Here are some suggestions: DC measurements use mydaq digital voltmeter DMM(V). AC measurements use mydaq function generator FGEN and SCOPE. Output signal AO 0 can be connected to both the circuit input and the SCOPE input AI 0. The amplifier output pin 5 (LM386) can be connected to SCOPE input AI 1. Inject a small signal (0.2 Vpp) into the circuit input from the FGEN. Adjust the 10 kω pot for a comfortable output. Measure the circuit gain, and compare it with the expected gain. Note: With no components connected between pins 1 and 8 of the LM386 IC, the amplifier gain is set to 20. This implies that the input signal level (FGEN) should be no more than 0.75 V. Once the amplifier is tested, then it is time to replace the FGEN signal with the program Piano.vi and make some noise. 6 ni.com

Exercise 7-3: More Music Concepts Quality Suppose a trumpet, an oboe, and an acoustic guitar were to play the same note (frequency). They all sound quite different. How would you describe the sounds? You might say the trumpet sounds brassy, the oboe sounds haunting, and the guitar sounds mellow. Each note has a fundamental frequency and a set of harmonics. All musical instruments, including your voice, have a unique set of harmonics that make up their sound signatures. A sine wave has no harmonics, just sin(ωt). A composite waveform, however, can have any number of harmonics. Take, for example, a triangular waveform, which has a fundamental frequency and two harmonics: sin(ωt) + sin(2ωt) + sin(3ωt). Let s use mydaq to explore this idea. The FGEN can only output on one channel, AO 0. However, the ipod connector has two outputs (stereo) with a separate channel for each ear. The arbitrary waveform generator (ARB) has two outputs. Let s put a pure sine wave into one channel (left ear) and our composite waveform into the other channel (right ear). Now it will be easy to hear the difference. Note: If you are not familiar with the ARB, check out the reference http://decibel.ni.com/content/docs/doc-12941. Launch the Arbitrary Waveform Generator Channel [AudioOutout Left] is enabled and Sine1.wdt entered in the Waveform Name box. Channel [AudioOutput Right] is enabled and Sine3.wdt entered in the Waveform Name box. Note: Use the folder icon to navigate to where your.wdt files are stored. The update rate is 20 k samples per second (S/s) and run continuously. National Instruments Corporation 7

Connect your stereo speakers or earphone to the mydaq [AUDIO OUT] socket. Click on [Run] and explore the differences. Can you hear which channel is the sine wave and which is the composite wave? Try changing the update rate. Any difference? Compare the wave file pairs: Sine1.wdt and Sine3.wdt (1.0 sinωt, 1.0 sinωt + 0.25 sin3ωt) Sine1.wdt and Triangle.wdt Sine1.wdt and Square.wdt What can you conclude? (The larger the discontinuities in the waveform, the harsher the signal sounds.) Historical Note: Fourier Series Theorem Any periodic waveform can be generated by an infinite number of sine and cosine waveforms harmonically related. Look at these examples: Triangle waveform = sin(ωt) 1/9 sin(3ωt) 1/25 sin(5ωt) +... Square waveform = sin(ωt) + 1/3 sin(3ωt) + 1/5 sin(5ωt) + Our ability to view these harmonics is the key to many scientific measurements. In the next Lab we will look at techniques for viewing the harmonic content of a periodic signal, or see graphically its sound signature. 8 ni.com