Lab 1 Introduction to the Software Development Environment and Signal Sampling

Similar documents
Experiment 2: Sampling and Quantization

MIE 402: WORKSHOP ON DATA ACQUISITION AND SIGNAL PROCESSING Spring 2003

Digital Signal Processing Laboratory 7: IIR Notch Filters Using the TMS320C6711

ME EN 363 ELEMENTARY INSTRUMENTATION Lab: Basic Lab Instruments and Data Acquisition

NanoGiant Oscilloscope/Function-Generator Program. Getting Started

Lab experience 1: Introduction to LabView

Operating Instructions

Introduction To LabVIEW and the DSP Board

Multiband Noise Reduction Component for PurePath Studio Portable Audio Devices

Spectrum Analyser Basics

Oscilloscope Guide Tektronix TDS3034B & TDS3052B

Introduction: Overview. EECE 2510 Circuits and Signals: Biomedical Applications. ECG Circuit 2 Analog Filtering and A/D Conversion

Major Differences Between the DT9847 Series Modules

System Requirements SA0314 Spectrum analyzer:

S op o e p C on o t n rol o s L arni n n i g n g O bj b e j ctiv i e v s

Log-detector. Sweeper setup using oscilloscope as XY display

GALILEO Timing Receiver

Lab 2: A/D, D/A, and Sampling Theorem

Experiment # 5. Pulse Code Modulation

Getting Started with the LabVIEW Sound and Vibration Toolkit

DT9857E. Key Features: Dynamic Signal Analyzer for Sound and Vibration Analysis Expandable to 64 Channels

Agilent DSO5014A Oscilloscope Tutorial

Digital Effects Pedal Description Ross Jongeward 10 December 2014

Quick Start for TrueRTA (v3.5) on Windows XP (and earlier)

Diamond Cut Productions / Application Notes AN-2

ECE438 - Laboratory 4: Sampling and Reconstruction of Continuous-Time Signals

B I O E N / Biological Signals & Data Acquisition

Laboratory 5: DSP - Digital Signal Processing

Experiment # 4 Counters and Logic Analyzer

MTL Software. Overview

Experiment 13 Sampling and reconstruction

Session 1 Introduction to Data Acquisition and Real-Time Control

Introduction to the oscilloscope and digital data acquisition

DPD80 Visible Datasheet

-SQA-SCOTTISH QUALIFICATIONS AUTHORITY HIGHER NATIONAL UNIT SPECIFICATION GENERAL INFORMATION

QUICK START GUIDE FOR DEMONSTRATION CIRCUIT /12/14 BIT 10 TO 65 MSPS DUAL ADC

DPD80 Infrared Datasheet

Beginners How to Test DSO138mini

2 MHz Lock-In Amplifier

USB Mini Spectrum Analyzer User s Guide TSA5G35

Features/Specifications

AcoustiSoft RPlusD ver

Experiment 9 Analog/Digital Conversion

USB Mini Spectrum Analyzer User Manual TSA Program for PC TSA4G1 TSA6G1 TSA8G1

QUICK START GUIDE FOR DEMONSTRATION CIRCUIT /12/14 BIT 10 TO 105 MSPS ADC

Data Acquisition Using LabVIEW

USB Mini Spectrum Analyzer User Manual PC program TSA For TSA5G35 TSA4G1 TSA6G1 TSA12G5

NI-DAQmx Device Considerations

USER S GUIDE DSR-1 DE-ESSER. Plug-in for Mackie Digital Mixers

PulseCounter Neutron & Gamma Spectrometry Software Manual

PEP-II longitudinal feedback and the low groupdelay. Dmitry Teytelman

PRELIMINARY INFORMATION. Professional Signal Generation and Monitoring Options for RIFEforLIFE Research Equipment

Analyzing and Saving a Signal

Data Converter Overview: DACs and ADCs. Dr. Paul Hasler and Dr. Philip Allen

Quick Start. RSHS1000 Series Handheld Digital Oscilloscope

Module 8 : Numerical Relaying I : Fundamentals

EMS DATA ACQUISITION AND MANAGEMENT (LVDAM-EMS) MODEL 9062-C

Oscilloscopes, logic analyzers ScopeLogicDAQ

User Manual. Digital Storage Oscilloscopes Models 2534, 2540 & 2542

User Manual. Digital Storage Oscilloscopes Models 2534, 2540 & General Safety Summary. Version 1.03

Fluke 190-Series II Firmware Upgrade V11.44

Manual Supplement. This supplement contains information necessary to ensure the accuracy of the above manual.

SingMai Electronics SM06. Advanced Composite Video Interface: HD-SDI to acvi converter module. User Manual. Revision 0.

Please feel free to download the Demo application software from analogarts.com to help you follow this seminar.

