ECE 5655/4655 Laboratory Problems

Similar documents
ECE 5655/4655 Laboratory Problems

Analog Circuits and Systems

Equalizers. Contents: IIR or FIR for audio filtering? Shelving equalizers Peak equalizers

Phase Correction System Using Delay, Phase Invert and an All-pass Filter

ECE 5650/4650 Exam II November 20, 2018 Name:

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

Lab 6 - MCU CODEC IIR Filter ReadMeFirst

ELEC3104: Digital Signal Processing Session 1, 2013

Project 2. Project 2: audio equalizer. Fig. 1: Kinter MA-170 stereo amplifier with bass and treble controls.

ECE 203 LAB 2 PRACTICAL FILTER DESIGN & IMPLEMENTATION

Subtractive Synthesis. Describing a Filter. Filters. CMPT 468: Subtractive Synthesis

Application Note 7. Digital Audio FIR Crossover. Highlights Importing Transducer Response Data FIR Window Functions FIR Approximation Methods

Frequency Selective Circuits

Presented at the 108th Convention 2000 February Paris, France

Problem Point Value Your score Topic 1 28 Filter Analysis 2 24 Filter Implementation 3 24 Filter Design 4 24 Potpourri Total 100

Signal Processing. Introduction

Infinite Impulse Response (IIR) Filter. Ikhwannul Kholis, ST., MT. Universitas 17 Agustus 1945 Jakarta

APPENDIX A to VOLUME A1 TIMS FILTER RESPONSES

Electrical & Computer Engineering Technology

Signal processing preliminaries

The Filter Wizard issue 13: Buenos Notches! The Filter Wizard versus the vuvuzela Kendall Castor-Perry

3.2 Measuring Frequency Response Of Low-Pass Filter :

Laboratory Assignment 4. Fourier Sound Synthesis

Butterworth Active Bandpass Filter using Sallen-Key Topology

RECOMMENDATION ITU-R SM.1268*

Build Your Own Bose WaveRadio Bass Preamp Active Filter Design

Frequency Domain Representation of Signals

SIGMA-DELTA CONVERTER

ECE 5625 Spring 2018 Project 1 Multicarrier SSB Transceiver

EECS 452 Midterm Exam Winter 2012

ECE438 - Laboratory 7a: Digital Filter Design (Week 1) By Prof. Charles Bouman and Prof. Mireille Boutin Fall 2015

ESE531 Spring University of Pennsylvania Department of Electrical and System Engineering Digital Signal Processing

CEPT/ERC Recommendation ERC E (Funchal 1998)

FX Basics. Filtering STOMPBOX DESIGN WORKSHOP. Esteban Maestre. CCRMA - Stanford University August 2013

Multirate Filtering, Resampling Filters, Polyphase Filters. or how to make efficient FIR filters

Lecture 17 z-transforms 2

SMS045 - DSP Systems in Practice. Lab 1 - Filter Design and Evaluation in MATLAB Due date: Thursday Nov 13, 2003

DSP First. Laboratory Exercise #11. Extracting Frequencies of Musical Tones

Problem Point Value Your score Topic 1 28 Discrete-Time Filter Analysis 2 24 Improving Signal Quality 3 24 Filter Bank Design 4 24 Potpourri Total 100

Signals and Filtering

Audio Engineering Society. Convention Paper. Presented at the 117th Convention 2004 October San Francisco, CA, USA

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

GEORGIA INSTITUTE OF TECHNOLOGY. SCHOOL of ELECTRICAL and COMPUTER ENGINEERING. ECE 2026 Summer 2018 Lab #8: Filter Design of FIR Filters

Lecture 7 Frequency Modulation

Laboratory Assignment 2 Signal Sampling, Manipulation, and Playback

Digital Signal Processing ETI

Practical applications of digital filters

EECS 452 Midterm Closed book part Winter 2013

ECE 4670 Spring 2014 Lab 1 Linear System Characteristics

Project 1. Notch filter Fig. 1: (Left) voice signal segment. (Right) segment corrupted by 700-Hz sinusoidal buzz.

Analog Lowpass Filter Specifications

Experiment 2 Effects of Filtering

Active Filter Design Techniques

Laboratory Project 4: Frequency Response and Filters

Low Pass Filter Introduction

EQ s & Frequency Processing

EE477 Digital Signal Processing Laboratory Exercise #13

Signal Processing Toolbox

Experiment No. 6. Audio Tone Control Amplifier

Experiment 6: Multirate Signal Processing

