DCSP-10: Applications

Similar documents
Digital Signal Processing Lecture Notes 22 November 2010

D. Richard Brown III Associate Professor Worcester Polytechnic Institute Electrical and Computer Engineering Department

SIGNALS AND SYSTEMS I Computer Assignment 2

D. Richard Brown III Professor Worcester Polytechnic Institute Electrical and Computer Engineering Department

EE 341 Spring 2013 Lab 4: Properties of Discrete-Time Fourier Transform (DTFT)

Image Transformation Techniques Dr. Rajeev Srivastava Dept. of Computer Engineering, ITBHU, Varanasi

Fatima Michael College of Engineering & Technology

Advanced Computer Graphics. Aliasing. Matthias Teschner. Computer Science Department University of Freiburg

Course Number 432/433 Title Algebra II (A & B) H Grade # of Days 120

ELEC Dr Reji Mathew Electrical Engineering UNSW

Compressed Sensing from Several Sets of Downsampled Fourier Values using Only FFTs

Edges, interpolation, templates. Nuno Vasconcelos ECE Department, UCSD (with thanks to David Forsyth)

Image Compression System on an FPGA

Design of Low-Delay FIR Half-Band Filters with Arbitrary Flatness and Its Application to Filter Banks

ENT 315 Medical Signal Processing CHAPTER 3 FAST FOURIER TRANSFORM. Dr. Lim Chee Chin

EEE 512 ADVANCED DIGITAL SIGNAL AND IMAGE PROCESSING

Digital Image Processing. Lecture 6

Digital Filters in Radiation Detection and Spectroscopy

Calibrating an Overhead Video Camera

ECE4703 B Term Laboratory Assignment 2 Floating Point Filters Using the TMS320C6713 DSK Project Code and Report Due at 3 pm 9-Nov-2017

Image Sampling and Quantisation

Image Sampling & Quantisation

A/D Converter. Sampling. Figure 1.1: Block Diagram of a DSP System

Mathematical Operations with Arrays and Matrices

Laboratory 1 Introduction to MATLAB for Signals and Systems

Filter Bank Design and Sub-Band Coding

Three-Dimensional Coordinate Systems

Assignment 2. Unsupervised & Probabilistic Learning. Maneesh Sahani Due: Monday Nov 5, 2018

Advanced Design System 1.5. Digital Filter Designer

Fourier Transforms and Signal Analysis

Filterbanks and transforms

1.12 Optimal Filters (Wiener Filters)

Intro to ARMA models. FISH 507 Applied Time Series Analysis. Mark Scheuerell 15 Jan 2019

Introduction to MATLAB for Engineers, Third Edition


Basis Functions. Volker Tresp Summer 2017

Digital Image Processing. Image Enhancement in the Frequency Domain

Advanced phase retrieval: maximum likelihood technique with sparse regularization of phase and amplitude

Simulation and Analysis of Interpolation Techniques for Image and Video Transcoding

MATH2070: LAB 4: Newton s method

Announcements. Image Matching! Source & Destination Images. Image Transformation 2/ 3/ 16. Compare a big image to a small image

Image Processing and Analysis

GEMINI GEneric Multimedia INdexIng

ELEC4042 Signal Processing 2 MATLAB Review (prepared by A/Prof Ambikairajah)

Compressive Sensing for Multimedia. Communications in Wireless Sensor Networks

ELEC Dr Reji Mathew Electrical Engineering UNSW

Refined Measurement of Digital Image Texture Loss Peter D. Burns Burns Digital Imaging Fairport, NY USA

CHAPTER 3 WAVELET DECOMPOSITION USING HAAR WAVELET

Computer Vision 2. SS 18 Dr. Benjamin Guthier Professur für Bildverarbeitung. Computer Vision 2 Dr. Benjamin Guthier

Lecture note on Senior Laboratory in Phyhsics. Fraunhofer diffraction and double-split experiment

Teaching Manual Math 2131

George Mason University ECE 201: Introduction to Signal Analysis Spring 2017

Structured System Theory

Flatness Definition Studies

UNIT 8 STUDY SHEET POLYNOMIAL FUNCTIONS

Digital Signal Processing Introduction to Finite-Precision Numerical Effects

1-- Pre-Lab The Pre-Lab this first week is short and straightforward. Make sure that you read through the information below prior to coming to lab.

EECS 556 Image Processing W 09. Interpolation. Interpolation techniques B splines

Purpose of the lecture MATLAB MATLAB

