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

Similar documents
C.11 Sampling and Aliasing Solution

ECE 2713 Design Project Solution

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

Waveforms and Spectra in NBFM Receiver

Laboratory Assignment 4. Fourier Sound Synthesis

Figure 1: Block diagram of Digital signal processing

Moving from continuous- to discrete-time

IIR Filter Design Chapter Intended Learning Outcomes: (i) Ability to design analog Butterworth filters

Signal Processing. Introduction

George Mason University Signals and Systems I Spring 2016

Multirate DSP, part 1: Upsampling and downsampling

ECEGR Lab #8: Introduction to Simulink

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

Sound synthesis with Pure Data

ECE 3793 Matlab Project 4

Laboratory Assignment 5 Amplitude Modulation

ELT COMMUNICATION THEORY

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

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

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

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

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

(i) Understanding of the characteristics of linear-phase finite impulse response (FIR) filters

Discrete Fourier Transform

Signal Processing. Naureen Ghani. December 9, 2017

Princeton ELE 201, Spring 2014 Laboratory No. 2 Shazam

(i) Understanding of the characteristics of linear-phase finite impulse response (FIR) filters

EECS 452 Midterm Exam Winter 2012

Laboratory Assignment 2 Signal Sampling, Manipulation, and Playback

Lab 4 Digital Scope and Spectrum Analyzer

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

Multirate Digital Signal Processing

Discrete-Time Signal Processing (DTSP) v14

Build Your Own Bose WaveRadio Bass Preamp Active Filter Design

EECS 452 Midterm Closed book part Winter 2013

EBU5375 Signals and Systems: Filtering and sampling in Matlab. Dr Jesús Requena Carrión

Introduction to Simulink

EE 422G - Signals and Systems Laboratory

Laboration Exercises in Digital Signal Processing

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

MAE143A Signals & Systems - Homework 8, Winter 2013 due by the end of class Tuesday March 5, 2013.

Electrical & Computer Engineering Technology

LABORATORY - FREQUENCY ANALYSIS OF DISCRETE-TIME SIGNALS

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

Processor Setting Fundamentals -or- What Is the Crossover Point?

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

ELEC3104: Digital Signal Processing Session 1, 2013

SP.718 Special Topics at Edgerton Center: D-Lab Health: Medical Technologies for the Developing World

EE 215 Semester Project SPECTRAL ANALYSIS USING FOURIER TRANSFORM

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

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

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

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

ADSP ADSP ADSP ADSP. Advanced Digital Signal Processing (18-792) Spring Fall Semester, Department of Electrical and Computer Engineering

SAMPLING THEORY. Representing continuous signals with discrete numbers

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

Frequency Domain Representation of Signals

Project I: Phase Tracking and Baud Timing Correction Systems

Armstrong Atlantic State University Engineering Studies MATLAB Marina Sound Processing Primer

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

Plot frequency response around the unit circle above the Z-plane.

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

Signal Analysis. Young Won Lim 2/10/18

EEL 4350 Principles of Communication Project 2 Due Tuesday, February 10 at the Beginning of Class

A102 Signals and Systems for Hearing and Speech: Final exam answers

Experiment 6: Multirate Signal Processing

Understanding Digital Signal Processing

ELEC3104: Digital Signal Processing Session 1, 2013

Log Booklet for EE2 Experiments

EE 422G - Signals and Systems Laboratory

EECS 452 Midterm Exam (solns) Fall 2012

Knowledge Integration Module 2 Fall 2016

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

Problem Set 1 (Solutions are due Mon )

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

Signal Analysis. Young Won Lim 2/9/18

EXPERIMENT 4 INTRODUCTION TO AMPLITUDE MODULATION SUBMITTED BY

Window Method. designates the window function. Commonly used window functions in FIR filters. are: 1. Rectangular Window:

Experiment 8: Sampling

AUDL Final exam page 1/7 Please answer all of the following questions.

Appendix B. Design Implementation Description For The Digital Frequency Demodulator

ECE503 Homework Assignment Number 8 Solution

Signal Processing Toolbox

Discrete Fourier Transform (DFT)

DSP First. Laboratory Exercise #7. Everyday Sinusoidal Signals

ECEn 487 Digital Signal Processing Laboratory. Lab 3 FFT-based Spectrum Analyzer

2.161 Signal Processing: Continuous and Discrete

Butterworth Active Bandpass Filter using Sallen-Key Topology

Massachusetts Institute of Technology Dept. of Electrical Engineering and Computer Science Spring Semester, Introduction to EECS 2

Brief Introduction to Signals & Systems. Phani Chavali

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

University of Bahrain

