C.11 Sampling and Aliasing Solution

Similar documents
MAE143A Signals & Systems - Homework 9, Winter 2015 due by the end of class Friday March 13, 2015.

ECE 2713 Design Project Solution

Discrete-Time Signal Processing (DTSP) v14

Sound synthesis with Pure Data

PROBLEM SET 6. Note: This version is preliminary in that it does not yet have instructions for uploading the MATLAB problems.

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

!"!#"#$% Lecture 2: Media Creation. Some materials taken from Prof. Yao Wang s slides RECAP

BIOE 198MI Biomedical Data Analysis. Spring Semester Lab6: Signal processing and filter design

Laboratory Assignment 5 Amplitude Modulation

Distortion Analysis T S. 2 N for all k not defined above. THEOREM?: If N P is an integer and x(t) is band limited to f MAX, then

Lab 4: Using the CODEC

Multirate Digital Signal Processing

ELT COMMUNICATION THEORY

Laboratory Assignment 2 Signal Sampling, Manipulation, and Playback

Multirate Signal Processing Lecture 7, Sampling Gerald Schuller, TU Ilmenau

EGR 111 Audio Processing

Outline. Discrete time signals. Impulse sampling z-transform Frequency response Stability INF4420. Jørgen Andreas Michaelsen Spring / 37 2 / 37

L A B 3 : G E N E R A T I N G S I N U S O I D S

ECEGR Lab #8: Introduction to Simulink

Laboratory Assignment 4. Fourier Sound Synthesis

Lecture 10, ANIK. Data converters 2

EECE 323 Fundamentals of Digital Signal Processing. Spring Section A. Practical Homework MATLAB Application on Aliasing and Antialiasing

Observation of the Effects of the Fourier Transformation on Periodic Signals ECE 521. Project 2

Department of Electrical Engineering. Laboratory Manual Digital Signal Processing

Experiment 8: Sampling

ECE 203 LAB 2 PRACTICAL FILTER DESIGN & IMPLEMENTATION

Log Booklet for EE2 Experiments

ECE 3793 Matlab Project 4

Concordia University. Discrete-Time Signal Processing. Lab Manual (ELEC442) Dr. Wei-Ping Zhu

Project 0: Part 2 A second hands-on lab on Speech Processing Frequency-domain processing

Synthesis: From Frequency to Time-Domain

Signal Analysis. Young Won Lim 2/9/18

Princeton ELE 201, Spring 2014 Laboratory No. 2 Shazam

Data Analysis in MATLAB Lab 1: The speed limit of the nervous system (comparative conduction velocity)

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

Filter Banks I. Prof. Dr. Gerald Schuller. Fraunhofer IDMT & Ilmenau University of Technology Ilmenau, Germany. Fraunhofer IDMT

Signal Analysis. Young Won Lim 2/10/18

Sampling of Continuous-Time Signals. Reference chapter 4 in Oppenheim and Schafer.

George Mason University Signals and Systems I Spring 2016

Multirate DSP, part 1: Upsampling and downsampling

Experiment 8 Frequency Response

Build Your Own Bose WaveRadio Bass Preamp Active Filter Design

Spectrum. Additive Synthesis. Additive Synthesis Caveat. Music 270a: Modulation

Signal Processing. Naureen Ghani. December 9, 2017

Music 270a: Modulation

Laboratory Assignment 1 Sampling Phenomena

Laboration Exercises in Digital Signal Processing

Experiment 2 Effects of Filtering

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

Limitations of Sum-of-Sinusoid Signals

Fourier Signal Analysis

Brief Introduction to Signals & Systems. Phani Chavali

Laboratory 7: Active Filters

ECEN 325 Lab 5: Operational Amplifiers Part III

THE HONG KONG POLYTECHNIC UNIVERSITY Department of Electronic and Information Engineering. EIE2106 Signal and System Analysis Lab 2 Fourier series

ENGR 210 Lab 12: Sampling and Aliasing

Real Analog - Circuits 1 Chapter 11: Lab Projects