DT9834 Series High-Performance Multifunction USB Data Acquisition Modules

W0EB/W2CTX DSP Audio Filter Operating Manual V1.12

MULTIMIX 8/4 DIGITAL AUDIO-PROCESSING

Introduction to Digital Signal Processing (DSP)

Swept-tuned spectrum analyzer. Gianfranco Miele, Ph.D

SigPlay User s Guide

Manual for the sound card oscilloscope V1.41 C. Zeitnitz english translation by P. van Gemmeren, K. Grady and C. Zeitnitz

ADAT DC Coupling Modifications for Laser Graphic Recording

SingMai Electronics SM06. Advanced Composite Video Interface: DVI/HD-SDI to acvi converter module. User Manual. Revision th December 2016

PCM ENCODING PREPARATION... 2 PCM the PCM ENCODER module... 4

Rapid prototyping of of DSP algorithms. real-time. Mattias Arlbrant. Grupphandledare, ANC

Connecting To and Programming the LPC2148 Blue Board. Method 1 ISP (In-System Programming) w/ Flash Magic

Getting Started. Connect green audio output of SpikerBox/SpikerShield using green cable to your headphones input on iphone/ipad.

Installation of a DAQ System in Hall C

WaveDriver 20 Potentiostat/Galvanostat System

Ensemble QLAB. Stand-Alone, 1-4 Axes Piezo Motion Controller. Control 1 to 4 axes of piezo nanopositioning stages in open- or closed-loop operation

Design and Realization of the Guitar Tuner Using MyRIO

Digital Audio Design Validation and Debugging Using PGY-I2C

DT8837 Ethernet High Speed DAQ

Experiment 7: Bit Error Rate (BER) Measurement in the Noisy Channel

NOTICE: This document is for use only at UNSW. No copies can be made of this document without the permission of the authors.

DNT0212 Network Processor

ni.com Digital Signal Processing for Every Application

Cryoelectronics. MS-FLL User s Manual. Mr. SQUID Flux-Locked Loop. STAR Cryoelectronics 25 Bisbee Court, Suite A Santa Fe, NM U. S. A.

Electrical and Electronic Laboratory Faculty of Engineering Chulalongkorn University. Cathode-Ray Oscilloscope (CRO)

Investigation of Digital Signal Processing of High-speed DACs Signals for Settling Time Testing

Digital Lock-In Amplifiers SR850 DSP lock-in amplifier with graphical display

Professional Power Amplifier Specifications...8 SPECIFICATION

Portable USB Potentiostat Low-Current Portable USB Potentiostat Extended Voltage USB Potentiostat

Advanced Skills with Oscilloscopes

Advanced Troubleshooting with Oscilloscopes 9000 Scope Hands-on Labs

Analog Arts SA985 SA975 SA935 SA915 Product Specifications [1]

BER MEASUREMENT IN THE NOISY CHANNEL

MINI PC SCOPE PCSU01. User manual. test leads software download USB cable design enclosure

DNT0212 Network Processor

RICHLAND COLLEGE School of Engineering Business & Technology Rev. 0 W. Slonecker Rev. 1 (8/26/2012) J. Bradbury

Transcription:

ECEn 487 Digital Signal Processing Laboratory Lab 1 Introduction to the Software Development Environment and Signal Sampling Due Dates This is a three week lab. All TA check off must be completed before 3:00 p.m. January 31, or the lab will be marked late. Submit answers to the questions from the last page of this handout at the beginning of lab class on: Tues., January 17 Lab book write-up copy submission, beginning of lab class: Tues., January 31 Objectives The purpose of this lab is for each student to become familiar with the MATLAB data acquisition and processing environment, and to study the effects of signal sampling, aliasing, and basic signal input/output and plotting operations. Introduction In many real-world DSP applications a specialized microprocessor called a "Digital Signal Processor" is used to implement the structured, repetitive, high speed mathematical operations needed for "real-time" operation. Other high-speed DSP processor options include field programmable gate array (FPGA) implementations, or graphics processor units (GPUs) which were originally designed for high speed graphic display calculations. When the sample rate is too high, or the processing algorithm is too complex for the particular processing engine, a common tactic is to use "burst mode post processing." Rather than sample and process the data continuously, a block of data is acquired in memory with a single "burst" of acquisition sampling. Sampling is temporarily put on hold while the data is processed. When the data block processing is complete, another sampling burst begins, and the process repeats indefinitely. The advantage of this method is that very high sample rates are achievable. The 01/10/12 page 1