HCS / ACN 6389 Speech Perception Lab

EGR 111 Audio Processing

Lab 0: Introduction to TIMS AND MATLAB

6 Sampling. Sampling. The principles of sampling, especially the benefits of coherent sampling

9.1. Probability and Statistics

Spectrum Analysis - Elektronikpraktikum

Contents. An introduction to MATLAB for new and advanced users

Fourier transforms, SIM

Transcription:

MAEA Signals & Systems - Homework 9, Winter due by the end of class Friday March,. Question Three audio files have been placed on the class website: Waits.wav, WaitsAliased.wav, WaitsDecimated.wav. These are excerpts of Tom Waits song that we played in class. The first is, samples taken at. khz. The second and third are the same segments downsampled and decimated by a factor of 8. Read these into matlab using the command audioread: e.g. x=audioread( Waits.wav ); I have included a single channel of the stereo recording. (a) Examine the size of each vector and use the sound command to verify that you have the correct sample rates and sizes. (b) Plot each of the three signals and develop the correct time axis in seconds for each plot. (c) Compute the DFT of each signal using the fft command. Verify the sizes of the DFTs also verify the conjugate symmetry. (d) For each signal, plot the absolute value of the DFT and label the axes correctly in Hertz. (e) Using the plot function, rather than just zoom, plot the piece of the DFT of the original signal in Waits.wav which corresponds exactly to the frequencies in the other two signals. (f) Using this partial plot of the original signals DFT and the two other DFT plots, explain what you these frequency domain plots tell you about the signals and their sounds. (g) Try to construct a digital lowpass filter with cutoff frequency.9 using some of the filter design functions. [Omit the s in the argument list to get a digital filter. The.9 says the db point should be at.9 times the Nyquist frequency.] Then use the filter command to lowpass filter the aliased signal. Replot the absolute value of this signal s DFT and compare it to that of the decimated signal. Listen to the new signal and verify that aliasing has not been removed by the lowpass filtering. (h) Try to build a bandpass filter to extract the part of the sound signal between khz and khz. Listen to and describe this to see which is the part of the song which is most heavily aliased. (a) The audio signal and its sample rate can be obtained using audio read. For example [or,fs] = audioread( Waits.wav ); will return the data samples of the original audio signal, or, and its sample rate, Fs, which is.khz. To play the excerpts, use sound with the appropriate sample rate. Next, use size to examine the size of the data signals. The aliased frequency content sounds distorted. This is because this is simply the downsampled version of the original without any anti-aliasing being used. Whereas in the decimated signal,

the signal is created by decimate which applies an appropriate lowpass filter before downsampling the original signal. The frequency content is reduced by eightfold without aliasing. Below is matlab code: %----------Part (a) [or,fs] = audioread( Waits.wav );% the original [ds,fs] = audioread( WaitsAliased.wav );% the downsampled dc = audioread( WaitsDecimated.wav );% the decimated [nor, ] = size(or); %determine the size [nds, ] = size(ds); [ndc, ] = size(dc); sound(or,fs) % play back with appropriate sample rate sound(ds,fs) sound(dc,fs) (b) Time axis can be constructed from the data size and the sample rate. Figure,, are the plots of the signals with the correct time axis.. Plot of the original signal.. Signal (units) -. -. -. -.8..... Time (s) Figure : Plot of the original signal matlab code: %----------Part (b) ts = /Fs:/Fs:nor/Fs; % time axis of the original ts = /Fs:/Fs:nds/Fs; % time axis of the other versions figure() plot(ts,or)

. Plot of the downsampled signal.. Signal (units) -. -. -. -.8..... Time (s) Figure : Plot of the aliased signal title( Plot of the original signal ); xlabel( Time (s) );ylabel( Signal (units) ); figure() plot(ts,ds) title( Plot of the downsampled signal ); xlabel( Time (s) );ylabel( Signal (units) ); figure() plot(ts,dc) title( Plot of the decimated signal ); xlabel( Time (s) );ylabel( Signal (units) ); (c) After using fft on the signals, the conjugate symmetry happens about the midpoint of the output of fft. This can be verify by inspecting some elements of the DFT of the data around the midpoint using the code below: %----------Part (c) f_or = fft(or);f_ds = fft(ds);f_dc = fft(dc); [L_or, ] = size(f_or); %size of, symmetric around sample # x = f_or(9999:); %examine a small segment of f_or around # [L_ds, ] = size(f_ds); %size of, symmetric around sample # y = f_ds(9:); %examine a small segment of f_or around # where x =. -.i