Laboratory 6. Lab 6. Operational Amplifier Circuits. Required Components: op amp 2 1k resistor 4 10k resistors 1 100k resistor 1 0.

Lecture Schedule: Week Date Lecture Title

Final Exam Solutions June 7, 2004

Digital Signal Processing for Audio Applications

Sampling and Signal Processing

Experiment 9 AC Circuits

Lecture 3 Review of Signals and Systems: Part 2. EE4900/EE6720 Digital Communications

EE 422G - Signals and Systems Laboratory

Knowledge Integration Module 2 Fall 2016

Set-up. Equipment required: Your issued Laptop MATLAB ( if you don t already have it on your laptop)

Islamic University of Gaza. Faculty of Engineering Electrical Engineering Department Spring-2011

ECE503 Homework Assignment Number 8 Solution

The Formula for Sinusoidal Signals

EE 210 Lab Exercise #4 D/A & A/D Converters

Moving from continuous- to discrete-time

Chapter 1: Introduction to audio signal processing

Spectrum Analysis - Elektronikpraktikum

Signal Processing Toolbox

ELEC MatLab Introductory Lab. Performed: Monday January 20 th Submitted: Monday January 27 th 2014

Mitch Gollub Jay Nadkarni Digant Patel Sheldon Wong 5/6/14 Capstone Design Project: Final Report Multirate Filter Design

Sampling and Reconstruction of Analog Signals

Reference Sources. Prelab. Proakis chapter 7.4.1, equations to as attached

Lab 4 Digital Scope and Spectrum Analyzer

Figure 1: Block diagram of Digital signal processing

PART I: The questions in Part I refer to the aliasing portion of the procedure as outlined in the lab manual.

Filters. Signals are sequences of numbers. Simple algebraic operations on signals can perform useful functions: shifting multiplication addition

Lab S-8: Spectrograms: Harmonic Lines & Chirp Aliasing

CMPT 468: Frequency Modulation (FM) Synthesis

Topic 2. Signal Processing Review. (Some slides are adapted from Bryan Pardo s course slides on Machine Perception of Music)

SIGNALS AND SYSTEMS LABORATORY 13: Digital Communication

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

Lecture 7 Frequency Modulation

Butterworth Active Bandpass Filter using Sallen-Key Topology

1. Consider the following system to process continuous-time signals with discrete-time processing. Convert to Impulses: Rate.

Chapter 2: Digitization of Sound

EE422G Solution to Homework #8

SAMPLING AND RECONSTRUCTING SIGNALS

Electrical & Computer Engineering Technology

Discrete Fourier Transform (DFT)

Convention Paper Presented at the 112th Convention 2002 May Munich, Germany

EECS 452 Midterm Exam Winter 2012

Signal Processing. Introduction

OKAN UNIVERSITY FACULTY OF ENGINEERING AND ARCHITECTURE. EEE 403 Digital Signal Processing 10 Periodic Sampling

Transcription:

158 APPENDIX C. LABORATORY EXERCISES SOLUTIONS C.11 Sampling and Aliasing Solution C.11.1 In-lab section 1. To get a frequency sweep from to 12 khz in seconds we need to choose f so that 2ft = when t =. Thus, f = 6. The following Matlab code generates the chirp and plays it as a sound t = [:1/8:]; y = sin(2*pi*6*(t.*t)); soundsc(y); The perceived pitch rises from to 4 khz, then falls back to, then rises again to 4 khz. The reason for this is that the sampled signal has frequency components whose frequencies are ambiguous, modulo f s = 8. The audio hardware in the computer is choosing to render only frequencies in the range,4 khz to 4 khz. 2. To get a frequency sweep from to 25 Hz in 8192/8 seconds we need to choose f so that 2ft = 25 when t = 8192=8. Thus, 25 8 f = = 1221: 2 8192 The following Matlab code generates this chirp and plays the sound: D = 8192/8; t = [:1/8:8191/8]; f = 1221; y = (1-abs(t-D/2)/(D/2)).*sin(2*pi*f*(t.*t)); soundsc(y); There are no aliasing artifacts because the frequency remains below the Nyquist frequency. 3. The following Matlab code gives a correctly labeled plot of the DFT of the signal y calculated in the previous part: p = length(y); fs = 8; Y = fft(y); Ysymmetric = [Y(497:8192), Y(1:496)]; symmetricfreqs = [-fs/2:fs/p:(fs/2)-(fs/p)]; plot(symmetricfreqs, abs(ysymmetric)); xlabel( ); ylabel( ); The plot is shown in figure C.33. The plot is sensible, in that it shows the triangular shape that determines the relative amounts of each of the frequencies swept.

