Finding best wavelet basis for epileptic stage differentiation ● The goal is to find a pair of filters which can reliably detect pre-preictal (i.e. Several.

Slides:



Advertisements
Similar presentations
DFT & FFT Computation.
Advertisements

Multimedia Data Compression
On an Improved Chaos Shift Keying Communication Scheme Timothy J. Wren & Tai C. Yang.
DCSP-12 Jianfeng Feng
Lecture 7: Basis Functions & Fourier Series
Fast Algorithms For Hierarchical Range Histogram Constructions
University of Ioannina - Department of Computer Science Wavelets and Multiresolution Processing (Background) Christophoros Nikou Digital.
Applications in Signal and Image Processing
Introduction and Overview Dr Mohamed A. El-Gebeily Department of Mathematical Sciences KFUPM
DFT/FFT and Wavelets ● Additive Synthesis demonstration (wave addition) ● Standard Definitions ● Computing the DFT and FFT ● Sine and cosine wave multiplication.
Digital Signal Processing
Extensions of wavelets
Lecture05 Transform Coding.
Time-Frequency and Time-Scale Analysis of Doppler Ultrasound Signals
Chapter 7 Wavelets and Multi-resolution Processing.
Spatial and Temporal Data Mining
Lecture 19 The Wavelet Transform. Some signals obviously have spectral characteristics that vary with time Motivation.
Wavelet Transform. What Are Wavelets? In general, a family of representations using: hierarchical (nested) basis functions finite (“compact”) support.
Basic Concepts and Definitions Vector and Function Space. A finite or an infinite dimensional linear vector/function space described with set of non-unique.
Multi-Resolution Analysis (MRA)
Introduction to Wavelets
1 Computer Science 631 Lecture 4: Wavelets Ramin Zabih Computer Science Department CORNELL UNIVERSITY.
Introduction to Wavelets -part 2
ECE 501 Introduction to BME ECE 501 Dr. Hang. Part V Biomedical Signal Processing Introduction to Wavelet Transform ECE 501 Dr. Hang.
Chapter 12 Fast Fourier Transform. 1.Metropolis algorithm for Monte Carlo 2.Simplex method for linear programming 3.Krylov subspace iteration (CG) 4.Decomposition.
Face Recognition Using Neural Networks Presented By: Hadis Mohseni Leila Taghavi Atefeh Mirsafian.
ENG4BF3 Medical Image Processing
Function approximation: Fourier, Chebyshev, Lagrange
DTFT And Fourier Transform
1 Chapter 8 The Discrete Fourier Transform 2 Introduction  In Chapters 2 and 3 we discussed the representation of sequences and LTI systems in terms.
Part 2. Pre-process seizers data – looking for test filter. Run over array of pre-preictal and preictal given signals, and creating two mean stat’ trees.
Lecture 1 Signals in the Time and Frequency Domains
Orthogonal Functions Numerical Methods in Geophysics Function Approximation The Problem we are trying to approximate a function f(x) by another function.
The Wavelet Tutorial: Part3 The Discrete Wavelet Transform
Details, details… Intro to Discrete Wavelet Transform The Story of Wavelets Theory and Engineering Applications.
CSE &CSE Multimedia Processing Lecture 8. Wavelet Transform Spring 2009.
1 Orthonormal Wavelets with Simple Closed-Form Expressions G. G. Walter and J. Zhang IEEE Trans. Signal Processing, vol. 46, No. 8, August 王隆仁.
Presented by Tienwei Tsai July, 2005
Transforms. 5*sin (2  4t) Amplitude = 5 Frequency = 4 Hz seconds A sine wave.
Implementing a Speech Recognition System on a GPU using CUDA
Basics of Neural Networks Neural Network Topologies.
Fourier TheoryModern Seismology – Data processing and inversion 1 Fourier Series and Transforms Orthogonal functions Fourier Series Discrete Fourier Series.
1 Fourier Representations of Signals & Linear Time-Invariant Systems Chapter 3.
Wavelet Packets  Shortcomings of standard orthogonal (bi-orthogonal) multi-resolution structure of DWT,  Insufficient flexibility for the analysis of.
Lecture 7: Sampling Review of 2D Fourier Theory We view f(x,y) as a linear combination of complex exponentials that represent plane waves. F(u,v) describes.
Wavelets and Multiresolution Processing (Wavelet Transforms)
The Discrete Wavelet Transform
Time frequency localization M-bank filters are used to partition a signal into different frequency channels, with which energy compact regions in the frequency.
ECE 8443 – Pattern Recognition EE 3512 – Signals: Continuous and Discrete Objectives: Eigenfunctions Fourier Series of CT Signals Trigonometric Fourier.
The Discrete Wavelet Transform for Image Compression Speaker: Jing-De Huang Advisor: Jian-Jiun Ding Graduate Institute of Communication Engineering National.
Professor A G Constantinides 1 Discrete Fourier Transforms Consider finite duration signal Its z-tranform is Evaluate at points on z-plane as We can evaluate.
Chapter 8 Lossy Compression Algorithms. Fundamentals of Multimedia, Chapter Introduction Lossless compression algorithms do not deliver compression.
Dr. Abdul Basit Siddiqui FUIEMS. QuizTime 30 min. How the coefficents of Laplacian Filter are generated. Show your complete work. Also discuss different.
By Dr. Rajeev Srivastava CSE, IIT(BHU)
Topics 1 Specific topics to be covered are: Discrete-time signals Z-transforms Sampling and reconstruction Aliasing and anti-aliasing filters Sampled-data.
ECE 8443 – Pattern Recognition ECE 3163 – Signals and Systems Objectives: Eigenfunctions Fourier Series of CT Signals Trigonometric Fourier Series Dirichlet.
Chapter 13 Discrete Image Transforms
1 Objective To provide background material in support of topics in Digital Image Processing that are based on matrices and/or vectors. Review Matrices.
 presented by- ARPIT GARG ISHU MISHRA KAJAL SINGHAL B.TECH(ECE) 3RD YEAR.
Digital Image Processing Lecture 8: Fourier Transform Prof. Charlene Tsai.
Chapter 8 Lossy Compression Algorithms
Multiresolution Analysis (Chapter 7)
CS 591 S1 – Computational Audio
DIGITAL SIGNAL PROCESSING ELECTRONICS
Multi-resolution image processing & Wavelet
Chapter 12 Fast Fourier Transform
Wavelets : Introduction and Examples
CS Digital Image Processing Lecture 9. Wavelet Transform
Multi-resolution analysis
Image Transforms for Robust Coding
Presentation transcript:

Finding best wavelet basis for epileptic stage differentiation ● The goal is to find a pair of filters which can reliably detect pre-preictal (i.e. Several hours before the onset of seizure) and preictal (i.e. Less then half an hour prior to onset of seizure( ● Such filters would be used to serve an early warning for seizure onset, by analyzing a particular EEG signal from a single electrode (more formally a single differential of two electrodes(

Signal analysis – background ● Several methods exist for detecting features in discrete signal. ● One such method is a Fourier transform, in particular the DFT (Discrete Fourier Transform), which has an efficient numeric implementation known as FFT (Fast Fourier Transform) ● Another widespread family of transforms are wavelet transforms.

Transforms temporal signal representation into frequency domain – each ”finite-power” signal can be represented as a linear combination of scalings of sine and cosine functions. Those scalings correspond to the different frequencies. Fourier transform

Fourier – example Fourier (only real part)

Fourier transform - limitations Provides no temporal localization of detected features. (i.e. If the function has a discontinuity it is possible to see it in the frequency domain, however it is impossible to deduce where is it in the time domain) Gibb's phenomena – the inability to precisely describe discontinuous functions: for instance the following are approximations for square wave: 5 approx. steps 25 approx. steps 125 approx. Steps. The maximal difference is still the same (non- uniform convergence)

Wavelet transforms A family of transforms based on the notion of a scaling function and a wavelet function, from which the basis of L 2 (R) is ultimately derived. (by scaling and shifting the wavelet function) Another way to look at the tranform is from the point of view of MRA. (Multi- resolution analysis)

Wavelets - MRA The wavelet basis can also be derived from two following recurrences: These are relations which define the scaling and the wavelet function, respectively. In fact it can be proven that these functions can be uniquely derived from {h k } and {g l }. If these sets furthermore satisfy certain conditions then the result is an orthogonal basis.

Wavelets – cont. If the {h k } and {g l } are finite, then we have wavelets with finite support. Those allow for simpler numerical computations

Wavelets vs. Fourier analysis Wavelets allow the inspection of local behaviours of a signal. (this is because each wavelet coefficient is affected only by a finite support, depending on the scale) Wavelets allow for MRA – localizing the analysis if required, or looking at more general properties of a signal as Fourier does. Wavelets allow building arbitrary level (subject to scale limitations) of ”approximation” of the signal between the most crude (expressed by only scaling-coefficients) and the most accurate (the signal itself, represented by full dyadic decomposition)

Wavelets vs. Fourier analysis Wavelets allow one to inspect only fixed set of frequencies (scales) if dyadic decomposition is used or result in excessive information (doubling the dimension!) if continuous wavelet transform is used. There are plenty of compromises between these two approaches, though. (We limit ourselves here to orthonormal wavelet bases, though there are transform variations which do not require orthonormality)

Entropy ● In information theory, entropy is a measure of the uncertainty associated with random variable. The entropy rate of a data source means the average number of bits per symbol needed to encode it ● p denotes the probability mass function of X ● I(X) is the information content

Entropy based best basis The best basis algorithm purpose is to select the most ”meaningful” basis for a signal representation. That, a set of filters such as the resulting coefficient convey real information, and not stay fixed during the whole signal duration. (The most ”informative” signal according to the entropy function is one whose coefficients are distributed uniformly across temporal shifts of the signal)

Tree of orthonormal bases 1.Subset of basis vectors can be identified with intervals of N of form 2.Each basis in the library corresponds to a disjoint cover of N by intervals 3.If is the subspace identified with Then

Selecting the best basis Orthonormal tree search for best basis by induction. Donate Bn,k the basis of signal corresponding to Ink, and An,k the best basis for the same interval, For K=0 ther is single basis (An,0 = Bn,0). For K>0, *E – entropy, but can be any additive cost function

Code example function [ output_args ] = sd1( input_args ) %SD1 find best basis coefficent, find and print best basis tree % gnerate best basis from 50% overlapping windows of size s signal=input_args; s=2048; %define window size 2^(k), k =1,2,3.... count=0; mean_coff_tree= zeros(s,log2(s)+1); %run over 50% overlapping window and sum cofficent while length(signal)>(s-1) cur_window=signal(1:s); signal=signal((s/2+1):length(signal)); %get cofficent for single window cof_tree=find_coff(cur_window); mean_coff_tree=mean_coff_tree+cof_tree; count=count+1 end %calculate mean of output_args=mean_coff_tree./count; titlestr = 'test'; D=log2(s); %Build tree with entropy numbers output_args= CalcStatTree(output_args,'Entropy'); [btree,vtree] = BestBasis(output_args,D); signaltitle = [' CP Best Basis; ' titlestr]; hold on PlotBasisTree(btree,D,output_args,signaltitle); xlabel('Splits of Time Domain') ylabel('Entropy Drop') return function [ output_args ] = find_coff( input_args ) %FIND_COFF find cofficet of input D=log2(length(input_args)); %Generate Orthonormal QMF (quadrature mirror filter) %for Wavelet Transform qmf = MakeONFilter('Haar'); %output array of Wavelet Packet Decompositions %Coefficients for frequency interval % [b/2^d,(b+1)/2^d] is stored in wp(packet(d,b,n),d+1) cof_tree=WPAnalysis(input_args,D,qmf); output_args=cof_tree return

Output

Function usage for very short signal signal = [ ] %Generate Orthonormal QMF (quadrature mirror filter) %for Wavelet Transform Input>> qmf = MakeONFilter('Haar') output>> qmf = %output array of Wavelet Packet Decompositions %Coefficients for frequency interval % [b/2^d,(b+1)/2^d] is stored in wp(packet(d,b,n),d+1) Input>> cof_tree=WPAnalysis(pre1,3,qmf) Output>> cof_tree = %Build tree with entropy numbers Input>> entrophy_val=CalcStatTree(cof_tree,'Entropy') Output >> entrophy_val = Columns 1 through Columns 6 through Columns 11 through Relatet to 1 depth decomposion Relatet to 2 depth decomposion Relatet to 3 depth decomposion Relatet to 4 depth decomposion

Short signal - First step example Origin signal D1 coefficients D2 coefficients D3 coefficients D4 coefficients ***Numbers upon subsets are correlated entropy values

Best basis for 2048 samples length signal function [ output_args ] = OneWin( input_args ) %finding the best basis tree for one window subj= load('Subject1/subj1_data_seizure1'); p_pre=subj.pre_preictal; p_pre1=p_pre(1,:); n = length(p_pre1) t = (0:(n-1))./n; figure; subplot(3,1,1); plot(t,p_pre1); title('pre_preictal full signal'); w_size=2048; n=w_size; t = (0:(n-1))./n; D=log2(w_size) subplot(3,1,2); plot(t,p_pre1(1:w_size)); title('pre_preictal first window of size 2048'); qmf = MakeONFilter('Haar'); cof_tree=WPAnalysis(p_pre1(1:w_size),D,qmf); output_args= CalcStatTree(cof_tree,'Entropy'); [btree,vtree] = BestBasis(output_args,D); subplot(3,1,3); signaltitle = ['first window']; PlotBasisTree(btree,D,output_args,signaltitle); return end

Step by step (middle step) Step 1. The signal Step 2. Find coeffients for all decomposition Step 3. Find best basis The relation for this resoulation can be clearly seen,For right side of the signal high level decomposition hold more information

Finding the mean coefficients (start) Find all decomposions Coeffients for each of the 50% overlap window separately

Finding the mean coefficients (cont) To find mean derived best basis, we run over 50% overlapping windows, for each window, find stat tree and add it to the sum tree, also we count number of windows included. At the end off the this process we divide each of the n*logn coefficient with the counter and we got mean coefficients tree. To find std tree, we run over the signal for the second time, again find stat tree for each window, and use the mean coefficients we already got to find std for each one of the n*logn coffcients. see code at next two slides

Best Basis mean Derived (cont’) Generate mean coefficients for each decomposition Fined best basis tree for mean coefficients mean_coff_tree= zeros(s,log2(s)+1); %run over 50% overlapping window and sum cofficent while length(signal)>(s-1) cur_window=signal(1:s); signal=signal((s/2+1):length(signal)); %get n*logn coefficient for single window cof_tree=find_coff(cur_window); %get n*logn sums of cofficents mean_coff_tree=mean_coff_tree+cof_tree; count=count+1 end %calculate mean of mean_coff_tree=mean_coff_tree./count; %get best basis for the mean coefficient m_stat_tree=CalcStatTree(mean_coff_tree,'Entr opy'); [btree,vtree] = BestBasis(m_stat_tree,D);

Find STD tree count=0; std_coff_tree= zeros(s,log2(s)+1); %run over 50% overlapping window and sum cofficent while length(signal)>(s-1) cur_window=signal(1:s); signal=signal((s/2+1):length(signal)); %get n*logn coefficient for single window cof_tree=find_coff(cur_window); %get n*logn of squr diff for single window std_tree=(cof_tree-m_cof_tree).^2; %get n*logn sums of squr diff std_coff_tree=std_coff_tree+std_tree; count=count+1; end %calc n*logn std std_coff_tree=sqrt(std_coff_tree/count)

Using WAVELAB 850 A partial list of the techniques made available: orthogonal and biorthogonal wavelet transforms, translation-invariant wavelets, interpolating wavelet transforms, cosine packets, wavelet packets, matching pursuit, Library used for first part Wavelab850\Orthogonal library ◦ routines in this directory perform periodic- and boundary-corrected wavelet analysis of 1-d and 2-d signals. Wavelab850\Packets\One-D library ◦ routines in this directory perform wavelet packet analysis and cosine packet analysis of 1-d signals.