disadvantage is that big chunks of data are lost during the processing windows. However, this is a commonly used method for radio frequency analysis, including high-end Agilent digital spectrum analyzers, and high bandwidth digital sampling oscilloscopes. You will be using the built-in sound card of you lab PC as your data acquisition (ADC) and output (DAC) device. Processing will be performed using MATLAB and your general-purpose microprocessor. Though modern PCs have sufficient power to perform some audio DSP operations in real-time, MATLAB does not have provision for real-time interfacing with the sound card, and it is relatively slow (due to its default double precision floating point arithmetic and its implementation as an interactive interpreter). Thus all lab experiments this semester will be implemented using burst mode processing. This lab is intended to familiarize you with the analog signal sampling and output functions in MATLAB, and to help you understand some of the implications of decisions you make in designing a data acquisition system. Reading Assignment 1. MATLAB Help documentation for the following functions: sound, soundsc, wavrecord, wavplay, wavread, wavwrite, "debugging with the debugging window," and optionally: "creating graphical user interfaces." 2. Sections 4.1 and 4.2 of Oppenheim and Schafer. Task 1 Familiariz ation w ith MA TLA B A DC - DA C Operation: loopback program. In this task you will write a MATLAB script to sample an audio function generator and CD stereo signal using the built-in sound card, and play the signal out to speakers. This loopback program performs the same function as a simple audio patch cable (but with long delays and some dead time glitches between windows.) but will be the basis for future code development. 1. There are two mini-stereo phono jacks on the back panel of your lab PC: Blue: Line-in. Green: Line-out. The blue line-in connection will be used in all labs as the input to your analog to digital converter (ADC, or A/D). You must keep signal levels low (below 1 Volt peak) to avoid damaging the sound card. Connect your amplified speakers to the green line-out connection. When you are done with this lab, leave your cables plugged into the back of the computer for future use. 2. To enable back panel audio I/O connections, select the Windows control panel Hardware and Sound Realtek HD audio Manger icon to open the Realtek HD Audio Manager window. 01/10/12 page 2

On the Speakers tab set the main volume centered between L and R, and with a master level of about 50. Make sure the speaker configuration is set for stereo. While still on the Speakers tab, click the Default Format tab and select 16 Bits, 48000 Hz. Now, on the line In tab make sure that Playback Volume is muted by clicking on the speaker symbol. This keeps the sound card from bypassing your DSP processing and just feeing the input signal directly to the speakers. Set the Recording Volume to about 80, and the Default Format to 16 Bits, 48000 Hz. You may also want to adjust the system master volume levels at Windows control panel Hardware and Sound Sound Adjust system volume. 3. Startup MATLAB. There are two copies of MATLAB available on your machine, but you need to use the local copy to get sound I/O functions to work right. Access this at: All Programs ECEn Local Programs MATLAB R2011a. Also, make sure that you write and save all your scripts and data to either a removable USB memory stick, or to your personal CAEDM account network mounted J: drive. To insure this you must browse to your folder using the... button on the Current Folder window of the MATLAB desktop. If you write your files on the local machines hard drive, it may be erased when you return, or you may not have access to that machine next time. 4. Write a burst mode "loop back" MATLAB script which samples a block of data, then plays that block through the DAC to amplified speakers. Your code should allow user input to specify the sample rate, sample window block length in seconds, and how long it will run before terminating. Use the wavrecord and wavplay functions to write your code. For wavrecord, use the 'int16' data type argument to enforce memory storage in the native format of the ADC output. Note how operation changes when you use the 'async' optional parameter for wavplay. Explain what is happening and why in your lab book. 5. Evaluate how the loopback program operates using the function generator as you input. Use the maximum sound card sample rate of 48 ksamp/s. Try different sinusoidal frequencies and other waveforms. For this task, and all experiments below, observe your input and output signals simultaneously with two channels of the oscilloscope. Note differences you observe. 6. Provide a CD audio or MP3 player input to the line connection on the line-in back panel connector. Connect the amplified speakers the to line-out speaker output. Use the maximum sound card sample rate of 48 ksamp/s. Verify proper digital-audio loop input and output and note what volume levels lead to distortion. Can you detect any degradation in sound quality through the loopback? Should there be any noticeable change? Document your observations in your lab book. Have the TA check off your operating program. 01/10/12 page 3