Redundant Data Elimination for Image Compression and Internet Transmission using MATLAB

Design of Adaptive Filters Using Least P th Norm Algorithm

Sampling, Aliasing, & Mipmaps

Wavelet Transform (WT) & JPEG-2000

Image Coding and Data Compression

Digital Signal Processing. Soma Biswas

2 Second Derivatives. As we have seen, a function f (x, y) of two variables has four different partial derivatives: f xx. f yx. f x y.

Rectangular Coordinates in Space

ECE 600, Dr. Farag, Summer 09

Image Processing. Application area chosen because it has very good parallelism and interesting output.

Today. Types of graphs. Complete Graphs. Trees. Hypercubes.

Implementing Biquad IIR filters with the ASN Filter Designer and the ARM CMSIS DSP software framework

Perfect Reconstruction FIR Filter Banks and Image Compression

PROGRAM EFFICIENCY & COMPLEXITY ANALYSIS

PC-MATLAB PRIMER. This is intended as a guided tour through PCMATLAB. Type as you go and watch what happens.

CHAPTER 3 DIFFERENT DOMAINS OF WATERMARKING. domain. In spatial domain the watermark bits directly added to the pixels of the cover

Lab-Report Digital Signal Processing. FIR-Filters. Model of a fixed and floating point convolver

Functions of Several Variables

DUAL TREE COMPLEX WAVELETS Part 1

APPM 2360 Project 2 Due Nov. 3 at 5:00 PM in D2L

MATRIX REVIEW PROBLEMS: Our matrix test will be on Friday May 23rd. Here are some problems to help you review.

Optimum Array Processing

Chapter 11 Image Processing

Let denote the number of partitions of with at most parts each less than or equal to. By comparing the definitions of and it is clear that ( ) ( )

Answers to Homework 12: Systems of Linear Equations

Lecture 12: Algorithmic Strength 2 Reduction in Filters and Transforms Saeid Nooshabadi

XI Signal-to-Noise (SNR)

Alpha-Rooting Method of Grayscale Image Enhancement in The Quaternion Frequency Domain

Binary representation and data

Lecture 3: Convex sets

3.5 Filtering with the 2D Fourier Transform Basic Low Pass and High Pass Filtering using 2D DFT Other Low Pass Filters

Statistical Image Compression using Fast Fourier Coefficients

Digital Image Processing. Prof. P. K. Biswas. Department of Electronic & Electrical Communication Engineering

Biomedical Image Analysis. Spatial Filtering

MATH 423 Linear Algebra II Lecture 17: Reduced row echelon form (continued). Determinant of a matrix.

Sung-Eui Yoon ( 윤성의 )

A Relationship between the Robust Statistics Theory and Sparse Compressive Sensed Signals Reconstruction

CHAPTER 9 INPAINTING USING SPARSE REPRESENTATION AND INVERSE DCT

EE 301 Lab 1 Introduction to MATLAB

Finite Impulse Response (FIR) Filter Design and Analysis

Lecture 2: 2D Fourier transforms and applications

Transcription:

DCSP-10: Applications Jianfeng Feng Department of Computer Science Warwick Univ., UK Jianfeng.feng@warwick.ac.uk http://www.dcs.warwick.ac.uk/~feng/dcsp.html

Applications Power spectrum estimate Image Sampling theorem

Applications Power spectrum estimate Compression Image Sampling theorem

Understanding the plot Sampling rate is F s, the largest (fastest) frequency from the data is then F s /2 Remembering that our frequency domain is in [0 2p] which matches to [0 F s ] Divide [0 F s ] into N intervals and plot abs X[k] against kf s /N which gives power against frequency Since it is symmetric, we sometime only plot out [0, F s/ /2] Here F s =1 0 Hz

Spectrogram In real life example, all signals change with time (music for example) Using sliding window to sample signals and calculate PSD -- STFT

; A Matlab Example close all clear all load handel; figure(1) plot(y); xlabel('time') T=size(y); for i=1:t(1,1) fre_x(i)=i*fs/t(1,1); end figure(2) plot(fre_x, abs(fft(y))) xlabel('hz') figure(3) spectrogram(y,128,120,[],fs); T1=floor(T(1,1)/2); omega1=1000; for i=1:t(1,1)-t1; z(i,1)=y(i,1)+.3*cos(2*pi*omega1*i/fs); end omega2=2000; for i=t-t1+1:t(1,1); z(i,1)=y(i,1)+.3*cos(2*pi*omega2*i/fs); end figure(5) plot(z); xlabel('time') figure(6) plot(fre_x,abs(fft(z))) xlabel('hz') figure(7) spectrogram(z,128,120,[],fs); for i=1:t(1,1); zn(i,1)=y(i,1)+.3*randn(1,1); end figure(8) plot(zn); xlabel('time') figure(9) plot(fre_x,abs(fft(zn))) xlabel('hz') figure(10) spectrogram(zn,128,120,[],fs); Three signals