Signal Processing First Lab 20: Extracting Frequencies of Musical Tones

Lab 4: Static & Switched Audio Equalizer

EXPERIMENT 1: Characteristics of Passive and Active Filters

Additive Synthesis OBJECTIVES BACKGROUND

Digital Signal Processing ETI

Outline. Communications Engineering 1

Outline. J-DSP Overview. Objectives and Motivation. by Andreas Spanias Arizona State University

On the Most Efficient M-Path Recursive Filter Structures and User Friendly Algorithms To Compute Their Coefficients

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

DSP First. Laboratory Exercise #7. Everyday Sinusoidal Signals

Overview of the EQ50 Filter Functions. Bypass Hardwire Bypass

Understanding the Behavior of Band-Pass Filter with Windows for Speech Signal

Sampling and Reconstruction of Analog Signals

Lab P-4: AM and FM Sinusoidal Signals. We have spent a lot of time learning about the properties of sinusoidal waveforms of the form: ) X

Lab Report #10 Alex Styborski, Daniel Telesman, and Josh Kauffman Group 12 Abstract

The University of Texas at Austin Dept. of Electrical and Computer Engineering Midterm #1

Experiment 02: Amplitude Modulation

Lab 4 An FPGA Based Digital System Design ReadMeFirst

14 fasttest. Multitone Audio Analyzer. Multitone and Synchronous FFT Concepts

Lecture 3, Multirate Signal Processing

DSP Laboratory (EELE 4110) Lab#11 Implement FIR filters on TMS320C6711 DSK.

Chapter 7: Signal Processing (SP) Tool Kit reference

FREQUENCY RESPONSE AND PASSIVE FILTERS LABORATORY

Project 2 - Speech Detection with FIR Filters

YEDITEPE UNIVERSITY ENGINEERING FACULTY COMMUNICATION SYSTEMS LABORATORY EE 354 COMMUNICATION SYSTEMS

Filters. Phani Chavali

Digital Signal Processing of Speech for the Hearing Impaired

EECS 452 Midterm Exam (solns) Fall 2012

Lab Assignment 1 Spectrum Analyzers

Lab 8: Frequency Response and Filtering

Review of Filter Types

Lakehead University. Department of Electrical Engineering

Lecture 6. Angle Modulation and Demodulation

Discrete Fourier Transform

Linear Time-Invariant Systems

MATLAB for Audio Signal Processing. P. Professorson UT Arlington Night School

Back to. Communication Products Group. Technical Notes. Adjustment and Performance of Variable Equalizers

Estimation of Predetection SNR of LMR Analog FM Signals Using PL Tone Analysis

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

Operational Amplifiers

Transcription:

Assignment #5 ECE 5655/4655 Laboratory Problems Make Note of the Following: Due MondayApril 29, 2019 If possible write your lab report in Jupyter notebook If you choose to use the spectrum/network analyzer to obtain tiff graphics, just import these graphics files into Jupyter notebook as well. Problems: Real-Time IIR Digital Filters Hf db 0 1 70 0 3.5k 4k 8k 8.5k 1. Cascade of Biquads IIR Using Floating-Point Coefficients a.) Using a 48 khz sampling rate and the main module FM4_IIR_intr.c, design an elliptic bandpass filter using Python (see examples in notes Chapter 7) that satisfies the amplitude response specifications shown below. Create a header filter file in SOS format as described in the Assignment 5 Jupyter notebook. Compare the elliptic design to the complexity of Butterworth and Cheby 1 designs. b.) Provide Python design information, including magnitude and phase response plots. Your plots should use a digital frequency axis scaled to the actual sampling frequency. c.) Verify the filter real-time frequency response by placing the coefficients in a working cascade of biquads IIR filtering program such as described in notes Chapter 7. d.) For verification all you need to obtain is the frequency response magnitude in db. The best approach is probably to use the vector network analyzer, but optionally you can drive the filter routine with the software noise generator or the noise source in the Analog Discovery. Once you have experimental data in a file, import it into your Jupyter notebook (again see the Chapter 7 sample notebook) to overlay with the theoretical response. e.) Time your code with -o3 optimization using the GPIO IRQ timing pulse. Estimate the maximum sampling rate possible without loss of real-time performance? Switch to the ARM SOS routine to see how much faster it is. 24k f