Task 2 Use of MA TLA B debugging tools. 1. Practice using the MATLAB built-in debugging tools to evaluate your code's operation, including setting breakpoints, inspecting data array values, and single stepping. 2. Demonstrate to a TA your use of breakpoints to stop the loopback script after acquiring the 5th window of data. Plot the sampled data window, then continue non-stop operation. 3. Document your observations in your lab book. Include tips and instructions to help you build your next program. Task 3 Sampling principles 1. Modify your program to scale the audio data by a user specified fixed scale gain factor. Run the program with CD audio input and scale gains of 0.1 and 100. Record in your lab book what you observe. Explain what happens and why there may be distortion. 2. Using a combination of the volume control setting on your audio source, and the line input setting in the Windows recording control panel, set the signal level very low so that you can just hear it by using a scale-up factor of about 5,000 in your loopback code. Do you hear any noise? What is causing it? Why can't you simply compensate for an arbitrarily low level input signal by using a sufficiently high internal digital gain factor? 3. Modify the sample rate to 2 khz, 6 khz and 12 khz. Run the program for each case with CD audio input and record in your lab book what you observe. Is there any signal quality change? Distortion? Is there any aliasing? Explain what happens and why (hint: the sound card is pretty smart, and there is a switched capacitor analog/digital filter preceding the ADC which is adjusted according to the sample rate setting. What do you think it is doing?) 4. Change the sample rate back to 48 khz. Modify the program to perform digital downsampling by a factor of 8, i.e. discard 7 out of every 8 samples in both the left and right signal channels, leaving the fourth unchanged. The sample rate for wavplay should be set at 1/8 the sample rate for wavrecord. Note that this produces the same effective sample rate as the 6 khz case in part 2 above, but leaves the anti-alias filter for the ADC set for a corner frequency of 20 khz. Run the program for each case with CD audio input and record in your lab book what you observe. Is there any signal quality change? Distortion? Explain what happens and why it is different from the 6 khz result of step 3 above. What technical term describes the distortion you hear? Demonstrate your running program to the TA. 5. Using the digital down sampling method of step 4 above, drive your loopback program with a pure sinusoid from the function generator. Sweep the input frequency slowly from 100 Hz 01/10/12 page 4

up to 20 khz while listening to the output, and observing both input and output signals on the oscilloscope. Describe and explain what you observe and hear. What should the output signal be when the input frequency is at 11.5 khz? Task 4 Build a digital oscilloscope. 1. Write a burst mode MATLAB script to implement a two channel digital sampling oscilloscope using the "wavrecord" and "plot" functions. Sample rate should be fixed at 48 ksamp/s, and the plot window will have 480 points. Make the sample window block 1.0 seconds long. The choice of which 480 samples in the block are plotted depends on the trigger detection and time base operations described below. 2. Provide a triggering function where your code detects the input signal (say on the left channel) crossing a threshold amplitude level. The first sample in the data block that crosses the threshold becomes the first sample in your plot. This insures that successive plot windows properly align the signal waveform. You will need to detect the difference between a rising and falling slope as it crosses the threshold. Single sweep and continuous run options must be demonstrated. If no crossing is detected in the widow block, set the first sample as the trigger sample. 3. Provided user controlled ability to set internal digital gain (scaling) levels for the two channels. The plot axis scale will need to be set to fixed values (rather than the default auto scale) depending on your gain setting. 4. Provided user controlled selection of time base for the horizontal sweep. Required setting options are 0.5, 0.2, 0.1, 0.05, and 0.02 seconds to span the horizontal axis of the full 480 sample plot. For example, when the 0.1 second setting is chosen, the plot displays only every tenth sample in the data block, beginning with the trigger threshold crossing sample. 5. Optional (no extra credit, but it is cool if you can do it). Use GUI interface functions built into MATLAB to implement the user control settings for channel gain, trigger level, and time base. Conclusions Write a paragraph or two of conclusions for your lab experience. Discuss any additional implications of what you observed. Describe what you feel are the important principals demonstrated in this lab, and note anything that you learned unexpectedly. What debug and redesign procedures did you need to perform to get it to work? 01/10/12 page 5

Questions (Due at beginning of second session for this lab assignment) 1. Assuming an ideal 16 bit analog to digital converter with a bipolar signal, what is its dynamic range in db? Dynamic range is calculated as the ratio of maximum to minimum signals that can be represented without overflow, or underflow. Assume your minimum signal peak values are at the voltage level of 1 LSB. 2. When sampling a 2.57 khz sinusoid using an ADC with a sample frequency of 8 k samples/s: (assume no anti-aliasing filter for the ADC) a) What will the discrete-time radian frequency be for the resulting sampled signal? b) What will the continuous-time frequency be if this signal is output through a DAC with a sample rate of 8 k samples/s? 3. Repeat problem 2 with the input analog sinusoid at 10.7 khz, 8 k samples/s ADC, and a DAC sample rate of 44.1 k samples/s. 4. Show the correct function call statement with all parameter values to sample 10 seconds of a stereo signal with 48 k samples/s, with eight bits per sample. Give the corresponding statement to play this acquired data back out through the sound card. 5. Describe how to use a breakpoint in your function code to inspect, by plotting, values in an array immediately before and immediately after they have been altered by one line in the function. (e.g. assume line 57 in the function dummycode.m is " v = v + sin(pi/10*[0:100]);" You suspect there is a bug in this line. you want to inspect, i.e. plot, v.) 01/10/12 page 6