; A Matlab Example Original signal close all clear all load handel; figure(1) plot(y); xlabel('time') T=size(y); for i=1:t(1,1) fre_x(i)=i*fs/t(1,1); end figure(2) plot(fre_x, abs(fft(y))) xlabel('hz') figure(3) spectrogram(y,128,120,[],fs); T1=floor(T(1,1)/2); omega1=1000; for i=1:t(1,1)-t1; z(i,1)=y(i,1)+.3*cos(2*pi*omega1*i/fs); end omega2=2000; for i=t-t1+1:t(1,1); z(i,1)=y(i,1)+.3*cos(2*pi*omega2*i/fs); end figure(5) plot(z); xlabel('time') figure(6) plot(fre_x,abs(fft(z))) xlabel('hz') figure(7) spectrogram(z,128,120,[],fs); for i=1:t(1,1); zn(i,1)=y(i,1)+.3*randn(1,1); end figure(8) plot(zn); xlabel('time') figure(9) plot(fre_x,abs(fft(zn))) xlabel('hz') figure(10) spectrogram(zn,128,120,[],fs); + disturbance + noise

; A Matlab Example close all clear all load handel; figure(1) plot(y); xlabel('time') T=size(y); for i=1:t(1,1) fre_x(i)=i*fs/t(1,1); end figure(2) plot(fre_x, abs(fft(y))) xlabel('hz') figure(3) spectrogram(y,128,120,[],fs); T1=floor(T(1,1)/2); omega1=1000; for i=1:t(1,1)-t1; z(i,1)=y(i,1)+.3*cos(2*pi*omega1*i/fs); end omega2=2000; for i=t-t1+1:t(1,1); z(i,1)=y(i,1)+.3*cos(2*pi*omega2*i/fs); end figure(5) plot(z); xlabel('time') figure(6) plot(fre_x,abs(fft(z))) xlabel('hz') figure(7) spectrogram(z,128,120,[],fs); for i=1:t(1,1); zn(i,1)=y(i,1)+.3*randn(1,1); end figure(8) plot(zn); xlabel('time') figure(9) plot(fre_x,abs(fft(zn))) xlabel('hz') figure(10) spectrogram(zn,128,120,[],fs); Abs(fft) vs Frequency

; A Matlab Example close all clear all load handel; figure(1) plot(y); xlabel('time') T=size(y); for i=1:t(1,1) fre_x(i)=i*fs/t(1,1); end figure(2) plot(fre_x, abs(fft(y))) xlabel('hz') figure(3) spectrogram(y,128,120,[],fs); T1=floor(T(1,1)/2); omega1=1000; for i=1:t(1,1)-t1; z(i,1)=y(i,1)+.3*cos(2*pi*omega1*i/fs); end omega2=2000; for i=t-t1+1:t(1,1); z(i,1)=y(i,1)+.3*cos(2*pi*omega2*i/fs); end figure(5) plot(z); xlabel('time') figure(6) plot(fre_x,abs(fft(z))) xlabel('hz') figure(7) spectrogram(z,128,120,[],fs); for i=1:t(1,1); zn(i,1)=y(i,1)+.3*randn(1,1); end figure(8) plot(zn); xlabel('time') figure(9) plot(fre_x,abs(fft(zn))) xlabel('hz') figure(10) spectrogram(zn,128,120,[],fs);

; A Matlab Example close all clear all load handel; figure(1) plot(y); xlabel('time') T=size(y); for i=1:t(1,1) fre_x(i)=i*fs/t(1,1); end figure(2) plot(fre_x, abs(fft(y))) xlabel('hz') figure(3) spectrogram(y,128,120,[],fs); T1=floor(T(1,1)/2); omega1=1000; for i=1:t(1,1)-t1; z(i,1)=y(i,1)+.3*cos(2*pi*omega1*i/fs); end omega2=2000; for i=t-t1+1:t(1,1); z(i,1)=y(i,1)+.3*cos(2*pi*omega2*i/fs); end figure(5) plot(z); xlabel('time') figure(6) plot(fre_x,abs(fft(z))) xlabel('hz') figure(7) spectrogram(z,128,120,[],fs); for i=1:t(1,1); zn(i,1)=y(i,1)+.3*randn(1,1); end figure(8) plot(zn); xlabel('time') figure(9) plot(fre_x,abs(fft(zn))) xlabel('hz') figure(10) spectrogram(zn,128,120,[],fs);

