with - < n < +. There are two types of approximations associated with the sampling process. finite precision of the ADC finite sampling frequency.

Similar documents
Course Web site:

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

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

UNIVERSITY OF BOLTON SCHOOL OF ENGINEERING BENG (HONS) ELECTRICAL AND ELECTRONIC ENGINEERING SEMESTER 2 EXAMINATION 2016/2017

The following exercises illustrate the execution of collaborative simulations in J-DSP. The exercises namely a

Linear Time Invariant (LTI) Systems

Experiment 2: Sampling and Quantization

Multirate Digital Signal Processing

Module 8 : Numerical Relaying I : Fundamentals

Politecnico di Torino HIGH SPEED AND HIGH PRECISION ANALOG TO DIGITAL CONVERTER. Professor : Del Corso Mahshid Hooshmand ID Student Number:

Design and VLSI Implementation of Oversampling Sigma Delta Digital to Analog Convertor Used For Hearing Aid Application

Tutorial on Technical and Performance Benefits of AD719x Family

Digital Signal. Continuous. Continuous. amplitude. amplitude. Discrete-time Signal. Analog Signal. Discrete. Continuous. time. time.

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

Department of Electrical & Electronic Engineering Imperial College of Science, Technology and Medicine. Project: Real-Time Speech Enhancement

Problem Set #1 Problem Set Due: Friday, April 12

Fourier Transforms 1D

Basic rules for the design of RF Controls in High Intensity Proton Linacs. Particularities of proton linacs wrt electron linacs

Signals and Systems. Spring Room 324, Geology Palace, ,

MIXED-SIGNAL AND DSP DESIGN TECHNIQUES

Multirate Signal Processing: Graphical Representation & Comparison of Decimation & Interpolation Identities using MATLAB

Problem Weight Score Total 100

Appendix D. UW DigiScope User s Manual. Willis J. Tompkins and Annie Foong

Digital Signal Processing Detailed Course Outline

MULTISIM DEMO 9.5: 60 HZ ACTIVE NOTCH FILTER

MASSACHUSETTS INSTITUTE OF TECHNOLOGY Department of Electrical Engineering and Computer Science Introductory Digital Systems Laboratory

B I O E N / Biological Signals & Data Acquisition

Lab 5 Linear Predictive Coding

REPORT DOCUMENTATION PAGE

FFT Laboratory Experiments for the HP Series Oscilloscopes and HP 54657A/54658A Measurement Storage Modules

Bunch-by-bunch feedback and LLRF at ELSA

Removal of Decaying DC Component in Current Signal Using a ovel Estimation Algorithm

ECE 45 Homework 2. t x(τ)dτ. Problem 2.2 Find the Bode plot (magnitude and phase) and label all critical points of the transfer function

Introduction to Signal Processing D R. T A R E K T U T U N J I P H I L A D E L P H I A U N I V E R S I T Y

ZONE PLATE SIGNALS 525 Lines Standard M/NTSC

Digitizing and Sampling

Experiment 13 Sampling and reconstruction

FX Basics. Time Effects STOMPBOX DESIGN WORKSHOP. Esteban Maestre. CCRMA Stanford University July 2011

Calibrate, Characterize and Emulate Systems Using RFXpress in AWG Series

Fundamentals of DSP Chap. 1: Introduction

VIRTUAL INSTRUMENTATION

Intro to DSP: Sampling. with GNU Radio Jeff Long

Pole Zero Correction using OBSPY and PSN Data

Sensor Development for the imote2 Smart Sensor Platform

Recommended Operations

Getting Started with the LabVIEW Sound and Vibration Toolkit

Area-Efficient Decimation Filter with 50/60 Hz Power-Line Noise Suppression for ΔΣ A/D Converters

9. TIME DOMAIN INDUCED POLARIZATION PROGRAM (TDIP)

An Introduction to the Sampling Theorem

Journal of Theoretical and Applied Information Technology 20 th July Vol. 65 No JATIT & LLS. All rights reserved.

1.1 Digital Signal Processing Hands-on Lab Courses

Sound and Vibration Data Acquisition

IN DEPTH INFORMATION - CONTENTS

Suverna Sengar 1, Partha Pratim Bhattacharya 2

Digital Signal Processing (DSP)

1 Overview. 1.1 Digital Images GEORGIA INSTITUTE OF TECHNOLOGY. ECE 2026 Summer 2018 Lab #5: Sampling: A/D and D/A & Aliasing

A review on the design and improvement techniques of comb filters

Crash Course in Digital Signal Processing

MUSICAL APPLICATIONS OF NESTED COMB FILTERS FOR INHARMONIC RESONATOR EFFECTS