C.11. SAMPLING AND ALIASING SOLUTION 159 9 8 7 6 5 4 4 4 Figure C.33: Magnitude of the DFT of the chirp with a triangular envelope.

16 APPENDIX C. LABORATORY EXERCISES SOLUTIONS 4. To get a frequency sweep from to 5 Hz in 8192/8 seconds we need to choose f so that 2ft = 5 when t = 8192=8. Thus, f = 5 8 2 8192 = 2441: The following Matlab code generates this chirp and plays the sound: D = 8192/8; t = [:1/8:8191/8]; f = 2441; y = (1-abs(t-D/2)/(D/2)).*sin(2*pi*f*(t.*t)); soundsc(y); There is now an aliasing artifact towards the end of the chip where the frequency drops rather than rises. The same code as in the previous part can be used to plot the DFT, resulting in the plot shown in figure C.34. Notice that between 3 and 4 khz there is aliasing distortion. This DFT is the result of overlapping and adding two DFTs that are shifted by 8 khz in frequency. Since the sweep extends beyond the Nyquist frequency, there is non-zero overlap, resulting in the distortion shown. 5. We recreate the chirp from part 2, which sweeps from to 25 Hz, as follows: D = 8192/8; t = [:1/8:8191/8]; f = 1221; y = (1-abs(t-D/2)/(D/2)).*sin(2*pi*f*(t.*t)); To create the downsampled signal, one (clever) method is w = y([1:496]*2); The following Matlab code gives a correctly labeled plot of the DFT: p = length(w); fs = 4; W = fft(w); Wsymmetric = [W(49:496), W(1:48)]; symmetricfreqs = [-fs/2:fs/p:(fs/2)-(fs/p)]; plot(symmetricfreqs, abs(wsymmetric)); xlabel( ); ylabel( ); The plot is shown in figure C.35. It shows aliasing distortion because the new sample rate results in a Nyquist frequency that is below the highest frequency terms in the signal.

C.11. SAMPLING AND ALIASING SOLUTION 161 6 5 4 4 4 Figure C.34: Magnitude of the DFT of a chirp with a triangular envelope that sweeps beyond the Nyquist frequency.

162 APPENDIX C. LABORATORY EXERCISES SOLUTIONS 45 4 35 25 15 5 15 5 5 15 Figure C.35: Magnitude of the DFT of the downsampled chirp.

C.11. SAMPLING AND ALIASING SOLUTION 163 9 8 7 6 5 4 8 6 4 4 6 8 Figure C.36: Magnitude DFT of an upsampled chirp with zero samples inserted. 6. Assuming the same signal y constructed in the previous part, we can construct z as follows: for(k=1:length(y)) z(2*k-1) = y(k); z(2*k) = ; end The following Matlab code gives a correctly labeled plot of the DFT: p = length(z); fs = 16; Z = fft(z); Zsymmetric = [Z(8193:16384), Z(1:8192)]; symmetricfreqs = [-fs/2:fs/p:(fs/2)-(fs/p)]; plot(symmetricfreqs, abs(zsymmetric)); xlabel( ); ylabel( ); The plot is shown in figure C.36. 7. To get back the original chirp, we could lowpass filter the signal with the following Butterworth filter:

164 APPENDIX C. LABORATORY EXERCISES SOLUTIONS [B, A] = butter(, 1/3); u = filter(b, A, z); The result sounds just like the original chirp. You can plot its magnitude DFT as above, and it will look perfect. If you use a lower order filter, such as 4 instead of, then there will be small residuals in the frequency range 55 to 8 Hz.