ME 565 HW 4 Solutions Winter Make image black and white. Compute the FFT of our image using fft2. clear all; close all; clc %%Exercise 4.

Similar documents
Audio Processing Exercise

Signal Processing with Wavelets.

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

Course Web site:

Hands-on session on timing analysis

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

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

Design of a Speaker Recognition Code using MATLAB

UNIVERSITY OF BAHRAIN COLLEGE OF ENGINEERING DEPARTMENT OF ELECTRICAL AND ELECTRONIC ENGINEERING

Getting Started with the LabVIEW Sound and Vibration Toolkit

4.4 The FFT and MATLAB

COGS 119/219 MATLAB for Experimental Research. Fall 2017 Image Processing in Matlab

hit), and assume that longer incidental sounds (forest noise, water, wind noise) resemble a Gaussian noise distribution.

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

Artifact rejection and running ICA

Using Multiple DMs for Increased Spatial Frequency Response

Digital Image and Fourier Transform

Communication Theory and Engineering

A NEW LOOK AT FREQUENCY RESOLUTION IN POWER SPECTRAL DENSITY ESTIMATION. Sudeshna Pal, Soosan Beheshti

The Effect of Time-Domain Interpolation on Response Spectral Calculations. David M. Boore

From Fourier Series to Analysis of Non-stationary Signals - X

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

Signal Stability Analyser

Design of Speech Signal Analysis and Processing System. Based on Matlab Gateway

A Matlab toolbox for. Characterisation Of Recorded Underwater Sound (CHORUS) USER S GUIDE

Table of Contents. function OneD_signal_Filter_Ex

Lab 5 Linear Predictive Coding

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

E E Introduction to Wavelets & Filter Banks Spring Semester 2009

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

Agilent PN Time-Capture Capabilities of the Agilent Series Vector Signal Analyzers Product Note

SOUND LABORATORY LING123: SOUND AND COMMUNICATION

Elasticity Imaging with Ultrasound JEE 4980 Final Report. George Michaels and Mary Watts

EXPLORING THE USE OF ENF FOR MULTIMEDIA SYNCHRONIZATION

Figure 1: Feature Vector Sequence Generator block diagram.

Classification of Musical Instruments sounds by Using MFCC and Timbral Audio Descriptors

python_speech_features Documentation

DATA COMPRESSION USING THE FFT

CS229 Project Report Polyphonic Piano Transcription

Outline ip24 ipad app user guide. App release 2.1

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

21.1. Unit 21. Hardware Acceleration

Musical Hit Detection

Handout 1 - Introduction to plots in Matlab 7

Joseph Wakooli. Designing an Analysis Tool for Digital Signal Processing

Virtual Vibration Analyzer

DIGITAL COMMUNICATION

Calibrate, Characterize and Emulate Systems Using RFXpress in AWG Series

Application Of Missing Feature Theory To The Recognition Of Musical Instruments In Polyphonic Audio

An Effective Filtering Algorithm to Mitigate Transient Decaying DC Offset

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

Extracting vital signs with smartphone. camera

AUDIO/VISUAL INDEPENDENT COMPONENTS

ECE 4220 Real Time Embedded Systems Final Project Spectrum Analyzer

Time series analysis

International Journal of Scientific & Engineering Research, Volume 5, Issue 4, April ISSN

Lecture 18: Exam Review

AUTO-FOCUS USING PSD ESTIMATION EFFECTIVE BANDWIDTH By Laurence G. Hassebrook

ADDING (INJECTING) NOISE TO IMPROVE RESULTS.

Automatic music transcription

EE 350. Continuous-Time Linear Systems. Recitation 2. 1

Supplemental Material for Gamma-band Synchronization in the Macaque Hippocampus and Memory Formation

10:15-11 am Digital signal processing

Using tapers at the beginning and end of the time series to which pads will be added before filtering

Experiments on musical instrument separation using multiplecause

Computational Models of Music Similarity. Elias Pampalk National Institute for Advanced Industrial Science and Technology (AIST)

Introduction To LabVIEW and the DSP Board