1 Overview. 1.1 Digital Images GEORGIA INSTITUTE OF TECHNOLOGY. ECE 2026 Summer 2016 Lab #6: Sampling: A/D and D/A & Aliasing

Spectrum Analyser Basics

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

Techniques for Extending Real-Time Oscilloscope Bandwidth

Reconfigurable FPGA Implementation of FIR Filter using Modified DA Method

NanoGiant Oscilloscope/Function-Generator Program. Getting Started

WINTER 15 EXAMINATION Model Answer

Chapter 3. Basic Techniques for Speech & Audio Enhancement

Single Channel Speech Enhancement Using Spectral Subtraction Based on Minimum Statistics

EECS 373 Design of Microprocessor-Based Systems

Math Assignment 10

Lecture 3, Opamps. Operational amplifiers, high-gain, high-speed

Dithering in Analog-to-digital Conversion

Lecture 18: Exam Review

ECSE-4760 Real-Time Applications in Control & Communications INTRODUCTORY LAB EXPERIMENT

Session 1 Introduction to Data Acquisition and Real-Time Control

INDIAN INSTITUTE OF TECHNOLOGY KHARAGPUR NPTEL ONLINE CERTIFICATION COURSE. On Industrial Automation and Control

FPGA Implementation of Optimized Decimation Filter for Wireless Communication Receivers

Embedded Signal Processing with the Micro Signal Architecture

WaveDriver 20 Potentiostat/Galvanostat System

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

Analog-to-Digital Conversion

Analog to Digital Conversion

Performance Analysis and Behaviour of Cascaded Integrator Comb Filters

Upgrading E-learning of basic measurement algorithms based on DSP and MATLAB Web Server. Milos Sedlacek 1, Ondrej Tomiska 2

PRODUCT SHEET

Digitization: Sampling & Quantization

Clock Jitter Cancelation in Coherent Data Converter Testing

Understanding Sampling rate vs Data rate. Decimation (DDC) and Interpolation (DUC) Concepts

NON-UNIFORM KERNEL SAMPLING IN AUDIO SIGNAL RESAMPLER

Introduction to Computers and Programming

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

Beamline improvement during g2p experiment. Pengjia Zhu

Amplification. Most common signal conditioning

A Parametric Autoregressive Model for the Extraction of Electric Network Frequency Fluctuations in Audio Forensic Authentication

Hugo Technology. An introduction into Rob Watts' technology

A Parametric Autoregressive Model for the Extraction of Electric Network Frequency Fluctuations in Audio Forensic Authentication

Digital Signal Processing

Synthesized Clock Generator

Specifications. End-Point Linearity - ±5% F.S., when used with HACO SCR-speed control

Laboratory Assignment 3. Digital Music Synthesis: Beethoven s Fifth Symphony Using MATLAB

Transcription:

EE345M/EE380L.6 Lecture 0. Lecture 0 objectives are to: Introduce basic principles involved in digital filtering, Define the and use it to analyze filters, Develop digital filter implementations "hello", before filtering "hello", after filtering Basic Principles x c (t) is a continuous analog signal. f s is the sample rate = x c (nt) with - < n < +. There are two types of approximations associated with the sampling process. finite precision of the ADC finite sampling frequency. 2 properly represented aliased z undetectable frequency f 2 s To prevent aliasing there should be no measurable signal above 0.5fs. A causal digital filter calculates y(n) from y(n-), y(n-2),... and, x(n-), x(n-2),... not future data (e.g., y(n+), x(n+) etc.) A linear filter is constructed from a linear equation. A nonlinear filter is constructed from a nonlinear equation. One nonlinear filter is the median. A finite impulse response filter (FIR) relates y(n) only in terms of, x(n-), x(n-2),... + x(n-3) y(n) = 2 An infinite impulse response filter (IIR) relates y(n) in terms of both, x(n-),..., and y(n ), y(n-2),... The definition of the -: X(z) = [] z -n n=- y(n) = (3 + 3 x(n-2) - 98 y(n-2))/28

EE345M/EE380L.6 Lecture 0.2 Consider the continuous time domain x(t) discrete time domain frequency domain X(s) frequency domain Fig 5. A transform is used to study a signal in the frequency domain. X(z) x(t) Analog System y(t) Digital System y(n) X(s) H(s) Y(s)=H(s) X(s) X(z) H(z) Y(z)=H(z) X(z) Figure 5.2. A transform can also be used to study a system in the frequency domain. The gain = H(s) at s = j 2 f, for all frequencies, f. The phase = angle(h(s)) at s = j 2 f. The gain and phase of a digital system is specified in its transform, H(z) = Y(z)/X(z). 2 f s from DC to One can use the definition of the - to prove that: [x(n-m)] = z -m [] = z -m X(z) For example if X(z) is the - of, then z -2 X(z) is the - of x(n-2). H(z) Y(z) X(z) To find the response of the filter, let z be a complex number on the unit circle or z e j2 f/f s z = cos(2 f/f s ) + j sin(2 f/f s ) for 0 f < 2 f s Let H(f) = a + bj where a and b are real numbers The gain of the filter is the complex magnitude of H(z) as f varies from 0 to 2 f s. Gain H(f) = a 2 + b 2