2. Using the GUI parameter slider control for he Cypress FM to implement a variable center frequency notch filter of the form He j 1 2cos 0 z 1 + z 2 = --------------------------------------------------------, 0 1 2r 0 z 1 r 2 z 2 0 cos + with r = 0.9. The parameter the GUI adjusts will be 0 or have some relation to it. Use float32_t for your design. Test the filter with a sampling frequency of 48 khz, and verify using the network analyzer the ability to tune the notch around the interval f 0 0 2Hz. What is the notch depth in db when tuned to about 1 khz? I will expect a sound demo of this in the lab. A nice test of this system is to sum an audio music source together with a single tone jammer from a function generator, and then see how well the tone can be suppressed from the music without coloration. With a second slider you can use r to adjust the filter bandwidth. As an audio source you can use an MP3 player/ipod, portable CD player, or Web radio. Note: The notch filter above is really just a single biquad section. So create an SOS coefficients array as described in notes Chapter 7, such that you can change values in the array according to the needed 0 and r values. Then you can use the filter functions found in IIR_filters.c/IIR_filters.h, i.e., IIR_sos_filt_float32() or use the CMSIS-DSP functions arm_biquad_cascade_df2t_f32()/arm_biquad_cascade_df2t_init_f32(). As globals include // Create (instantiate) GUI slider data structure struct FM4_slider_struct FM4_GUI; // IIR notch filter related variables float32_t fs = 48000; float32_t r = 0.9; float32_t f0 = 12000.0; float32_t ba_coeff1[5]; // single SOS section in place of IIR SOS header include float32_t x, y, IIRstate1[2]; struct IIR_struct_float32 IIR1; arm_biquad_cascade_df2t_instance_f32 IIR2; In main initialize the GUI slider accordingly and the one only section biquad as init_slider_interface(&fm4_gui,460800, 1.0, 1.0, 0.0, 0.0, 12000.0, 0.9);... //Initialize IIR notch to the f0 and r values ba_coeff1[0] = 1.0; ba_coeff1[1] = -2.0*cosf(2*PI*f0/fs); // or use FM4_GUI.P_vals[4] for f0 ba_coeff1[2] = 1.0; ba_coeff1[3] = -r*ba_coeff1[1]; // or use FM4_GUI.P_vals[5] for r ba_coeff1[4] = -r*r; // or use FM4_GUI.P_vals[5] for r I recommend updating the filter coefficients only when the parameter slider of interest changes. That means putting an if() code block inside the main while()loop where fol- ECE 5655/4655 Page 2 Assignment #5

