i'm having problem to segmentized emg data.i want to segmentized into 256 with overlapping of 128.

clear all; close all; clc;
%%%%%%%%%%%%%%%%%%%%%%% LOAD EMG SIGNAL %%%%%%%%%%%%%%%%%%%%%%%%%% data=load('manggai_dorsi_trial1.txt'); data_channel3=data(:,2);
%%%%%%%%%%%%%%%%%%%%%% FRAMING SIGNAL %%%%%%%%%%%%%%%%%%%%% %FrameLen=240; %FrameInc=80; %[x1,x2,amp,zcr]=vad(data_channel3,FrameLen,FrameInc); %y=data_channel3(x1*FrameInc:x2*FrameInc);
%%%%%%%%%%%%%%%%%%%%%% SEGEMENTATION SIGNAL %%%%%%%%%%%%%%% %sampling fs=1000; N=length(data_channel3); t = (0:N-1)/fs; % times of sampling instants subplot(2,1,1), plot(t,data_channel3); legend('Waveform'); xlabel('Time (s)'); ylabel('Amplitude');
%Plot the segmentized waveform x=N/fs; NoOfSamples = 256; Overlap = 128;
HammingWindow = hamming(NoOfSamples); % Hamming window NumberOfFrames = floor((N/(NoOfSamples-Overlap)));
for i = 1:NumberOfFrames if i == 1 signal1 = data_channel3(1:NoOfSamples); else downlimit = (i-1)*(NoOfSamples-Overlap)+1; uplimit = downlimit+NoOfSamples-1; signal2 = data_channel3(downlimit:uplimit); end end results
subplot(2,1,2), plot (results); legend('Waveform'); xlabel('Time (s)'); ylabel('Amplitude');

2 Comments

It is not useful to post code without describing the occurring problems with any detail. How could we guess which kind of problem you have?!

Sign in to comment.

Answers (0)

Categories

Asked:

on 28 Apr 2013

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!