You are on page 1of 18

%Procesamiento Digital de Señales

%Laboratorio 2. Procesamiento digital de señales bioelectricas

clear all
close all
clc

figure (1)
Fmuestreo = 100;
Electro = load('a01m.mat');
Electro2 = Electro.val/200;
figure(1)
subplot(1,2,1)
stem(Electro.val);
title('Electrocardiograma Orignial')
ylabel('Amplitud (mV)')
xlabel('Tiempo (s)')

subplot(1,2,2)
stem(Electro2);
title('Electrocardiograma sin ganancia')
ylabel('Amplitud (mV)')
xlabel('Tiempo (s)')

%Remuestreo con resample

desiredFs = 1400;
t = (0:length(Electro.val)-1)/100;
[y, Ty] = resample(Electro.val,t,desiredFs);
figure(2)
stem(Ty,y)
title('Electrocardiograma Remuestreada')
ylabel('V(mv)')
xlabel('Tiempo (s)')

%Remuestreo con rat, de Matworks


originalFs = 100; desiredFs = 1400; [p,q] = rat(desiredFs / originalFs)
p=56;
q=4;
frn=originalFs * p / q
t=((0:length(Electro.val)-1)/frn)

figure(3)
% subplot(2,2,3)
plot(t,Electro.val);
hold on
title('Electrocardiograma Remuestreada')
ylabel('V(mv)')
xlabel('Tiempo (s)')

%Encontrar y contar picos