. Plot of the decimated signal.. Signal (units) -. -. -. -.8..... Time (s). -.8i.8 -.8i. +.i. +.i. +.i. +.i. -.i. -.i. -.i.8 +.8i. +.8i. +.i Figure : Plot of the decimated signal which verifies the conjugate symmetry. Note that the midpoint is a real-valued number, which is the complex conjugate of itself. (d) Figures,, are the single-sided spectra of the signals with x-axes in Hertz using below code: %----------Part (d): requires single-sided DFT and x-axis being Hertz. % Use next power of from length of the signal for fft to be efficient N = ˆnextpow(L_or); % next power of from the length of the original N = ˆnextpow(L_ds); % next power of from the length of the others or_fft = fft(or,n)/l_or; %produce N-point DFT of the original f = Fs/*linspace(,,N/+);%frequency axis of the original ds_fft = fft(ds,n)/l_ds; %produce N-point DFT of the downsampled f = Fs/*linspace(,,N/+); dc_fft = fft(dc,n)/l_ds; %produce N-point DFT of the decimated

# - Single-sided magnitude spectrum of the orginal signal... # Figure : Single-sided spectrum of the original signal %since N>L, signals will be padded with zeros to length N before fft figure() stem(f,*abs(or_fft(:n/+))) title( Single-sided magnitude spectrum of the orginal signal ); figure() stem(f,*abs(ds_fft(:n/+))) title( Single-sided magnitude spectrum of the downsampled signal ); figure() stem(f,*abs(dc_fft(:n/+))) title( Single-sided magnitude spectrum of the decimated signal ); (e) The frequency content of the decimated and aliased signals is from Hz to.hz (half of their sampling frequency). The portion of the DFT of the original from Hz to.hz is plotted in Figure using the below code: %-----------Part(e) %Freq content in the other signals is [,Fs/]Hz, ie [,Fs/]Hz %The portion of the original corresponding to the above range %is from [,Fs/]Hz in the single-sided DFT in Fig above %Then the plot should have range from point to end/8 %of the original DFT plot, because in Fig the freq range is [,Fs/]H figure()

# - Single-sided magnitude spectrum of the downsampled signal Figure : Single-sided spectrum of the aliased signal f = f(:end/8);% freq range stem(f,*abs(or_fft(:(n/+)/8))) title( Spectrum of the original: freq range similar to the other signals (f) Look at Figure,, to compare the sounds of the signals. In the DFT plot of the decimated signal, the effect of the lowpass filter before the downsampling stage in decimate is clearly shown by the reduced magnitude in the high frequency content, when compared to the DFT plot of the original signal. In the high frequency range (around Hz onward) of the aliased signal, the DFT magnitude is actually bigger than that of the original signal. This is an indication of aliasing as a result of downsampling the signal without using an anti-aliasing filter in the case of the aliased sound sample. Here the higher frequencies (beyond half of the sample rate) are masquerading as lower frequencies, and their magnitude adds to that of the lower frequencies. As mentioned above, the decimated signal has been lowpass filtered before being downsampled, which eliminates aliasing in the high frequency content. (g) Figure 8 is the DFT of the aliased signal after it has been filtered by a Butterworth lowpass filter. As seen in this figure, the high frequency content of this filtered signal has been suppressed. But by listening to the signal, aliasing is still present in the form of high frequency distortion. Once aliasing has been introduced, it cannot be removed. matlab code is below: %-----------Part(g) [num,den] = butter(,.9);% cutoff (-db) at.9fs/ Hz ds_filtered = filter(num,den,ds); ds_filtered_fft = fft(ds_filtered,n)/l_ds;

# - Single-sided magnitude spectrum of the decimated signal Figure : Single-sided spectrum of the decimated signal figure(8) stem(f,*abs(ds_filtered_fft(:n/+))) title( Single-sided spectrum of the filtered downsampled signal ); (h) The frequency content of the original signal above around.khz is aliased in the aliased signal as expected earlier due to the much slower sample rate. This can be verified sonically by listening to the frequency range of the original from khz to khz using a Butterworth bandpass filter, and compare it to the aliased signal. matlab code below: %-----------Part(h) [num,den] = butter(,[ ]/(Fs/)); %bandpass filter khz & kh or_bp = filter(num,den,or); %plot DFT to see if filter really works or_bp_fft = fft(or_bp,n)/l_or; figure(9) stem(f,*abs(or_bp_fft(:n/+))) title( Single-sided spectrum of the bandpass filtered original );

# - Spectrum of the original: freq range similar to the other signals Figure : Part of spectrum of the original corresponding to the frequency content of the other two signals. # - Single-sided spectrum of the filtered downsampled signal Figure 8: Spectrum of the aliased signal after having been lowpass filtered.