fpga.pdf

Embed Size (px)

Citation preview

  • 8/11/2019 fpga.pdf

    1/16

  • 8/11/2019 fpga.pdf

    2/16

  • 8/11/2019 fpga.pdf

    3/16

    Signal Processing and Pattern Recognition using Continuous WaveletsRonak Gandhi, Syracuse University, Fall 2009

    Introduction

    Electromyography (EMG) signal is a kind of biology electric motion which was produced by muscles andthe neural system. EMG signals are non-stationary and have highly complex time and frequencycharacteristics. Consequently, these signals can not be analyzed using classical methods such as FourierTransform, AR, MA, ARMA. Although the STFT can be used to satisfy the stationary condition for suchnonstationary signals, it suffers from the fact that the performance depends on appropriate length ofthe desired segment of the signal. To overcome such problems, wavelet transform was used as a futureextraction method and has been widely used in signal analysis.

    The transform techniques, which are used in signal analysis, has been thought only in time domain or infrequency domain. Although there is a relationship between time and frequency domain, existinganalysis techniques are limited to one of these domains. The wavelet transform, which has improved toreveal the information that the signal contains both in time, frequency and space to analyze non-stationary signals, is obtained by getting projection at signal over wavelet functions. Wavelet functionsare obtained by shifting and spreading the mother wavelet.

    The proposed work addresses the issue and methodologies for generating signals that are periodic innature. We designed a pattern and then modeled it to mother wavelet for our analysis. Apart from thatwe generated pseudorandom signals which are able to accurately detect the pattern within the randomsignal with ample amount of noise. The wavelets are then searched within complex/noise signals thatare generated from source.

  • 8/11/2019 fpga.pdf

    4/16

    Signal Processing and Pattern Recognition using Continuous WaveletsRonak Gandhi, Syracuse University, Fall 2009

    What is EMG?

    An electromyography(EMG) detects the electrical potential generated by muscle cells when these cellsare both mechanically active and at rest. The signals can be analyzed in order to detect medicalabnormalities or analyze the biomechanics of human or animal movement. There are still limitations indetection and characterization of existing nonlinearities in the surface electromyography (sEMG, aspecial technique for studying muscle signals) signal, estimation of the phase, acquiring exactinformation due to derivation from normality. Traditional system reconstruction algorithms have variouslimitations and considerable computational complexity and many show high variance (1). Recentadvances in technologies of signal processing and mathematical models have made it practical todevelop advanced EMG detection and analysis techniques. Various mathematical techniques andArtificial Intelligence (AI) have received extensive attraction.

    There are two kinds of EMG in widespread use: surface EMG and needle (intramuscular) EMG. Toperform intramuscular EMG, a needle electrode is inserted through the skin into the muscle tissue. Atrained professional (most often a physiatrist, neurologist, physical therapist, or chiropractor) observesthe electrical activity while inserting the electrode. The insertional activity provides valuable informationabout the state of the muscle and its innervating nerve. Normal muscles at rest make certain, normalelectrical sounds when the needle is inserted into them. Then the electrical activity when the muscle isat rest is studied. Abnormal spontaneous activity might indicate some nerve and/or muscle damage.Then the patient is asked to contract the muscle smoothly. The shape, size and frequency of theresulting motor unit potentials is judged. Then the electrode is retracted a few millimeters, and againthe activity is analyzed until at least 10-20 units have been collected. Each electrode track gives only avery local picture of the activity of the whole muscle. Because skeletal muscles differ in the innerstructure, the electrode has to be placed at various locations to obtain an accurate study. Instead, asurface electrode may be used to monitor the general picture of muscle activation, as opposed to theactivity of only a few fibres as observed using a needle. This technique is used in a number of settings;for example, in the physiotherapy clinic, muscle activation is monitored using surface EMG and patients

    have an auditory or visual stimulus to help them know when they are activating the muscle(biofeedback) . A motor unit is defined as one motor neuron and all of the muscle fibers it innervates.When a motor unit fires, the impulse (called an action potential) is carried down the motor neuron tothe muscle. The area where the nerve contacts the muscle is called the neuromuscular junction, or themotor end plate. After the action potential is transmitted across the neuromuscular junction, an actionpotential is elicited in all of the innervated muscle fibers of that particular motor unit. The sum of all thiselectrical activity is known as a motor unit action potential (MUAP). This electrophysiologic activity frommultiple motor units is the signal typically evaluated during an EMG. The composition of the motor unit,the number of muscle fibres per motor unit, the metabolic type of muscle fibres and many other factorsaffect the shape of the motor unit potentials in the myogram.

    http://en.wikipedia.org/wiki/Electrical_potentialhttp://en.wikipedia.org/wiki/Cell_%28biology%29http://en.wikipedia.org/wiki/Biomechanicshttp://www.ncbi.nlm.nih.gov/pmc/articles/PMC1455479/#B1http://en.wikipedia.org/wiki/Electrodehttp://en.wikipedia.org/wiki/Skinhttp://en.wikipedia.org/wiki/Physiatristhttp://en.wikipedia.org/wiki/Neurologisthttp://en.wikipedia.org/wiki/Chiropractorhttp://en.wikipedia.org/w/index.php?title=Insertional_activity&action=edit&redlink=1http://en.wikipedia.org/w/index.php?title=Motor_unit_potential&action=edit&redlink=1http://en.wikipedia.org/wiki/Skeletal_musclehttp://en.wikipedia.org/wiki/Electrodehttp://en.wikipedia.org/wiki/Musclehttp://en.wikipedia.org/wiki/Biofeedbackhttp://en.wikipedia.org/wiki/Motor_unithttp://en.wikipedia.org/wiki/Action_potentialhttp://en.wikipedia.org/wiki/Action_potentialhttp://en.wikipedia.org/wiki/Motor_unithttp://en.wikipedia.org/wiki/Biofeedbackhttp://en.wikipedia.org/wiki/Musclehttp://en.wikipedia.org/wiki/Electrodehttp://en.wikipedia.org/wiki/Skeletal_musclehttp://en.wikipedia.org/w/index.php?title=Motor_unit_potential&action=edit&redlink=1http://en.wikipedia.org/w/index.php?title=Insertional_activity&action=edit&redlink=1http://en.wikipedia.org/wiki/Chiropractorhttp://en.wikipedia.org/wiki/Neurologisthttp://en.wikipedia.org/wiki/Physiatristhttp://en.wikipedia.org/wiki/Skinhttp://en.wikipedia.org/wiki/Electrodehttp://www.ncbi.nlm.nih.gov/pmc/articles/PMC1455479/#B1http://en.wikipedia.org/wiki/Biomechanicshttp://en.wikipedia.org/wiki/Cell_%28biology%29http://en.wikipedia.org/wiki/Electrical_potential
  • 8/11/2019 fpga.pdf

    5/16

    Signal Processing and Pattern Recognition using Continuous WaveletsRonak Gandhi, Syracuse University, Fall 2009

    What is Wavelets?

    The fundamental idea behind wavelets is to analyze according to scale. Indeed, some researchers in thewavelet field feel that, by using wavelets, one is adopting a whole new mindset or perspective inprocessing data.Wavelets are functions that satisfy certain mathematical requirements and are used in representingdata or other functions. Approximation using superposition of functions that could superpose sines andcosines to represent other functions. However, in wavelet analysis, the scale that we use to look at dataplays a special role. Wavelet algorithms process data at different scales or resolutions. If we look at asignal with a large "window," we would notice gross features. Similarly, if we look at a signal with a small"window," we would notice small features.This makes wavelets interesting and useful. By their definition, these functions are non-local. Theytherefore do a very poor job in approximating sharp spikes. But with wavelet analysis, we can useapproximating functions that are contained neatly in finite domains. Wavelets are well-suited forapproximating data with sharp discontinuities.The wavelet analysis procedure is to adopt a wavelet prototype function, called an analyzingwavelet or mother wavelet. Temporal analysis is performed with a contracted, high-frequency version of

    the prototype wavelet, while frequency analysis is performed with a dilated, low-frequency version ofthe same wavelet. Because the original signal or function can be represented in terms of a waveletexpansion (using coefficients in a linear combination of the wavelet functions), data operations can beperformed using just the corresponding wavelet coefficients. And if you further choose the bestwavelets adapted to your data, or truncate the coefficients below a threshold, your data is sparselyrepresented. This sparse coding makes wavelets an excellent tool in the field of data compression.

  • 8/11/2019 fpga.pdf

    6/16

    Signal Processing and Pattern Recognition using Continuous WaveletsRonak Gandhi, Syracuse University, Fall 2009

    Types of wavelets

    Continuous Wavelet Transform :

    Mathematically, the process of Fourier analysis is represented by the Fourier transform:

    which is the sum over all time of the signal f(t) multiplied by a complex exponential. (Recall that acomplex exponential can be broken down into real and imaginary sinusoidal components.)The results of the transform are the Fourier coefficients F( ) , which when multiplied by a sinusoid offrequency yield the constituent sinusoidal components of the original signal. Graphically, the processlooks like

    Similarly, the continuous wavelet transform (CWT) is defined as the sum over all time of the signalmultiplied by scaled, shifted versions of the wavelet function :

    The results of the CWT are many wavelet coefficients C, which are a function of scale and position.Multiplying each coefficient by the appropriately scaled and shifted wavelet yields the constituentwavelets of the original signal

    What's Continuous About the Continuous Wavelet Transform?

    Any signal processing performed on a computer using real-world data must be performed on a discretesignal -- that is, on a signal that has been measured at discrete time. CWT distinguishes set of scales andpositions at which it operates.Unlike the discrete wavelet transform, the CWT can operate at every scale, from that of the originalsignal up to some maximum scale that you determine by trading off your need for detailed analysis withavailable computational horsepower.The CWT is also continuous in terms of shifting: during computation, the analyzing wavelet is shiftedsmoothly over the full domain of the analyzed function.

  • 8/11/2019 fpga.pdf

    7/16

    Signal Processing and Pattern Recognition using Continuous WaveletsRonak Gandhi, Syracuse University, Fall 2009

    Discrete Wavelet Transform

    Calculating wavelet coefficients at every possible scale is a fair amount of work, and it generates anawful lot of data. In this scales and positions based on powers of two -- so-called dyadic scales andpositions -- then our analysis which are more efficient and just as accurate. We obtain such an analysisfrom the discrete wavelet transform (DWT).

    An efficient way to implement this scheme using filters was developed in 1988 by Mallat. The Mallatalgorithm is in fact a classical scheme known in the signal processing community as a two-channel subband coder .This very practical filtering algorithm yields a fast wavelet transform -- a box into which asignal passes, and out of which wavelet coefficients quickly emerge. Let's examine this in more depth.

    One-Stage Filtering: Approximations and Details

    For many signals, the low-frequency content is the most important part. It is what gives the signal itsidentity. The high-frequency content, on the other hand, imparts flavor or nuance. Consider the humanvoice. If you remove the high-frequency components, the voice sounds different, but you can still tell

    what's being said. However, if you remove enough of the low-frequency components, you heargibberish.

    In wavelet analysis, we often speak of approximations and details. The approximations are the high-scale, low-frequency components of the signal. The details are the low-scale, high-frequencycomponents.

    The filtering process, at its most basic level, looks like this.

    The original signal, S, passes through two complementary filters and emerges as two signals.

    Unfortunately, if we actually perform this operation on a real digital signal, we wind up with twice asmuch data as we started with. Suppose, for instance, that the original signal S consists of 1000 samplesof data. Then the resulting signals will each have 1000 samples, for a total of 2000.

    These signals A and D are interesting, but we get 2000 values instead of the 1000 we had. There exists amore subtle way to perform the decomposition using wavelets. By looking carefully at the computation,we may keep only one point out of two in each of the two 2000-length samples to get the completeinformation. This is the notion of downsampling. We produce two sequences called cA and cD.

  • 8/11/2019 fpga.pdf

    8/16

    Signal Processing and Pattern Recognition using Continuous WaveletsRonak Gandhi, Syracuse University, Fall 2009

    The process on the right, which includes downsampling, produces DWT coefficients.

    To gain a better appreciation of this process, let's perform a one-stage discrete wavelet transform of asignal. Our signal will be a pure sinusoid with high-frequency noise added to it.Here is our schematic diagram with real signals inserted into it.

  • 8/11/2019 fpga.pdf

    9/16

    Signal Processing and Pattern Recognition using Continuous WaveletsRonak Gandhi, Syracuse University, Fall 2009

    Wavelet Packet Analysis

    The wavelet packet method is a generalization of wavelet decomposition that offers a richer range ofpossibilities for signal analysis.In wavelet analysis, a signal is split into an approximation and a detail. The approximation is then itselfsplit into a second-level approximation and detail, and the process is repeated. For an n-leveldecomposition, there are n+1 possible ways to decompose or encode the signal.

    In wavelet packet analysis, the details as well as the approximations can be split. This yields more thandifferent ways to encode the signal. This is the wavelet packet decomposition tree.

    The wavelet decomposition tree is a part of this complete binary tree.

    For instance, wavelet packet analysis allows the signal S to be represented as A1 + AAD3 + DAD3 + DD2.This is an example of a representation that is not possible with ordinary wavelet analysis.

    Choosing one out of all these possible encodings presents an interesting problem. In this toolbox, weuse an entropy-based criterion to select the most suitable decomposition of a given signal. This meanswe look at each node of the decomposition tree and quantify the information to be gained byperforming each split.

  • 8/11/2019 fpga.pdf

    10/16

  • 8/11/2019 fpga.pdf

    11/16

    Signal Processing and Pattern Recognition using Continuous WaveletsRonak Gandhi, Syracuse University, Fall 2009

    Design Overview

    The signal generation mechanism for EMG signals comprises of the summation of many muscle unitaction potentials (MUAPS) which are located in the muscle fibers. These impulse-like signals from themuscle are captured by the sensor through the skin interface and sensor. We hypothesize that themotion of the hand during the formation of a character is associated with the firing of thousands ofMUAPs which occur at different times and with different amplitudes. The surface sensor can only seethe summation of these individual signals. MUAPs that are known to have different shapes from simpleimpulse, square wave to complex Mexican hat function as shown below

    Wavelet for Impulse

    Haar Wavelet (Square in shape)

    Mexican Hat

  • 8/11/2019 fpga.pdf

    12/16

    Signal Processing and Pattern Recognition using Continuous WaveletsRonak Gandhi, Syracuse University, Fall 2009

    For our project we input complex pattern that was build in Matlab as shown below

    Figure shows the input generated for generating wavelet

    This pattern was converted in to wavelet with use of wavelet tool for analysis. Else can also be build withthe help of Matlab function. The wavelet generated from above pattern

    Figure shows the wavelet generated from the input pattern

  • 8/11/2019 fpga.pdf

    13/16

    Signal Processing and Pattern Recognition using Continuous WaveletsRonak Gandhi, Syracuse University, Fall 2009

    Different test signals were applied like adding wavelet within EMG and also added three large MUAPs tothe typical EMG signal. The result were shown below.

    Figure shows the input on top in which input patter is super imposed on ECG and 3D is the response ofdetection

    Figure shows different addition of three different pattern within EMG and the respose in 3D show thedetection of signal

  • 8/11/2019 fpga.pdf

    14/16

    Signal Processing and Pattern Recognition using Continuous WaveletsRonak Gandhi, Syracuse University, Fall 2009

    Creating a new wavelet

    %% Creating a wavelet of type 4 - wavelet without scaling function. % Next we create a wavelet family of type 4. These wavelets have no% associated scaling function and so, are only available for continuous % wavelet analysis.

    familyName = 'Give a suitlable family name'; familyShortName = 'Give a suitable short name'; familyWaveType = 4; familyNums = 'version number for the wave'; fileWaveName = 'load the wavelet file'; familyBounds = [Max -Min limit for wavelet];

    %% % Add this new wavelet family to the stack of wavelet families. wavemngr('add',familyName,familyShortName,familyWaveType, ...

    familyNums,fileWaveName,familyBounds)

    %% % The file *mywwavf.m* is already defined, so we can display its content.

    %% % Note that this function is available in the directory% |$MATLABHOME/wavelet/wavedemo| of the Wavelet Toolbox.%% % Verify that the wavelet family is created.

    %% % Display the wavelet function.

    %% % Load data file% Now compute the scalogram of the |sumsin| signal using this new % wavelet. %%

    %% % We can analyze the same signal using the Continuous Wavelet Transform% (CWT) with the new wavelet and display it as a 3-D representation.

  • 8/11/2019 fpga.pdf

    15/16

  • 8/11/2019 fpga.pdf

    16/16

    Signal Processing and Pattern Recognition using Continuous WaveletsRonak Gandhi, Syracuse University, Fall 2009

    References

    Quantification of the dynamic properties of EMG patterns during gait, Anthony L. Ricamato,Joseph M. Hidler, Journal of Electromyography and Kinesiology

    Comparison of Wavelet and Short Time Fourier Transform Methods in the Analysis of EMGSignals, Mehmet Rahmi Canal

    Mathwork manual, www.mathwork.com

    Adaptive signal Processing, Warren &Stoarns

    Stratification of time frequency abnormalities in the signal averaged high resolution ECG in Postinfarction Patients with and without ventricular tachycardic and congenitial long QT syndromeby Jean Philippe, Samir Fareh & Philippe Chevalier

    Detection of Spindles in Sleep EEGs Using a Novel Algorithm Based on Hilbert-Huang Transformby Zhihua Yang, Lihua Yang and Dongxu Qi

    Techniques of EMG signal analysis: detection, processing, classification and applications Biological Procedure Online. M.B.I. Raez, M.S. Hussain, and F. Mohd-Yasin

    An evaluation of the utility and limitation of counting motor unit action potential in the surfaceelectromyogram, Ping Zhou and William Zev Rymer

    http://www.mathwork.com/http://www.mathwork.com/