1、 探究心电信号的初步分析。心电信号(频率一般在0.05Hz〜100Hz范围)是一种 基本的人体生理信号,体表检测人体心电信号中常带有工频干扰(50HZ)、基线漂移(频率低于0.5Hz)和肌电干扰等各种噪声。
2、 为了得到不失真的原始心电信号,需要滤波预处理。设计数字低通滤波器、高通滤波器、带阻滤波器,用MATLAB软件对含噪心电信号分别进行高通、带阻和低通滤波等处理,将心电信号中的低频基线漂移、50Hz工频高频和高频杂波进行滤除。
3、 通过观察对含噪心电图信号的滤波作用,获得数字滤波的感性知识。
给定一组干净心电信号数据,数据文件存于Ecg.txt。采样频率 f s = 500 H z f_s = 500Hz fs=500Hz。
Ecg.txt 内容如下:(实际上就是1800采样点的一维数组)
10 11 13 14 15 15 18 21 23 25 25 25 25 26 27 28 29 29 28 26 25 24 25 25 25 23 19 18 17 17 17 16 15 13 12 11 9 6 3 0 0 -1 -2 -3 -5 -6 -9 -13 -15 -16 -18 -19 -20 -20 -21 -21 -20 -19 -19 -21 -22 -23 -22 -21 -20 -20 -21 -22 -24 -25 -25 -24 -23 -22 -20 -20 -21 -21 -20 -18 -17 -17 -18 -18 -16 -16 -16 -15 -15 -16 -17 -17 -16 -15 -14 -13 -14 -13 -11 -9 -7 -6 -5 -7 -8 -7 -6 -5 -4 -3 -2 -2 0 0 0 0 0 0 0 0 1 0 1 2 1 0 0 0 0 1 1 0 0 0 0 0 1 1 1 1 3 5 5 6 6 5 3 4 4 5 4 3 1 0 0 0 1 3 3 2 1 2 3 3 3 4 4 1 0 0 0 0 0 1 0 0 2 3 4 5 4 5 7 9 10 10 10 8 5 5 8 9 9 10 9 6 6 7 10 11 13 13 13 14 13 12 12 14 14 12 12 12 12 13 16 17 17 18 18 17 19 28 40 52 66 79 90 99 106 110 110 104 91 67 37 11 -3 -13 -18 -21 -22 -22 -21 -21 -20 -18 -16 -13 -10 -6 -4 -6 -5 -2 -1 0 0 2 2 2 2 2 1 1 1 0 0 0 0 0 0 0 0 1 2 1 0 0 0 0 0 1 1 1 0 1 1 1 2 3 4 6 6 4 4 5 5 6 8 10 10 10 11 13 13 15 17 18 20 22 24 26 27 28 28 28 30 31 32 33 31 28 28 31 33 34 34 34 32 30 29 29 28 26 24 21 19 18 18 17 16 13 7 4 2 0 -1 -3 -6 -10 -11 -12 -14 -16 -17 -18 -21 -21 -20 -20 -21 -21 -21 -23 -24 -23 -22 -21 -22 -22 -23 -24 -24 -22 -22 -23 -23 -23 -23 -22 -20 -17 -15 -15 -16 -16 -15 -15 -14 -12 -11 -12 -11 -9 -8 -7 -7 -7 -8 -8 -8 -8 -8 -7 -7 -6 -6 -5 -5 -5 -5 -3 -3 -3 -2 -1 0 0 0 -1 -2 -1 0 0 1 2 2 1 2 3 3 3 4 5 5 6 6 6 6 6 3 2 2 2 3 4 3 2 1 4 5 6 6 7 6 7 7 8 8 8 9 8 6 7 8 9 9 9 9 6 5 5 4 4 4 2 0 0 0 0 0 0 0 -3 -4 -3 -3 -2 -3 -4 -6 -3 -2 -2 -3 -3 -4 -3 0 1 2 3 3 4 3 3 3 5 7 7 6 5 7 9 9 9 10 9 8 9 13 12 11 11 13 12 10 10 12 13 12 12 12 14 17 19 20 21 21 21 27 39 52 64 76 87 96 106 114 118 117 108 89 63 36 14 0 -7 -10 -12 -14 -14 -14 -12 -11 -10 -9 -10 -10 -8 -7 -7 -5 -4 -2 -1 -1 0 0 0 0 0 0 2 3 3 3 4 2 2 4 5 4 5 4 3 3 4 6 8 8 7 4 3 2 0 0 0 1 0 0 0 1 1 2 2 2 3 5 6 9 11 14 15 16 18 20 23 24 24 24 25 28 30 32 35 35 33 32 32 34 36 37 37 37 37 37 37 36 35 33 31 29 27 24 22 20 18 14 11 8 4 2 0 0 -3 -5 -7 -10 -13 -16 -18 -21 -23 -24 -25 -27 -27 -26 -28 -29 -28 -26 -26 -25 -25 -26 -27 -28 -28 -28 -28 -28 -28 -28 -27 -27 -25 -23 -21 -22 -22 -20 -19 -19 -19 -18 -16 -16 -15 -14 -13 -12 -13 -12 -12 -11 -11 -11 -9 -8 -8 -8 -6 -4 -3 -3 -1 -1 -2 -1 0 0 0 0 0 0 -1 -1 0 1 2 0 -1 0 0 0 0 0 1 0 0 0 1 1 1 0 0 0 0 1 1 2 1 0 1 3 4 4 3 3 2 3 4 4 2 2 2 1 0 0 0 0 0 0 -1 0 0 0 1 3 2 1 1 1 2 2 3 3 3 3 4 4 4 4 4 2 1 0 0 0 0 0 -1 -1 0 0 -1 -2 -2 -5 -6 -6 -5 -4 -4 -5 -7 -7 -6 -5 -4 -2 -1 -3 -2 0 0 0 0 -1 -2 -2 -1 0 0 0 1 2 2 2 3 3 3 3 1 1 2 4 5 5 6 5 4 4 6 8 10 12 13 14 15 17 18 24 35 47 60 72 84 96 105 113 115 113 104 89 64 35 11 -4 -12 -16 -18 -19 -20 -21 -21 -20 -18 -17 -15 -15 -14 -15 -15 -12 -9 -8 -6 -5 -6 -6 -5 -3 -1 -1 0 -2 -2 -2 -1 0 0 3 2 1 0 1 2 3 3 2 2 3 3 4 4 5 4 5 5 5 6 6 7 6 6 7 8 8 8 9 9 9 10 10 13 14 15 15 16 19 21 23 24 27 28 28 30 32 33 34 36 35 33 32 32 33 33 32 31 30 29 29 28 26 23 20 19 18 16 14 12 10 5 0 0 -1 -4 -7 -11 -15 -18 -20 -22 -23 -24 -26 -29 -31 -31 -32 -34 -34 -35 -37 -40 -41 -40 -39 -38 -37 -37 -38 -39 -38 -36 -36 -37 -38 -38 -36 -36 -36 -36 -36 -37 -40 -39 -37 -36 -35 -34 -33 -33 -32 -33 -31 -29 -29 -30 -30 -29 -27 -25 -22 -21 -21 -23 -23 -21 -19 -20 -19 -19 -20 -20 -19 -18 -17 -16 -15 -15 -14 -12 -11 -9 -8 -8 -9 -8 -6 -4 -4 -4 -5 -6 -6 -6 -6 -6 -6 -6 -8 -6 -4 -4 -2 -1 -2 -3 -3 -3 -4 -4 -4 -3 -4 -5 -5 -4 -4 -5 -7 -8 -7 -6 -5 -4 -4 -4 -6 -6 -4 -3 -3 -3 -3 -4 -3 -1 -1 -1 -1 -1 -2 -1 0 0 0 2 1 0 0 0 0 -1 -1 -2 -4 -4 -4 -3 -3 -3 -2 -2 -2 -4 -3 -3 -3 -4 -5 -3 -3 -3 -5 -6 -6 -7 -7 -6 -6 -6 -6 -6 -7 -7 -7 -6 -6 -7 -7 -8 -6 -5 -6 -6 -6 -4 -5 -6 -3 -1 -1 0 0 0 -1 0 0 2 3 3 2 2 3 4 4 6 8 9 11 14 17 17 16 20 28 41 55 67 80 91 100 105 107 107 100 84 55 23 0 -15 -22 -26 -28 -28 -27 -27 -26 -23 -20 -17 -14 -12 -11 -11 -9 -7 -4 -1 0 0 0 1 2 2 2 2 0 -1 0 0 0 0 0 0 -2 -2 0 0 0 0 0 0 0 0 0 1 1 0 0 0 2 3 3 4 4 4 5 5 5 6 6 5 6 9 11 12 14 16 18 18 20 22 23 22 23 23 24 26 28 30 32 35 37 38 38 38 38 37 36 34 30 29 28 27 26 26 25 23 22 21 20 17 14 10 6 4 2 0 -1 -4 -8 -12 -14 -16 -17 -18 -19 -22 -25 -27 -27 -27 -28 -30 -31 -32 -32 -33 -32 -32 -32 -33 -34 -32 -32 -32 -32 -30 -29 -30 -29 -28 -26 -26 -26 -26 -27 -27 -27 -26 -25 -24 -24 -24 -24 -21 -20 -19 -19 -19 -21 -20 -19 -17 -17 -19 -20 -22 -22 -18 -15 -13 -13 -13 -14 -14 -13 -11 -10 -9 -8 -10 -10 -10 -9 -10 -10 -9 -9 -9 -9 -9 -9 -8 -8 -8 -7 -6 -5 -6 -5 -6 -7 -6 -5 -5 -5 -6 -6 -7 -7 -6 -6 -6 -6 -6 -7 -6 -6 -6 -5 -4 -6 -8 -7 -6 -5 -5 -5 -5 -6 -4 -4 -3 -3 -3 -2 -4 -2 -2 -3 -5 -6 -7 -8 -8 -5 -4 -4 -3 -3 -4 -3 -2 -2 -1 0 0 -2 -2 -2 -2 0 0 0 -3 -4 -3 -3 -3 -3 -2 -4 -5 -5 -4 -3 -3 -4 -5 -5 -5 -5 -5 -5 -6 -6 -4 -3 -4 -4 -5 -5 -6 -4 -4 -3 -2 -3 -3 -4 -4 -4 -3 -2 -1 -1 -2 -2 0 0 2 3 4 3 3 3 3 2 1 2 2 1 1 1 1 0 0 2 5 9 10 11 12 11 7 9 18 29 40 49 57 64 70 76 81 81 77 63 38 12 -6 -17 -22 -25 -25 -27 -27 -23 -19 -16 -14 -12 -11 -11 -10 -8 -6 -4 -2 -2 -3 -2 0 0 0 0 -2 -4 -3 -1 0 0 0 -1 -2 -1 0 1 3 3 1 0 0 0 0 1 2 0 0 0 2 2 2 2 2 1 2 3 4 3 3 2 2 3 4 6 7 7 5 5 6 7 7 7 9 9 10 11 13 16 16 15 13 14 15 18 20 21 20 18 17 17 17 16 16 16 14 13 13 12 11 7 5 2 0 -2 -5 -8 -12 -15 -18 -22 -23 -26 -28 -30 -33 -37 -41 -42 -44 -46 -46 -46 -46 -47 -47 -47 -47 -47 -49 -51 -51 -50 -48 -46 -46 -45 -45 -47 -46 -44 -44 -43 -42 -41 -41 -40 -39 -37 -36 -35 -35 -36 -35 -34 -32 -31 -30 -31 -32 -31 -29 -27 -26 -26 -26 -25 -23 -23 -21 -20 -19 -19 -19 -18 -17 -16 -15 -14 -15 -16 -14 -12 -11 -10 -9 -7 -8 -7 -7 -6 -6 -5 -5 -6 -5 -4 -2 0 0 -2 -5 -6 -5 -4 -3 -1 0 -1 -1 0 1 2 2 1 0 2 1 0 1 2 1 0 0 0 0 0 0 0 0 0 0 0 0 2 2 1 0 0 0 1 1 0 0 -1 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 1 1 0 0 0 0 0 0 1 1 0 0 0 1 0 0 0 0 0 0 0 1 2 2 0 0 0 0 0 1 1 0 0 2 3 3 3 3 2 2 3 5 6 6 6 5 5 5 5 6 8 7 5 5 6 7 8 11 15 16 17 18 19 19 17 18 25 35 44 52 59 64 66 67 67 66 61 48 27 4 -13 -24 -29 -31 -32 -32 -31 -31 -31 -30 -29 -27 -24 -23 -22 -21 -19 -19 -19 -19 -17 -16 -15 -14 -13 -12 -10 -8 -9 -10 -9 -8 -7 -7 -7 -7 -8 -7 -6 -6 -5 -5 -7 -8 -8 -7 -7 -8 -9 -11 -13 -12 -10 -8 -7 -6 -6 -8 -7 -7 -7 -6 -4 -3 -3 -1 -1 0 0 0 0 0 2 4 6 7 8 8 8 11 13 14 17 19 17 17 19 21 22 22 24 24 22 22 23 24 23 22 20 18 18 17 17 17 15 12 11 9 8 7 4 1 0 -2 -4 -7 -9 -11 -12 -14 -16 -16 -16 -16 -16 -17 -20 -21 -20 -19 -20 -20 -21 -23 -24 -23 -21 -21 -22 -21 -21 -23 -24 -23 -22 -20 -19 -19 -19 -17 -17 -17 -15 -15 -15 -16 -15 -13 -12 -11 -10 -9 -9 -8 -7 -6 -6 -6 -6 -6 -5 -4 -4 -2 -1 -3 -3 -3 -2 -3 -3 -2 -1 -2 -1 0 1 4 4 4 3 4 5 7 10 11 10 8 8 8 8 9 11 10 8 8 8 9 8 8 9 9 9 10 11 12 13 11 10 11 12 12 12 12 11 9 9 10 11 12 12 12 11 11 11 10 11 12 11 11 12 12 11 11 13 13 9 8 8 10 10 9 7 5 4 4 4 4 4 3 2 2 3 4 4 4 2 0 0 0 0 2 2 2 1 1 2 2 3 5 5 5 6 7 9 11 12 13 11 10 11 11 12 13 14 14 14 14 15 15 14 13 12 11 12 11 11 11 10 9 8 9 12 13 15 17 18 19 21 24 24 24 28 37 47 58 67 76 83 89 92 92 89 82 69 48 26 10 0 -3 -4 -4 -4 -5 -5 -5 -3 -3 -2 0 0 0 0 0 3 3 3 4 3 4 6 6 5 4 5 5 3 3 4 6 8 9 8 7 7 6 6 8 11 10 9 11 12 12 12 12 11 10 9 10 10 12 11 10 10 10 10 10 11 12 11 11 12 14 16 18 20 20 20 23 24 26 28 29 29 29 30 31 33 35 37 36 34 34 35 35 36 37 38 36 35 35 34 33 31 30 27 26 25 23 20 17 13 10 9 7 5 1 0 -3 -6 -8 -9 -10 -12 -14 -16 -18 -19 -19 -19 -21 -21 -23 -25 -24 -24 -25 -24 -24 -25 -26 -25 -25 -25 -25 -23 -23 -23 -24 -23 -22 -23 -23 -23 -24 -22 -19 -20 -21 -21 -22 -24 -24 -22 -19 -19 -19 -19 -20 -20 -19 -17 -16 -14 -14 -14 -13 -11 -10 -9 -6 -6 -7 -6 -5 -3 -3 -3 -4 -6 -6 -4 -4 -4 -4 -5 -6 -5 -4 -3 -3 -4 -3 -5 -5 -3 -1 -1 -2 -1 -2 -2 -1 0 0 0 0 -2 -2 -1 0 0 0 1 0 0 1 2 3 4 6 5 4 5 5 5 4 4 2 2 3 4 4 2 1 0 0 0 0 0 0 -1 -4 -3 -2 0 0 -1 -2 -3 -3 -3 -4 -4 -4 -4 -5 -5 -5 -4 -2 0 0 0 0 0 0 0 0 0 0 0 1 3 7 8 9 9 9 10 11 10 10 8 6 5 5 7 8 9 11 11 9 9 10 11 12 13 14 16 19 20 21 22 21 19 23 34 46 56 65 75 83 90 95 97 93 84 67 42 16 0 -10 -16 -19 -20 -19 -19 -16 -13 -12 -11 -9 -8 -7 -5 -4 -2 0 0 0 -1 0 0 1 0 0 1 1 4 5 5 7 7 6 6 5 6 7 8 9 10 8 9 9 10 11 11 10 9 10 10 10 10 10 8 8 10 12 13 12 12 12 12 12 13 13 13 13 14 13 15 17 16 17 19 21 22 24 27 28 29 30 31 31 32 33 34 35 34 34 33 33 34 32 31 31 29 26 25 23 21 18 15 11 8 5 2 0 -1 -3 -7 -12 -16 -19 -22 -23 -24 -26 -30 -31 -32 -33 -35 -35 -36 -37 -36 -35 -34 -33 -33 -34 -35 -35 -34 -34 -33 -32 -31 -33 -32 -30 -30 -30 -29 -28 -29 -27 -25 -23 -22 -23 -24 -27 -28 -26 -24 -24 -22 -22 -23 -24 -22 -22 -21 -20 -19 -18 -19 -19 -19 -19 -18 -16 -16 -15 -14 -13 -13 -12 -13 -15 -16 -13 -13 -13 -13 -12 -12 -10 -9 -8 -7 -7 -7 -9 -9 -8 -8 -7 -7 -8 -10 -11 -10 -8 -7 -7 -7 -8 -8 -8 -7 -7 -7 -6 -7 -7 -7 -6 -7 -7 -7 -8 -7 -6 -6 -6 -6 -6 -9 -9 -9 -8 -8 -8 -7 -8 -10 -10 -10 -9 -8 -8 -9 -11 -11 -11 -10 -10 -9 -9 -10 -11 -10 -10 -9 -9 -8 -9 -8 -7 -6 -6 -4 -3 -3 -3 -3 -3 -2 -1 -1 -2 0 1 1 1 2 0 0 0 0 1 2 4 4 4 3 3 4 5 6 7 7 9 11 12 13 13 11 11 17 28 40 48 56 63 68 74 77 76 70 55 30 5 -12 -23 -28 -30 -30 -29 -28 -24 -20 -16 -14 -12 -10 -9 -7 -5 -5 -2 0 0 -1 0 1 2 3 5 5 4 4 5 6 6 6 5 3 3 3 4 4 4 3 2 3 5 7 7 5 3 2 2 3 4 5 6 6 1 0 2 5 8 9 9 9 9 10 11 11 12 13 12 14 17 19 21 22 24 24 25 27 30 31 30 31 32 35 34 33 34 34 34 34 34 34 33 31 30 29 25 22 21 20 17 15 11 8 4 2 0 -1 -4 -7 -10 -13 -15 -17 -19 -20 -22 -28 -31 -32 -33 -33 -32 -33 -35 -36 -36 -36 -35 -35 -37 -38 -37 -35 -35 -35 -33 -33 -35 -36 -34 -32 -32 -32 -32 -33 -34 -32 -31 -29 -27 -28 -28 -29 -29 -29 -29 -28 -27 -27 -29 -29 -29 -28 -26 -26 -27 -26 -25 -25 -25 -24 -24 -24 -25 -24 -23 -22 -21 -21 -23 -24 -23 -21 -20 -19 -18 -17 -17 -17 -16 -13 -11 -12 -13 -14 -13 -13 -13 -11 -11 -13 -15 -15 -14 -15 -14 -13 -13 -14 -14 -14 -14 -15 -15 -16 -17 -16 -16 -15 -13 -12 -13 -13 -12 -11 -12 -11 -10 -11 -12 -12 -12 -11 -12 -13 -15 -16 -15 -14 -14 -13 -14 -16 -16 -16 -15 -14 -13 -12 -13 -12 -11 -11 -12 -13 -13 -13 -12 -12 -12 -11 -10 -10 -10 -10 -8 -6 -5 -5 -5 -6 -6 -5 -4 -3 -5 -5 -6 -6 -5 -3 -1 0 0 0 0 2 4 6 7 8 5 2 4 11 19 28 35 41 45 49 51 53 53 49 37 17 0 -11 -17 -20 -20 -20 -20 -19 -16 -15 -14 -13 -11 -12 -11 -10 -9 -7 -7 -6 -4 -3 -3 -3 -2 -1 -1 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 1 1 1 1 3 3 3 4 4 4 3 4 3 4 5 6 5 4 4 4 4 5 6 7 7 6 4 4 5 6 8 10 12 12 13 15 15 16 17 16 16 17 18 18 18 19 20 19 19 18 18 17 17 16 15 14 13 11 10 9 7 4 3 1 0 0 -1 -4 -7 -10 -11 -13 -15 -16 -17 -20 -21 -21 -23 -25 -26 -27 -28 -29 -27 -27 -26 -26 -27 -28 -29 -29 -28 -28 -26 -24 -25 -24 -23 -22 -23 -23 -24 -26 -28 -26 -24 -22 -21 -21 -21 -22 -21 -20 -19 -16 -16 -18 -17 -15 -15 -14 -14 -13 -14 -14 -13 -12 -13 -14 -13 -12 -12 -11 -9 -7 -7 -8 -9 -8 -7 -7 -7 -6 -5 -7 -7 -5 -3 -3 -3 -4 -6 -6 -5 -3 -3 -4 -5 -6 -7 -6 -6 -6 -5 -4 -5 -4 -3 -2 -3 -2 0 0 -1 -2 -1 -1 -1 -1 -2 -3 -4 -3 -3 -2 -1 -2 -2 -2 -2 -2 -1 -1 -3 -4 -3 -3 -3 -3 -3 -4 -6 -6 -6 -7 -7 -5 -5 -6 -4 -2 -2 0 0 1 0 0 0 1 2 4 5 4 4 5 6 9 10 10 10 11 13 13 12 12 11 9 10 11 11 11 11 9 9 10 13 16 18 19 20 19 19 18 23 32 42 51 57 64 69 73 75 77 74 67 53 33 15 3 -2 -6 -8 -8 -8 -8 -7 -4 -3 -4 -3 -1 -1 -1 0 0 0 1 1 2 3 3 3 2 1 1 3 5 7 8 5 4 5 7 8 9 9 10 10 11 10 10 10 11 11 11 11 11 11 12 11 8 8 9 10 11 11 11 10 11 13 14 17 17 17 17 16 17 17 17 20 22 21 21 22 24 25 27 29 30 29 29 29 31 33 35 35 35 36 36 36 35 34 30 28 27 27 26 25 24 21 19 17 15 13 10 8 5 2 0 0 -1 -3 -5 -10 -13 -15 -17 -18 -19 -19 -20 -21 -21 -22 -22 -22 -23 -24 -23 -24 -25 -26 -26 -26 -25 -26 -25 -23 -22 -21 -20 -22 -23 -22 -21 -20 -19 -19 -21 -23 -21 -19 -18 -18 -17 -18 -18 -16 -16 -16 -17 -15 -14 -15 -14 -13 -13 -13 -14 -16 -16 -15 -13 -11 -10 -9 -8 -8 -7 -7 -7 -7 -7 -8 -8 -6 -5 -4 -3 -2 -3 -4 -3 -2 -1 -1 -1 0 0 0 -1 -1 0 0 -2 -3 -3 -2 -1 0 -1 -2 -4 -3 -1 0 0 0 -1 -2 -2 -1 -1 -1 -1 -2 -3 -1 0 0 -2 -2 -4 -6 -5 -2 -1 -2 -3 -4 -5 -6 -6 -5 -3 -4 -6 -6 -6 -6 -7 -7 -6 -6 -7 -7 -4 -3 -2 -1 -1 -1 -1 0 0 1 2 2 0 0 1 2 5 6 4 2 4 7 8 8 8 8 7 6 6 6 7 7 8 8 9 10 12 13 14 13 10 14 24 33 44 54 64 71 77 81 83 81 73 60 40 17 0 -9 -14 -17 -19 -21 -19 -16 -13 -12 -11 -10 -10 -9 -6 -3 -2 -2 -2 -2 -2 0 0 1 3 2 2 1 0 1 1 3 5 6 6 6 6 6 7 8 7 5 5 5 5 5 5 5 5 6 6 7 6 6 5 4 5 7 8 9 9 6 3 4 7 10 13 14 15 16 17 18 20 21 23 23 23 26 27 28 30 32 35 35 35 35 35 35 34 34 33 33 32 32 30 30 30 29 28 26 24 22 18 14 8 5 3 0 0 -3 -7 -11 -14 -17 -19 -20 -21 -24 -26 -26 -27 -27 -28 -29 -30 -32 -32 -31 -31 -31 -31 -31 -31 -31 -32 -32 -31 -30 -29 -29 -29 -28 -27 -27 -28 -28 -30 -30 -29 -27 -26 -25 -25 -25 -25 -26 -26 -25
1️⃣产生模拟高斯白噪声信号,与干净心电混合,设计一个IIR低通滤波器和一个FIR低通滤波器分别滤除心电信号中的白噪声干扰,调整白噪声信噪比大小,对滤波前后的心电信号的频谱进行分析比较。
其中数字低通滤波器指标要求:
总体要求:
题目要求设计两个低通滤波器,一个使用FIR,一个使用IIR
wp2=0.1*pi;
ws2=0.16*pi;
wdelta=ws2-wp2;
N=ceil(8*pi/wdelta);
Wn=(0.1+0.16)*pi/2;
b2=fir1(N-1,Wn/pi);
[H2,W2]=freqz(b2,1,512);
figure;
subplot(2,1,1);
plot(W2/pi,20*log10(abs(H2)),'r','linewidth',2);
title({ '$$ FIR-LP-Frequency-Response-Curve $$' },'Interpreter','latex');
xlabel({ '$$ Frequency(\Omega/\pi) $$' },'Interpreter','latex');
ylabel({ '$$ Amplitude(dB) $$' },'Interpreter','latex');
% 通带截止频率 0.1 pi 阻带截止频率 0.16 pi
% 阻带衰减15db 通带衰减1db
close all;
Rp=0.99;Rs=16;Fs=1;Ts=1/Fs;
wpz=0.1/Fs;wsz=0.16/Fs;
wp=2*Fs*tan(wpz*pi/2);
ws=2*Fs*tan(wsz*pi/2);
[N,Wn]=buttord(wp,ws,Rp,Rs,'s');
[Z,P,K]=buttap(N);
[Bap,Aap]=zp2tf(Z,P,K);
[b,a]=lp2lp(Bap,Aap,Wn);
[bz,az]=bilinear(b,a,Fs);
[H,W]=freqz(bz,az);
%plot(W*Fs/pi,20*log10(abs(H)));
plot(W*Fs/pi,20*log10(abs(H)),'r','linewidth',2);
grid on;
title({ '$$ IIR-LP-Frequency-Response-Curve $$' },'Interpreter','latex');
xlabel({ '$$ Frequency(\Omega/\pi) $$' },'Interpreter','latex');
ylabel({ '$$ Amplitude(dB) $$' },'Interpreter','latex');