EE345M/EE380L.6 Lecture 0.3 The phase response of the filter is the angle of H(z) as f varies from 0 to 2 f s. Phase angle[h(f)] = tan - b a (3) 5.3 MACQ New data MACQ before x[0] x[] x(n-) x[2] x(n-2) x[3] x(n-3) 4 3 2 MACQ after x(n-) x(n-2) x(n-3) Figure 5.8. When data is put into a multiple access circular queue, the oldest data is lost d(n) = +3x(n-)-3x(n-2)-x(n-3) t short x[4]; // MACQ (mv) short d; // derivative(v/s) void ADC3_Handler(void){ ADC_ISC_R = ADC_ISC_IN3; // acknowledge ADC sequence 3 completion x[3] = x[2]; // shift data x[2] = x[]; // units of mv x[] = x[0]; x[0] = (375*(ADC_SSFIFO3_R&ADC_SSFIFO3_DATA_M))>>7; // in mv d = x[0]+3*x[]-3*x[2]-x[3]; // in V/s Fifo_Put(d); // pass to foreground Program 5.3. Software implementation of first derivative using a multiple access circular queue. MACQ before Pt x[0] x[] x[2] x[3] x[4] x[5] x[6] x[7] x[8] x[9] x[0] x[] x[2] x[3] x[4] x(n-8) x(n-9) x(n-0) x(n-) x(n-2) x(n-3) x(n-4) x(n-5) x(n-) x(n-2) x(n-3) x(n-4) x(n-5) x[5] x[6] x(n-8) x[7] x(n-9) x[8] x(n-0) x[9] x(n-) x[20] x(n-2) x[2] x[22] x[29] x[30] x[3] x(n-3) x(n-4) x(n-5) x[23] x[24] x[25] x(n-) x[26] x(n-2) x[27] x(n-3) x[28] x(n-4) x(n-5) MACQ after New data Pt 3 x[0] x[] x[2] x[3] x[4] x[5] 2 x[6] x[7] x[8] x[9] x[0] x[] x[2] x[3] x[4] x[5] x[2] x[22] x[23] x[24] x[29] x[30] x[3] x(n-9) x(n-0) x(n-) x(n-2) x(n-3) x(n-4) x(n-5) x(n-) x(n-2) x(n-3) x(n-4) x(n-5) x(n-8) x[6] x(n-9) x[7] x(n-0) x[8] x(n-) x[9] x(n-2) x[20] x(n-3) x(n-4) x(n-5) x(n-) x[25] x(n-2) x[26] x(n-3) x[27] x(n-4) x[28] x(n-5) x(n-8) Figure 5.9. When data is put into a multiple access circular queue, the oldest data is lost.

EE345M/EE380L.6 Lecture 0.4 unsigned short x[32]; // two copies unsigned short *Pt; // pointer to current unsigned short Sum; // sum of the last 6 samples void LPF_Init(void){ Pt = &x[0]; Sum = 0; // calculate one filter output // called at sampling rate // Input: new ADC data // Output: filter output, DAC data unsigned short LPF_Calc(unsigned short newdata){ Sum = Sum - *(Pt+6); // subtract the one 6 samples ago if(pt == &x[0]){ Pt = &x[6]; // wrap else{ Pt--; // make room for data *Pt = *(Pt+6) = newdata; // two copies of the new data return Sum/6; Program 5.4. Digital low pass filter implemented by averaging the previous 6 samples (cutoff = f s /32). 5.4. Using the - to Derive Filter Response Although this filter appears to be simple, we can use it to implement a low-q 60 Hz notch. y(n) = (+x(n-3))/2 Again we take the - of both: Y(z) = (X(z) + z -3 X(z))/2 Next we rewrite the equation in the form of H(z)=Y(z)/X(z). H(z) Y(z)/X(z) = ½ ( + z -3 ) We can to determine the gain and phase response of this filter. H(f) = ½ ( + e -j6 f/fs ) = ½ ( + cos(6 f/f s ) - j sin(6 f/f s ) ) Gain H(f) = ½ sqrt(( + cos(6 f/f s )) 2 + sin(6 f/f s ) 2 )) Phase angle(h(f)) = tan - (-sin(6 f/f s )/( + cos(6 f/f s )) short x[4]; // MACQ void ADC3_Handler(void){ short y; ADC_ISC_R = ADC_ISC_IN3; x[3] = x[2]; // shift data x[2] = x[]; // units, ADC sample 0 to 023 x[] = x[0]; x[0] = ADC_SSFIFO3_R&ADC_SSFIFO3_DATA_M; // 0 to 024 y = (x[0]+x[3])/2; // filter output Fifo_Put(y); // pass to foreground Program 5.5. If the sampling rate is 360 Hz, this filter rejects 60 Hz. // acknowledge ADC sequence 3 completion.5.0 y(n) =(y(n-)+)/2 y(n) =(+x(n-))/2 y(n) =(+x(n-)+x(n-2)+ x(n-3)+x(n-4)+x(n-5))/6 Gain y(n) =(+x(n-3))/2 0.5 0.0 0.0 0. 0.2 0.3 0.4 0.5 frequency f/fs Figure 5.0. Gain versus frequency response for four simple digital filters.