figure(4)
% findpeaks(Electro.val,'MinPeakProminence',200)
picos =findpeaks(Electro.val);
disp(picos)
[picos,locs] = findpeaks(Electro.val);
findpeaks(Electro.val)
text(locs+.02,picos,num2str((1:numel(picos))'));

title('Picos Electrocardiograma')
ylabel('V(mv)')
xlabel('Tiempo (s)')

figure (5)
picos =findpeaks(Electro.val,'MinPeakProminence',200);
disp(picos)
[picos,locs] = findpeaks(Electro.val,'MinPeakProminence',200);
findpeaks(Electro.val,'MinPeakProminence',200)
text(locs+.02,picos,num2str((1:numel(picos))'));
title('Picos mayores Electrocardiograma')
ylabel('V(mv)')
xlabel('Tiempo (s)')

%Modificacion nivel DC de la señal


%Nivel positivo
Pos = (Electro.val)+100;
%Nivel negativo
Neg = (Electro.val)-120;

figure (6)
subplot(1,2,1)
plot(Pos)
subplot(1,2,2)
plot(Neg)

p =

14

q =

frn =

1400

t =
Columns 1 through 7

0 0.0007 0.0014 0.0021 0.0029 0.0036 0.0043

Columns 8 through 14

0.0050 0.0057 0.0064 0.0071 0.0079 0.0086 0.0093

Columns 15 through 21

0.0100 0.0107 0.0114 0.0121 0.0129 0.0136 0.0143

Columns 22 through 28

0.0150 0.0157 0.0164 0.0171 0.0179 0.0186 0.0193

Columns 29 through 35

0.0200 0.0207 0.0214 0.0221 0.0229 0.0236 0.0243

Columns 36 through 42

0.0250 0.0257 0.0264 0.0271 0.0279 0.0286 0.0293

Columns 43 through 49

0.0300 0.0307 0.0314 0.0321 0.0329 0.0336 0.0343

Columns 50 through 56

0.0350 0.0357 0.0364 0.0371 0.0379 0.0386 0.0393

Columns 57 through 63

0.0400 0.0407 0.0414 0.0421 0.0429 0.0436 0.0443

Columns 64 through 70

0.0450 0.0457 0.0464 0.0471 0.0479 0.0486 0.0493

Columns 71 through 77

0.0500 0.0507 0.0514 0.0521 0.0529 0.0536 0.0543

Columns 78 through 84

0.0550 0.0557 0.0564 0.0571 0.0579 0.0586 0.0593

Columns 85 through 91

0.0600 0.0607 0.0614 0.0621 0.0629 0.0636 0.0643

Columns 92 through 98
0.0650 0.0657 0.0664 0.0671 0.0679 0.0686 0.0693

Columns 99 through 105

0.0700 0.0707 0.0714 0.0721 0.0729 0.0736 0.0743

Columns 106 through 112

0.0750 0.0757 0.0764 0.0771 0.0779 0.0786 0.0793

Columns 113 through 119

0.0800 0.0807 0.0814 0.0821 0.0829 0.0836 0.0843

Columns 120 through 126

0.0850 0.0857 0.0864 0.0871 0.0879 0.0886 0.0893

Columns 127 through 133

0.0900 0.0907 0.0914 0.0921 0.0929 0.0936 0.0943

Columns 134 through 140

0.0950 0.0957 0.0964 0.0971 0.0979 0.0986 0.0993

Columns 141 through 147

0.1000 0.1007 0.1014 0.1021 0.1029 0.1036 0.1043

Columns 148 through 154

0.1050 0.1057 0.1064 0.1071 0.1079 0.1086 0.1093

Columns 155 through 161

0.1100 0.1107 0.1114 0.1121 0.1129 0.1136 0.1143

Columns 162 through 168

0.1150 0.1157 0.1164 0.1171 0.1179 0.1186 0.1193

Columns 169 through 175

0.1200 0.1207 0.1214 0.1221 0.1229 0.1236 0.1243

Columns 176 through 182

0.1250 0.1257 0.1264 0.1271 0.1279 0.1286 0.1293

Columns 183 through 189

0.1300 0.1307 0.1314 0.1321 0.1329 0.1336 0.1343


Columns 190 through 196

0.1350 0.1357 0.1364 0.1371 0.1379 0.1386 0.1393

Columns 197 through 203

0.1400 0.1407 0.1414 0.1421 0.1429 0.1436 0.1443

Columns 204 through 210

0.1450 0.1457 0.1464 0.1471 0.1479 0.1486 0.1493

Columns 211 through 217

0.1500 0.1507 0.1514 0.1521 0.1529 0.1536 0.1543

Columns 218 through 224

0.1550 0.1557 0.1564 0.1571 0.1579 0.1586 0.1593

Columns 225 through 231

0.1600 0.1607 0.1614 0.1621 0.1629 0.1636 0.1643

Columns 232 through 238

0.1650 0.1657 0.1664 0.1671 0.1679 0.1686 0.1693

Columns 239 through 245

0.1700 0.1707 0.1714 0.1721 0.1729 0.1736 0.1743

Columns 246 through 252

0.1750 0.1757 0.1764 0.1771 0.1779 0.1786 0.1793

Columns 253 through 259

0.1800 0.1807 0.1814 0.1821 0.1829 0.1836 0.1843

Columns 260 through 266

0.1850 0.1857 0.1864 0.1871 0.1879 0.1886 0.1893

Columns 267 through 273

0.1900 0.1907 0.1914 0.1921 0.1929 0.1936 0.1943

Columns 274 through 280

0.1950 0.1957 0.1964 0.1971 0.1979 0.1986 0.1993

Columns 281 through 287


0.2000 0.2007 0.2014 0.2021 0.2029 0.2036 0.2043

Columns 288 through 294

0.2050 0.2057 0.2064 0.2071 0.2079 0.2086 0.2093

Columns 295 through 301

0.2100 0.2107 0.2114 0.2121 0.2129 0.2136 0.2143

Columns 302 through 308

0.2150 0.2157 0.2164 0.2171 0.2179 0.2186 0.2193

Columns 309 through 315

0.2200 0.2207 0.2214 0.2221 0.2229 0.2236 0.2243

Columns 316 through 322

0.2250 0.2257 0.2264 0.2271 0.2279 0.2286 0.2293

Columns 323 through 329

0.2300 0.2307 0.2314 0.2321 0.2329 0.2336 0.2343

Columns 330 through 336

0.2350 0.2357 0.2364 0.2371 0.2379 0.2386 0.2393

Columns 337 through 343

0.2400 0.2407 0.2414 0.2421 0.2429 0.2436 0.2443

Columns 344 through 350

0.2450 0.2457 0.2464 0.2471 0.2479 0.2486 0.2493

Columns 351 through 357

0.2500 0.2507 0.2514 0.2521 0.2529 0.2536 0.2543

Columns 358 through 364

0.2550 0.2557 0.2564 0.2571 0.2579 0.2586 0.2593

Columns 365 through 371

0.2600 0.2607 0.2614 0.2621 0.2629 0.2636 0.2643

Columns 372 through 378

0.2650 0.2657 0.2664 0.2671 0.2679 0.2686 0.2693


Columns 379 through 385

0.2700 0.2707 0.2714 0.2721 0.2729 0.2736 0.2743

Columns 386 through 392

0.2750 0.2757 0.2764 0.2771 0.2779 0.2786 0.2793

Columns 393 through 399

0.2800 0.2807 0.2814 0.2821 0.2829 0.2836 0.2843

Columns 400 through 406

0.2850 0.2857 0.2864 0.2871 0.2879 0.2886 0.2893

Columns 407 through 413

0.2900 0.2907 0.2914 0.2921 0.2929 0.2936 0.2943

Columns 414 through 420

0.2950 0.2957 0.2964 0.2971 0.2979 0.2986 0.2993

Columns 421 through 427

0.3000 0.3007 0.3014 0.3021 0.3029 0.3036 0.3043

Columns 428 through 434

0.3050 0.3057 0.3064 0.3071 0.3079 0.3086 0.3093

Columns 435 through 441

0.3100 0.3107 0.3114 0.3121 0.3129 0.3136 0.3143

Columns 442 through 448

0.3150 0.3157 0.3164 0.3171 0.3179 0.3186 0.3193

Columns 449 through 455

0.3200 0.3207 0.3214 0.3221 0.3229 0.3236 0.3243

Columns 456 through 462

0.3250 0.3257 0.3264 0.3271 0.3279 0.3286 0.3293

Columns 463 through 469

0.3300 0.3307 0.3314 0.3321 0.3329 0.3336 0.3343

Columns 470 through 476


0.3350 0.3357 0.3364 0.3371 0.3379 0.3386 0.3393

Columns 477 through 483

0.3400 0.3407 0.3414 0.3421 0.3429 0.3436 0.3443

Columns 484 through 490

0.3450 0.3457 0.3464 0.3471 0.3479 0.3486 0.3493

Columns 491 through 497

0.3500 0.3507 0.3514 0.3521 0.3529 0.3536 0.3543

Columns 498 through 504

0.3550 0.3557 0.3564 0.3571 0.3579 0.3586 0.3593

Columns 505 through 511

0.3600 0.3607 0.3614 0.3621 0.3629 0.3636 0.3643

Columns 512 through 518

0.3650 0.3657 0.3664 0.3671 0.3679 0.3686 0.3693

Columns 519 through 525

0.3700 0.3707 0.3714 0.3721 0.3729 0.3736 0.3743

Columns 526 through 532

0.3750 0.3757 0.3764 0.3771 0.3779 0.3786 0.3793

Columns 533 through 539

0.3800 0.3807 0.3814 0.3821 0.3829 0.3836 0.3843

Columns 540 through 546

0.3850 0.3857 0.3864 0.3871 0.3879 0.3886 0.3893

Columns 547 through 553

0.3900 0.3907 0.3914 0.3921 0.3929 0.3936 0.3943

Columns 554 through 560

0.3950 0.3957 0.3964 0.3971 0.3979 0.3986 0.3993

Columns 561 through 567

0.4000 0.4007 0.4014 0.4021 0.4029 0.4036 0.4043


Columns 568 through 574

0.4050 0.4057 0.4064 0.4071 0.4079 0.4086 0.4093

Columns 575 through 581

0.4100 0.4107 0.4114 0.4121 0.4129 0.4136 0.4143

Columns 582 through 588

0.4150 0.4157 0.4164 0.4171 0.4179 0.4186 0.4193

Columns 589 through 595

0.4200 0.4207 0.4214 0.4221 0.4229 0.4236 0.4243

Columns 596 through 602

0.4250 0.4257 0.4264 0.4271 0.4279 0.4286 0.4293

Columns 603 through 609

0.4300 0.4307 0.4314 0.4321 0.4329 0.4336 0.4343

Columns 610 through 616

0.4350 0.4357 0.4364 0.4371 0.4379 0.4386 0.4393

Columns 617 through 623

0.4400 0.4407 0.4414 0.4421 0.4429 0.4436 0.4443

Columns 624 through 630

0.4450 0.4457 0.4464 0.4471 0.4479 0.4486 0.4493

Columns 631 through 637

0.4500 0.4507 0.4514 0.4521 0.4529 0.4536 0.4543

Columns 638 through 644

0.4550 0.4557 0.4564 0.4571 0.4579 0.4586 0.4593

Columns 645 through 651

0.4600 0.4607 0.4614 0.4621 0.4629 0.4636 0.4643

Columns 652 through 658

0.4650 0.4657 0.4664 0.4671 0.4679 0.4686 0.4693

Columns 659 through 665


0.4700 0.4707 0.4714 0.4721 0.4729 0.4736 0.4743

Columns 666 through 672

0.4750 0.4757 0.4764 0.4771 0.4779 0.4786 0.4793

Columns 673 through 679

0.4800 0.4807 0.4814 0.4821 0.4829 0.4836 0.4843

Columns 680 through 686

0.4850 0.4857 0.4864 0.4871 0.4879 0.4886 0.4893

Columns 687 through 693

0.4900 0.4907 0.4914 0.4921 0.4929 0.4936 0.4943

Columns 694 through 700

0.4950 0.4957 0.4964 0.4971 0.4979 0.4986 0.4993

Columns 701 through 707

0.5000 0.5007 0.5014 0.5021 0.5029 0.5036 0.5043

Columns 708 through 714

0.5050 0.5057 0.5064 0.5071 0.5079 0.5086 0.5093

Columns 715 through 721

0.5100 0.5107 0.5114 0.5121 0.5129 0.5136 0.5143

Columns 722 through 728

0.5150 0.5157 0.5164 0.5171 0.5179 0.5186 0.5193

Columns 729 through 735

0.5200 0.5207 0.5214 0.5221 0.5229 0.5236 0.5243

Columns 736 through 742

0.5250 0.5257 0.5264 0.5271 0.5279 0.5286 0.5293

Columns 743 through 749

0.5300 0.5307 0.5314 0.5321 0.5329 0.5336 0.5343

Columns 750 through 756

0.5350 0.5357 0.5364 0.5371 0.5379 0.5386 0.5393


Columns 757 through 763

0.5400 0.5407 0.5414 0.5421 0.5429 0.5436 0.5443

Columns 764 through 770

0.5450 0.5457 0.5464 0.5471 0.5479 0.5486 0.5493

Columns 771 through 777

0.5500 0.5507 0.5514 0.5521 0.5529 0.5536 0.5543

Columns 778 through 784

0.5550 0.5557 0.5564 0.5571 0.5579 0.5586 0.5593

Columns 785 through 791

0.5600 0.5607 0.5614 0.5621 0.5629 0.5636 0.5643

Columns 792 through 798

0.5650 0.5657 0.5664 0.5671 0.5679 0.5686 0.5693

Columns 799 through 805

0.5700 0.5707 0.5714 0.5721 0.5729 0.5736 0.5743

Columns 806 through 812

0.5750 0.5757 0.5764 0.5771 0.5779 0.5786 0.5793

Columns 813 through 819

0.5800 0.5807 0.5814 0.5821 0.5829 0.5836 0.5843

Columns 820 through 826

0.5850 0.5857 0.5864 0.5871 0.5879 0.5886 0.5893

Columns 827 through 833

0.5900 0.5907 0.5914 0.5921 0.5929 0.5936 0.5943

Columns 834 through 840

0.5950 0.5957 0.5964 0.5971 0.5979 0.5986 0.5993

Columns 841 through 847

0.6000 0.6007 0.6014 0.6021 0.6029 0.6036 0.6043

Columns 848 through 854


0.6050 0.6057 0.6064 0.6071 0.6079 0.6086 0.6093

Columns 855 through 861

0.6100 0.6107 0.6114 0.6121 0.6129 0.6136 0.6143

Columns 862 through 868

0.6150 0.6157 0.6164 0.6171 0.6179 0.6186 0.6193

Columns 869 through 875

0.6200 0.6207 0.6214 0.6221 0.6229 0.6236 0.6243

Columns 876 through 882

0.6250 0.6257 0.6264 0.6271 0.6279 0.6286 0.6293

Columns 883 through 889

0.6300 0.6307 0.6314 0.6321 0.6329 0.6336 0.6343

Columns 890 through 896

0.6350 0.6357 0.6364 0.6371 0.6379 0.6386 0.6393

Columns 897 through 903

0.6400 0.6407 0.6414 0.6421 0.6429 0.6436 0.6443

Columns 904 through 910

0.6450 0.6457 0.6464 0.6471 0.6479 0.6486 0.6493

Columns 911 through 917

0.6500 0.6507 0.6514 0.6521 0.6529 0.6536 0.6543

Columns 918 through 924

0.6550 0.6557 0.6564 0.6571 0.6579 0.6586 0.6593

Columns 925 through 931

0.6600 0.6607 0.6614 0.6621 0.6629 0.6636 0.6643

Columns 932 through 938

0.6650 0.6657 0.6664 0.6671 0.6679 0.6686 0.6693

Columns 939 through 945

0.6700 0.6707 0.6714 0.6721 0.6729 0.6736 0.6743


Columns 946 through 952

0.6750 0.6757 0.6764 0.6771 0.6779 0.6786 0.6793

Columns 953 through 959

0.6800 0.6807 0.6814 0.6821 0.6829 0.6836 0.6843

Columns 960 through 966

0.6850 0.6857 0.6864 0.6871 0.6879 0.6886 0.6893

Columns 967 through 973

0.6900 0.6907 0.6914 0.6921 0.6929 0.6936 0.6943

Columns 974 through 980

0.6950 0.6957 0.6964 0.6971 0.6979 0.6986 0.6993

Columns 981 through 987

0.7000 0.7007 0.7014 0.7021 0.7029 0.7036 0.7043

Columns 988 through 994

0.7050 0.7057 0.7064 0.7071 0.7079 0.7086 0.7093

Columns 995 through 1.000

0.7100 0.7107 0.7114 0.7121 0.7129 0.7136

Columns 1 through 13

-12 -13 -16 -16 -16 -17 -17 31 -39 294 -31 -28 -23

Columns 14 through 26

-18 46 47 0 -3 -11 -15 -13 -15 -18 39 -37 237

Columns 27 through 39

-29 -21 42 44 43 1 0 -1 -7 -8 -10 -16 -15

Columns 40 through 52

-16 -19 37 -35 244 -27 -18 16 48 49 0 -1 -2

Columns 53 through 65

-8 -13 -17 -16 -20 -19 38 -40 299 -35 53 -7 -4

Columns 66 through 78
-6 -12 -16 -17 -18 -20 -22 -19 32 -35 340 -29 -23

Columns 79 through 91

48 56 0 -4 -10 -12 -12 -16 -17 -18 -17 -15 29

Columns 92 through 104

-36 344 -30 -27 -24 53 3 5 -8 -9 -9 -10 -11

Columns 105 through 117

-13 -15 -14 -13 36 -34 -35 319 -26 -26 -22 52 2

Columns 118 through 130

4 -6 -12 -11 -13 -13 -14 -14 -15 36 -32 -33 299

Columns 131 through 143

-26 -27 -24 -11 43 49 0 -13 -13 -15 -16 -15 -16

Columns 144 through 156

-16 -17 -15 32 -34 -35 294 49 4 -1 -1 -8 -10

Columns 157 through 169

-13 -13 -12 -13 -16 -10 32 -32 310 -21 -17 54 55

Columns 170 through 182

-9 -14 -17 -14 -17 -17 -18 -18 34 -37 -36 309 -31

Columns 183 through 188

-29 -26 48 49 0 -11

294 237 244 299 340 344 319 299 294 310 309
Published with MATLAB® R2020b

You might also like