Page I-ix / Lab Notebooks, Lab Reports, Graphs, Parts Per Thousand Information on Lab Notebooks, Lab Reports and Graphs

Lab P-6: Synthesis of Sinusoidal Signals A Music Illusion. A k cos.! k t C k / (1)

Pre-processing pipeline

Research on sampling of vibration signals based on compressed sensing

Spectrum Analyser Basics

Music Database Retrieval Based on Spectral Similarity

The XYZ Colour Space. 26 January 2011 WHITE PAPER. IMAGE PROCESSING TECHNIQUES

EECS 556 Winter 2007 Exam2 Solutions

CZT vs FFT: Flexibility vs Speed. Abstract

GCT535- Sound Technology for Multimedia Timbre Analysis. Graduate School of Culture Technology KAIST Juhan Nam

Comparison Parameters and Speaker Similarity Coincidence Criteria:

StaMPS Persistent Scatterer Practical

EDDY CURRENT IMAGE PROCESSING FOR CRACK SIZE CHARACTERIZATION

PhysioPilot C2 Plus Fourth-Generation Software APPLICATIONS Contents EMG FEEDBACK...2 APPENDIX ARCHIVING SESSION DATA... 23

Quad-to-quad correlated motion in FLASH

StaMPS Persistent Scatterer Exercise

ISSN ICIRET-2014

Single Channel Speech Enhancement Using Spectral Subtraction Based on Minimum Statistics

Calibrating attenuators using the 9640A RF Reference

Set Point Controller OC557. Operator s Manual

Unit 07 PC Form A. 1. Use pencil and paper to answer the question. Plot and label each point on the coordinate grid.

Book: Fundamentals of Music Processing. Audio Features. Book: Fundamentals of Music Processing. Book: Fundamentals of Music Processing

Supplemental Information. Dynamic Theta Networks in the Human Medial. Temporal Lobe Support Episodic Memory

Musical Instrument Identification Using Principal Component Analysis and Multi-Layered Perceptrons

Optimization of Multi-Channel BCH Error Decoding for Common Cases. Russell Dill Master's Thesis Defense April 20, 2015

Problem Weight Score Total 100

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

NanoTrack Cell and Particle Tracking Primer

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

Lecture 10 Harmonic/Percussive Separation

Experiment 13 Sampling and reconstruction

Analysis. mapans MAP ANalysis Single; map viewer, opens and modifies a map file saved by iman.

Violin Timbre Space Features

Transcription:

ME 565 HW 4 Solutions Winter 2017 clear all; close all; clc %%Exercise 4.1 %read in the image A= imread('recorder','jpg'); Make image black and white Abw2=rgb2gray(A); [nx,ny]=size(abw2); Compute the FFT of our image using fft2 disp('doing FFT analysis for sparsity check...') Doing FFT analysis for sparsity check... At=fft2(Abw2); F = log(abs(fftshift(at))+1); %scaling for plot F = mat2gray(f); % Use mat2gray to scale the image between 0 and 1 % figure(3) % imshow(f,[]); % Display the fft coefficients % taking the fft At=fft2(Abw2); %%%what we want is to keep exactly a certain percentage of the coefficients