A Matlab Example Will come back to it in the next few weeks after we learn how to design filters

Image Processing two-dimensional signal x[n 1,n 2 ], n 1,n 2 Z indices locate a point on a grid pixel grid is usually regularly spaced values x[n 1,n 2 ] refer to the pixel s appearance

Image Processing Gray scale images: scalar pixel values color images: multidimensional pixel values in a color space (RGB for example) we can consider the single components separately:

DFT for image DFT for x N 2-1 N X[k 1,k 2 ] = å 1-1 å x[n 1, n 2 ]exp(- 2p jk 1 n 1 ) exp(- 2p jk 2 n 2 ) n 2 =0 n 1 =0 N 1 N 2 IDFT for X x[n 1, n 2 ] = 1 N 2-1 N å 1-1 å X[k 1, k 2 ]exp( 2p jk 1 n 1 ) exp( 2p jk 2 n 2 ) N 1 N 2 k2 =0 k 1 =0 N 1 N 2

Example I clear all close all figure(1) I = imread('peppers.png'); imshow(i); K=rgb2gray(I); figure(2) F = fft2(k); figure; imagesc(100*log(1+abs(fftshift(f)))); colormap(gray); title('magnitude spectrum'); figure; imagesc(angle(f)); colormap(gray) Original picture Gray scale picture

Example I

Example I FF=(100*log(1+abs(fftshift(F)))); for i=1:384 for j=1:512 ss=sqrt((i-192)*(i-192)+(j-256)*(j-256)); if(ss>100) FF(i,j)=0; end end end All low frequency information is here figure; imagesc(ff); colormap(gray); title('magnitude spectrum'); figure; imagesc(angle(ff)); colormap(gray)

Example I FF=(100*log(1+abs(fftshift(F)))); for i=1:384 for j=1:512 ss=sqrt((i-192)*(i-192)+(j-256)*(j-256)); if(ss>100) FF(i,j)=0; end end end All low frequency information is here figure; imagesc(ff); colormap(gray); title('magnitude spectrum'); figure; imagesc(angle(ff)); colormap(gray)

Example I? FF=(100*log(1+abs(fftshift(F)))); for i=1:384 for j=1:512 ss=sqrt((i-192)*(i-192)+(j-256)*(j-256)); if(ss>100) FF(i,j)=0; end end end All high frequency information is here figure; imagesc(ff); colormap(gray); title('magnitude spectrum'); figure; imagesc(angle(ff)); colormap(gray)

Example II Image processing

Example III: mind reading IDFT2

Sampling and reconstruction The question we consider here is under what conditions we can completely reconstruct the original signal x(t) from its discretely sampled signal x[n].

Sampling and reconstruction Theorem (Nyquist-Shannon sampling thm) Exact reconstruction of a continuous-time signal from its samples is possible if the signal is bandlimited and the sampling frequency is greater than twice the signal bandwidth Proof. The proof is again an application of FT, but we will not go through it here Please read around. It is based upon the sinc function.

Summary of FT At the end of the day, FT for signal x is only fft(x) it is deadly easy Hopefully and I am sure it will be useful for your future career

Summary of FT At the end of the day, FT for signal x is only fft(x) it is deadly easy Hopefully it will be useful for your future career I am proud of this

Filter A filter is a device or process that removes from a signal some unwanted component or feature. Filtering is a class of signal processing, the defining feature of filters being the complete or partial suppression of some aspect of the signal. Most often, this means removing some frequencies and not others in order to suppress interfering signals and reduce background noise.

Filter

A Filter will look like this Received signal x [n] (lifted it up for 5 units for visualization)