EE345M/EE380L.6 Lecture 0.5 5.5. IIR Filter design There are two objectives for this example show an example of a digital notch filter, demonstrate the use of fixed-point math. 60 Hz noise is a significant problem in most data acquisition systems. The 60 Hz noise reduction can be accomplished: ) Reducing the noise source, e.g., shut off large motors; 2) Shielding the transducer, cables, and instrument; 3) Implement a 60 Hz analog notch filter; 4) Implement a 60 Hz digital notch filter. analog condition digital condition consequence zero near s=j2πf line zero near z=e j2πf/fs low gain near the zero pole near s=j2πf line pole near z=e j2πf/fs high gain near the pole zeros in conjugate pairs zeros in conjugate pairs the output y(t) is real poles in conjugate pairs poles in conjugate pairs the output y(t) is real poles in left half plane poles inside unit circle stable system poles in right half plane poles outside unit circle unstable system pole near a zero pole near a zero high Q response Table Analogies between the analog and digital filters. It is the 60 Hz digital notch filter that will be implemented in this example. The signal is sampled at fs=480 Hz. We wish to place the zeros (gain=0) at 60 Hz, thus = ± 2π 60 fs = ± π/4 4 f s = /2 poles z = e j =2 f/fs 2 f s = =0 zeros - 4 f s =- /2 Figure 5.3. Pole-zero plot of a 60 Hz digital notch filter. The zeros are located on the unit circle at 60 Hz z = cos( ) + j sin( ) z 2 = cos( - j sin( ) To implement a flat pass band away from 60 Hz the poles are placed next to the zeros, just inside the unit circle. Let define the closeness of the poles where 0 < <. for = 0.75 p = z p 2 = z 2 The transfer function is

EE345M/EE380L.6 Lecture 0.6 k (z z ) H(z) = i (z z )(z z ) 2 (z p ) (z p i i )(z p 2 ) which can be put in standard form (i.e., with terms, z -, z -2...) 2 cos( )z z 2 H(z) = 2 cos( )z 2 z 2 y(n) = + x(n-2) -(49*y(n-2))/64 + z -2 H(z) = + 49 64 z-2 At z= this reduces to 2 28 DC Gain = + 49 = 64 + 49 = 28 3 64 y(n) = (3 + 3 x(n-2) - 98 y(n-2))/28 long x[3]; // MACQ for the ADC input data long y[3]; // MACQ for the digital filter output void ADC3_Handler(void){ ADC_ISC_R = ADC_ISC_IN3; x[2] = x[]; x[] = x[0]; // shift data y[2] = y[]; y[] = y[0]; x[0] = ADC_SSFIFO3_R&ADC_SSFIFO3_DATA_M; // 0 to 024 // acknowledge ADC sequence 3 completion y[0] = (3*(x[0]+x[2])-98*y[2])/28; // filter output Fifo_Put((short)y[0]); // pass to foreground Program 5.7. If the sampling rate is 240 Hz, this filter rejects 60 Hz. The Q of a digital notch filter is defined to be Q f c f where fc is the center or notch frequency, and f frequency range where is gain is below 0.707 of the DC gain. Gain.0 0.9 0.8 0.7 0.6 0.5 0.4 0.3 0.2 0. 0.0 y(n)=(+x(n-3))/2 fs=360hz y(n) = (3 +3 x(n-2)-98 y(n-2))/28 fs=240 Hz FIR Program 5.5 IIR Program 5.7 0 20 40 60 80 00 20 40 60 80 Frequency (Hz) Figure 5.4. Gain versus frequency response of two 60 Hz digital notch filters. f Show the two spreadsheets DigitalNotchFilter.xls (DigitalFilterDesign.xls)