count_pic=2; trials=[10, 1]; count=nx*ny; %the total number of pixels figure(2), subplot(1,3,1), imshow(abw2) title('original image','fontsize',12) figure (3), subplot(1,3,1),surf(double(abw2)); title('original image','fontsize',12) for ii=1:length(trials) percentage=trials(ii); indceil= ceil(0.01*percentage*count); %the number of coefficients for the final image %order the coefficients from largest to smallest and keep the top x %zero out the indices that are not in this top x% %reshape At; reshaping does not change the intrinsic order of the elements %if we use linear indexes At_rshp=reshape(At,count,1); %sort descending [At_rshp_srt, topindices]= sort(abs(at_rshp),'descend'); %the indices of top x% of the Fourier Coefficients idx_lookup= topindices(1:indceil); % check(ii)=length(idx_lookup); %I make a matrix At_reduced the size of my original At and then subsitute in the %elements that correspond to the top x% of the Fourier Coefficients At_reduced=zeros(size(At)); At_reduced(idx_lookup)=At(idx_lookup); Alow=uint8(ifft2(At_reduced)); %L2 norm comparison disp('l2 norms...') image_error=abw2-alow; L2_norm_error=norm(double(image_error),2) L2_norm_fft_orig=norm(At,2) L2_norm_fft_comp=norm( At_reduced,2) norm_low=norm(double(alow),2) %computing the L2 norm of the new image figure(2), subplot(1,3,count_pic), imshow(alow); drawnow title([num2str(percentage) '% of FFT basis'],'fontsize',12) figure(3), subplot(1,3,count_pic), surf(double(alow)); drawnow title([num2str(percentage) '% of FFT basis'],'fontsize',12) count_pic=count_pic+1; end clear idx_lookup L2 norms... L2_norm_error = 401.7412 L2_norm_fft_orig = 1.4359e+08 L2_norm_fft_comp = 1.4359e+08 norm_low = 1.0714e+05

L2 norms... L2_norm_error = 3.0244e+03 L2_norm_fft_orig = 1.4359e+08 L2_norm_fft_comp = 1.4358e+08 norm_low = 1.0709e+05

The L2 norm of the error between the original image and the 10% case is smaller than for the 1% case. The L2 norm of the fourier coefficients for the 10% case is also closer to the L2 norm of the fourier coefficients of the original image indicated that it is a closer match to the original. This matches our assessment if we view the 10% and 1% images and compare these to the orignal image.

Exercise 4-2 clear all; close all; clc vars={'rush','fs'}; load ('r2112.mat',vars{:}) disp('play the original signal...') Play the original signal... sound(rush, FS); pause clc %Compute FFT of signal N=length(rush); FFT=fft(rush, N); %Compute PSD of signal and plot it along with the spectrogram figure PSD_clean=FFT.*conj(FFT)/N; freq=(fs/n)*(1:n); L=1:floor(N/2); subplot(211) plot(freq(l), 10*log10(PSD_clean(L))) xlabel('frequency (Hz)') title('power Spectral Density -original Signal')

subplot(212) spectrogram (rush, 1000, 500, 1000, FS, 'yaxis') title ('Spectrogram of original signal') %Prefiltered signal analysis vars_noisy = {'rushnoisy'}; load ('r2112noisy.mat',vars_noisy{:}); %Listen to the noisy sample disp ('Play corrrupted signal...') Play corrrupted signal... sound(rushnoisy, FS); pause clc n=length(rushnoisy); FFT_noisy=fft(rushnoisy,n); %Plot PSD and spectrogram of noisy signal figure PSD_noisy=FFT_noisy.*conj(FFT_noisy)/n; freq_n=fs/n*(1:n); subplot(221)

plot(freq_n(l), 10*log10(PSD_noisy(L))) xlabel('frequency (Hz)') title('psd-noisy Signal') subplot(222) spectrogram (rushnoisy, 1000, 500, 1000, FS, 'yaxis') title ('Spectrogram of noisy signal') %Filtering and reconstuction of signal FFT_filtered=FFT_noisy; FFT_filtered(n/4:n)=0; %removing last 3/4 of Fourier components clean_signal =2*real(ifft(FFT_filtered)); disp('playing filtered signal...') Playing filtered signal... sound(clean_signal, FS) pause clc disp('compare to original...') Compare to original... sound(rush, FS) pause clc n_cleansig=length(clean_signal); FFT_cleansig=fft(clean_signal, n_cleansig); PSD_cleansig=FFT_cleansig.*conj(FFT_cleansig)/n_cleansig; freq_clean=fs/(n_cleansig)*(1:n_cleansig); subplot(223) plot(freq_clean(l),10*log10(psd_cleansig(l))) xlabel('frequency (Hz)') title('psd-filtered signal') subplot(224) spectrogram (clean_signal, 1000, 500, 1000, FS, 'yaxis') title ('Spectrogram of cleaned signal')

The above shows that we have successfully removed the high frequency contamination (as well as the high frequency components above 10000 Hz in the original signal)