A Filter will look like this y ([i] = ( x[i] + +x [i-n]) / (N+1) N=9 here

A Filter will look like this y ([i] = ( x[i] + +x [i-n]) / (N+1) N=9 here

A Filter will look like this y ([i] = ( x[i] + +x [i-n]) / ( N+1) N=9 here

A Filter will look like this y ([i] = ( x[i] + +x [i-n]) / (N+1) N=9 here This filter is called moving average MA(10)

A Filter will look like this You might be able to guess what is the original signal

A Filter will look like this y ([i] = ( x[i] + +x [i-n]) / (N+1) + (y[i-1]+ y[i-n])/n This filter is called auto-regressive moving average ARMA(p,q)

A Filter will look like this y ([i] = ( x[i] + +x [i-n]) / (N+1) + (y[i-1]+ y[i-n])/n This filter is called auto-regressive moving average ARMA(p,q)

N th order filter Filter In general, we can include both the input x [n-k] and the previous outputs y [n-k] to generate y(n) = a 0 x(n)+a 1 x(n-1)+ +a N x(n-n) +b 1 y(n-1)+ +b N y(n-n)

Example In this case, when b i =0, it is an MA y(n) = [ x(n)+ x(n-n) ] / N In general it is called ARMA filter. AR for auto-regressive

DCSP-11: Filter Jianfeng Feng Department of Computer Science Warwick Univ., UK Jianfeng.feng@warwick.ac.uk http://www.dcs.warwick.ac.uk/~feng/dcsp.html

Aim To find the coefficient a s and b s for certain purposes: for example, filter out noise, stop certain band signals, allow certain band signal to pass etc.

A Trick {y(n)} = a 0 {x(n)}+a 1 {x(n-1)}+ +a N {x(n-n)} +b 1 {y(n-1)}+ +b N {y(n-n)} Multiplying z -n on both size of the equation above where z is a complex number and summing over n Y(z) = a 0 X(z)+a 1 z -1 X(z)+ +a N z -N X(z) +b 1 z -1 Y(z)+ +b N z -N Y(z) Y(z)-( b 1 z -1 Y(z) + + b N z -N Y(z)) = a 0 X(z) + a 1 z -1 X(z) + + a N z -N X(z)

A Trick [1-b 1 z -1 - - b N z -N ] Y(z) = [ a 0 + a 1 z -1 + + a N z -N ] X(z) Y(z) ={ [ a 0 +a 1 z -1 + +a N z -N ] / [1-b 1 z -1 - -b N z -N ] } X(z) = H(z) X(z) H(z) is usually called transfer function: it characterizes the input output relationship of a filter

A Trick Y(z) ={ [ a 0 +a 1 z -1 + +a N z -N ] / [1-b 1 z -1 - -b N z -N ] } X(z) = H(z) X(z) For example, when z = exp(j w ) Y( w ) = H (w) X (w) X and Y are actually the DTFT of x and y In particular, look at a specific frequency w 0, for example Y( w 0 ) = H (w 0 ) X (w 0 ) The magic of FT!!!!!

A Trick Y( w 0 ) = H (w 0 ) X (w 0 ) H (w 0 ) = 1 the signal will not be affected at all H (w 0 ) = 0, the signal is stopped your ideas for developing filter?

Nonrecursive Filters When a filter is nonrecursive, its difference equation can be written y(n) = a 0 x(n) + a 1 x(n-1) + + a N x(n-n) Such filters are also called finite impulse response filters, for the obvious reason that their IR contain only finitely many nonzero terms. Correspondingly, the TF of a nonrecursive filter can be written as N å m=0 H(z) = a m z -m

Block diagram

Block diagram a N a N-1 z a 1 a 0

Three types of representation Linear difference equation Block diagram Transfer function

Zeros Trying to figure out how an MA filter will behave, is not always so simple. Another way of looking at it is through its frequency domain behaviors. We can make a start on this by examining the zeros of its transfer function H(z), i.e. those values of z for which H(z)=0 since H(z) is a polynomial of order N with real coefficients,

Zeros Trying to figure out how an FIR filter will behave, is note always so simple. Another way of looking at it is through its frequency domain behaviors. We can make a start on this by examining the zeros of its transfer function H(z), i.e. those values of z for which H(z)=0 H(z) is a polynomial of order N with real coefficients, the complex conjugate root theorem states that if P is a polynomial in one variable with real coefficients, and a + bi is a root of P with a and b real numbers, then its complex conjugate a bi is also a root of P

Zeros We can express H(z) in terms of the roots by writing N N z H( z) ( z z ) m 1 where in general z m = z m exp ( j arg [z m ] ) is the mth root, or zero of the transfer function. m The zeros of a transfer function are usually denoted graphically in the complex z-plane by circles, as shown in the following Fig.

Zeros

Recursive Filters Of the many filter transfer function which are not MA, the most commonly use in DSP are the recursive filters, so called because their current output depends not only on the last N+1 inputs but also on the last N outputs.