1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45
|
% hilbert enveloppe test
clc
figure
t = 0:1e-4:1;
x = [1+cos(2*pi*50*t)].*cos(2*pi*1000*t);
plot(t,x); set(gca,'xlim',[0 0.1]);
xlabel('Seconds'); ylabel('Amplitude');
y = hilbert(x);
env = abs(y);
plot(t,x); hold on;
plot(t,abs(y),'r','linewidth',2);
plot(t,-abs(y),'r','linewidth',2);
set(gca,'xlim',[0 0.1]);
xlabel('Seconds'); ylabel('Amplitude');
tmin=26000;
tmax=29000;
% mon execution
figure
emg=(Datas.EMG_1);
emgCentre=emg-nanmean(emg);
emgRectifie= sqrt(emgCentre.^2);
x=emgRectifie(tmin:tmax)/max(emgRectifie(tmin:tmax));
t=(tmin:tmax)/orgdata.SampFreq.EMG_1;
plot(t,x);
xlabel('Seconds'); ylabel('Amplitude');
y = hilbert(x);
env = abs(y);
plot(t,x); hold on;
plot(abs(y),'r','linewidth',2);
plot(-abs(y),'r','linewidth',2);
xlabel('Seconds'); ylabel('Amplitude');
figure
signal=emgRectifie(tmin:tmax)/max(emgRectifie(tmin:tmax));
[a,b]=butter(2,0.1);
sig_sq=2*signal.*signal;
y_sq = filter(a,b,sig_sq); % low filtre
y=sqrt(y_sq);
plot(t,signal); hold on;
plot(t,y,'r'); |
Partager