lowing update_slider_parameters(),... while(1) { // Update slider parameters update_slider_parameters(&fm4_gui); // Reload notch parameters if P_idx is 4 or 5 (meaning f0 or r has changed) if((fm4_gui.p_idx == 4) (FM4_GUI.P_idx == 5)) { ba_coeff1[1] = -2.0*cosf(2*PI*FM4_GUI.P_vals[4]/fs); ba_coeff1[3] = -P_vals[5]*ba_coeff1[1]; ba_coeff1[4] = -P_vals[5]*P_vals[5]; } } The expected results using the Analog Discovery network analyzer, take the form From GUI parameter sli Notch BW = 48 khz 3. Multi-band Cascade of Peaking Filters Using a Single Biquad per Stage and an LUT for 1 db Gain Step Coefficients (first introduced in notes Chapter 7 starting at page 7 53): IIR filtering can be used to gain equalize selected frequency bands. The objective here is to implement partially, a multi-band graphic equalizer using a filter coefficient LUT. A peaking filter is used to provide gain or loss (attenuation) at a specific center frequency. The peaking filter has unity or 0 db gain frequency response magnitude at frequencies far removed from the center frequency. At the center frequency, the frequency response magnitude in db is G db. At the heart of the peaking filter is a second-order IIR filter (single biquad section) which has coefficients 1 + b 1 z 1 + H pk z C b z 2 = 2 pk ----------------------------------------- 1 + a 1 z 1 + a z 2 2 ECE 5655/4655 Page 3 Assignment #5

where 1 + k C q 4 2f pk = ----------------- k 1 + k q ------------ c = ----------------- q 1 + tan 2Q 2cos2f b c 1 k 1 = -------------------------------------- b q 1 + k q 2 = ----------------- 1 + k q 2cos2f a c 1 k 1 = -------------------------------------- a q 1 + k 2 = ------------- q 1 + k q 10 G db 20 = is the center frequency in Hz relative to sampling rate in Hz, G db is the peaking filter gain in db, and Q, typically around 3.5, is inversely proportional to the bandwidth, just as in an analog RLC tank circuit. Here we will be storing the coefficients in a LUT for gain values ranging from -20 0dB to +20dB, in steps of db and the remaining parameters fixed. We would like to make db as small as 1 db. For creating biquad coefficient sets, we multiply C pk through the numerator and establish new numerator coefficients: b 0 = C pk, b 1 = C pk b 1, and b 2 = C pk b 2. This problem is centered around creating a cascade of gain tunable peaking filters using an sos 2D array to store the coefficients. The Jupyter notebook Assignment5_sp2018.pynb contains the function below for this purpose. This function relies on the function peaking(gdb,fc,q,fs) found in the scikit-dsp-comm module sigsys.py. When the sos 2D array is converted to a C header file via and imported into an FM4 project, you can manipulate the IIR_struct_float32 data structure field ba_coeff to point to a particular set of five coefficients that make up a biquad section corresponding to G db of interest. It is left to you to figure out the coding details that tie a particular FM4_GUI.P_vals[] float to set the proper pointer value (address) into the sos array. Before getting into the specific FM4 task, first observe that the peaking filter is parameterized in terms of the peak gain, G db, the center frequency, and a parameter Q. Examples of the peaking filter frequency response can be found in Figures 1 and 2. The impact ohanging the gain at the center frequency,, can be seen in Figure 2. ECE 5655/4655 Page 4 Assignment #5

Figure 1: Individual peaking filter magnitude responses in db for = 44.1 khz, Q fixed at 2, and G db = 20, -10, 5, 10, and 20. The impact ohanging Q can be seen in Figure 2, in particular. fixed at 500 Hz, Figure 2: Individual peaking filter magnitude responses in db for = 44.1 khz, and Q = 1, 2, 4, 6, and 10. fixed at 500 Hz, Peaking filters are generally placed in cascade to form a graphic equalizer 1. With the peaking filters in cascade, and the gain setting of each filter at 0 db, the cascade frequency response is unity gain (0 db) over all frequencies from 0 to 2. In Figure 3 we see the individual response oix filters set at octave center frequencies according to the formula i = 31.25 2 i Hz i = 01 9 1. Spanias, Audio Signal Processing and Coding, Wiley, 1996, and http://en.wikipedia.org/wiki/graphic_equalizer. ECE 5655/4655 Page 5 Assignment #5

Start at 31.25 Hz in this example. } 10 band octave-spaced center frequencies Figure 3: Individual peaking filter magnitude responses in db with Q = 2, G db = 10 5 5dB, i = 12540008000Hz, and = 48 khz. This corresponds to a ten octave graphic equalizer (octave band equalizer), where the octave band frequencies are spread from 31.25 Hz to 16 khz. The idea here being a means to reasonably cover the 20 20 khz audio spectrum. Note that human hearing begins to fall ofeverely above 15 khz, so here the 16 khz peaking filter may have little value. When the three filters described above are placed in cascade, the composite response of Figure 4 is obtained. xn H pk z = 125Hz Q = 2 G db = 10 H pk z = 4kHz Q = 2 G db = 5 H pk z = 8kHz Q = 2 G db = 5 yn Peaks do not achieve set values and interact Figure 4: Peaking filter cascade magnitude response in db with Q = 2, G db = 10 5 5dB, i = 12540008000Hz, and = 48 khz. ECE 5655/4655 Page 6 Assignment #5

From Figure 4, in particular, we notice that when the peaking filters are placed in cascade, the responses do not mesh together perfectly. In fact, the gain flatness in a particular band of frequencies depends on how much gain, G db, you want to achieve at a particular center frequency, relative to the adjacent frequency bands. FM4 Implementation: On to the implementation of a cascade of at least three single biquad peaking filters, with individual gain adjustment using the FM4 GUI slider control. Your choice on the three center frequiencies, but the gain steps must be 1 db over the range [- 20,20] db. Below is a network analyzer capture from the Analog Discovery that mimics Figure 4. I will expect a network analyzer demo showing that the sliders dynamically change the peaking across the audio spectrum. Second play music through the system and demo how the music bass, mid, and treble response can be varied. In my example above I effectively have one bass control and two treble controls. Again, the center frequencies are your choice. Time the code and estimate if 10 bands can be supported for a single audio channel. If you wanted stereo how many bands can be supported. Understand that for stereo the coefficients can be shared. 4. Shelving Filters: A good project idea. Not assigned. 5. TBD ECE 5655/4655 Page 7 Assignment #5