您好,欢迎访问三七文档
智能传感器系统作业一:设计一个数字高通滤波器:要求:(1)在500Hz处,滤波器增益大于0.9,200Hz处,滤波器增益小于0.01;(2)滤波器具有线性相位;(3)设计过程中,给出详细步骤,作业中给出详细程序代码,滤波器系数不可通过调用各种软件开发平台的工具箱函数获得;(4)给出滤波器的幅频特性和相频特性,并计算出600Hz处的滞后相位;(5)采样频率自行设定。作业二给定一组二传感器系统标定数据:0Mp1Mp2Mp3Mp4Mp5Mp21.5℃Tout(mV)14.22814.22614.22414.22214.22014.218Pout(mV)-13.8410.6928.8847.0565.1983.3628.0℃Tout(mV)14.23414.23314.23114.22914.22514.221Pout(mV)-13.499.3226.3443.1259.9976.8234.0℃Tout(mV)14.23614.23514.23414.23114.22914.223Pout(mV)-10.87.5424.8442.0559.2576.3844.0℃Tout(mV)14.25214.24914.24714.24514.24114.239Pout(mV)-9.726.5623.8741.2158.5875.8750.5℃Tout(mV)14.26614.26314.26114.25914.25514.251Pout(mV)-8.624.8621.8438.756.3273.7570.0℃Tout(mV)14.28814.28514.28114.27914.27514.271Pout(mV)-7.723.7221.2538.655.5673.28表中Tout表示温度传感器输出,Pout表示压阻式压力传感器输出。试用多项式的最小二乘法逼近算法,降低温度对压力的检测的影响(计算出融合前由于温度的影响,压阻式压力传感器最大检测误差,以及融合后该传感器的最大检测误差)。作业三给定一个多传感器系统标定数据(可用作业二数据),用BP神经网络进行函数逼近,以降低传感器之间的交叉敏感度。网络的训练在Matlab中实现,但需要用C语言编写程序,实现BP网络的移植(即实现Matlab中sim函数的功能)。作业四产生一个含噪声的信号序列(可以是正弦波信号加白噪声,如在Matlab平台下生成该信号,可编写代码:t=0:0.01:10;s=sin(2*pi*t);noise=rand(1,length(t));ss=s+noise;ss即为含噪声),用小波分析对其进行消噪。注意:不能直接用Matlab中的wden/wdencmp等函数,只能调用orthfilt等函数获取滤波器系数,然后进行2抽取的卷积分解、阈值处理、卷积重构,然后得到消噪后的信号。作业一:采样频率选取为2000Hz,截止频率选取为(500+200)/2=350。窗函数选用海明窗,设置初始N=11,对函数加窗计算,校验500Hz和200Hz的增益,增加滤波器的阶数,直至符合要求,以下为MATLAB程序。f1=500;f2=200;Fs=2000;fp=(f1+f2)/2;wc=2*pi*(fp/Fs);n=11;d3=0;d4=0;while((d30.9)||(d40.01))n=n+2;HD=zeros(1,n);C=zeros(1,n);XISHU=zeros(1,n);form=0:(n-1)DD(1,m+1)=(sin(pi*(m-(n-1)/2))-(sin((m-(n-1)/2)*wc)))/(pi*(m-(n-1)/2));C(1,m+1)=0.54-0.46*cos(2*m*pi/(n-1));endDD(1,(n+1)/2)=1-wc/pi;XISHU2=DD.*C;w1=2*pi*f1/Fs;w2=2*pi*f2/Fs;%w=0.1*pi;FI=0;form=0:(n-1)FI=XISHU2(1,m+1)*(exp(i*-1*m*w1))+FI;endd3=abs(FI);FI=0+i*0;form=0:(n-1)FI=XISHU2(1,m+1)*(exp(i*-1*m*w2))+FI;endd4=abs(FI);endfreqz(XISHU2,1);以下为幅频曲线和相频曲线:满足线性要求。500Hz和200Hz的增益如下,满足指标。600Hz的相位移为滞后234度:滤波器的系数为(N=23):{0.0011,0.0031,0.0024,-0.0055,-0.01567,-0.0077,0.0272,0.0553,0.0139,-0.1193,-0.2783,0.6500,-0.2783,-0.1193,0.0139,0.0553,0.0272,-0.0077,-0.0156,-0.0055,0.0024,0.0031,0.0010}作业二:构造多项式拟合式子:P=0+1*UP+2*UT+3*UP*UP+4*UP*UT+*UT*UT;根据最小二乘法式子:=PH’inv(H*H’);程序如下:P=[0,0,0,0,0,0,1,1,1,1,1,1,2,2,2,2,2,2,3,3,3,3,3,3,4,4,4,4,4,4,5,5,5,5,5,5];h00=[1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1];h11=[-13.84,-13.49,-10.8,-9.72,-8.62,-7.72,10.69,9.32,7.54,6.56,4.86,3.72,28.88,26.34,24.84,23.87,21.84,21.25,47.05,43.12,42.05,41.21,38.7,38.6,65.19,59.99,59.25,58.58,56.32,55.56,83.36,76.82,76.38,75.87,73.75,73.28];h22=[14.228,14.234,14.236,14.252,14.266,14.288,14.226,14.233,14.235,14.249,14.263,14.285,14.224,14.231,14.234,14.247,14.261,14.281,14.222,14.229,14.231,14.245,14.259,14.279,14.220,14.255,14.229,14.241,14.255,14.275,14.218,14.221,14.223,14.239,14.251,14.271];h33=h11.^2;h44=h11.*h22;h55=h22.^2;h00=h00';h11=h11';h22=h22';h33=h33';h44=h44';h55=h55';P=P';H=[h00,h11,h22,h33,h44,h55];%36*6此处H为H的转置B=H'*H;C=inv(B);%6*6D=(P')*H%%1*6AI=C*(D');JS=AI(1,1)*h00+AI(2,1)*h11+AI(3,1)*h22+AI(4,1)*h33+AI(5,1)*h44+AI(6,1)*h55;i=1;forn=1:6form=1:6PC(n,m)=JS(i,1)-(n-1);i=i+1;endendAI为拟合的系数矩阵:JS为拟合计算的输出值:-0.176033249979810-0.1347423159131720.01649071958672720.1062740197012320.1609294732552370.1366112561081541.130630166855551.100662350796481.013532836292141.014998952079620.9387055611223330.8338669181830482.115167682655742.033420677962571.971691802151331.994947394530751.927007581485671.902902417234153.113703091356002.965194228141632.923423120435472.989948951490082.920765972703522.967604469511574.125595012646954.182910854200603.894944080857393.981546177088603.959833860044464.014806351457085.154273717049364.816260406711084.819460361326494.996051837457344.991916198301625.11386321731334以下为绝对误差,第一行为输出0MP时不同温度下的绝对误差,第二行为输出1MP时不同温度下的绝对误差;进行温度系数计算,融合前的零位温度系数:01=((-7.72)-(-13.84))/83.36/48.5=0.0015融合后的零位温度系数:02=((-0.1760)+(-0.1347)+(0.0164)+(0.1062)+(0.1609)+(0.1366))/6/50/48.5=0.0000075融合前的灵敏度温度系数:s1=(83.36-73.28)/83.36/48.5=0.00249融合后的灵敏度温度系数:s2=(0.1543-(-0.1837))/5.0/48.5=0.00139在融合前的最大偏差:用21.5度的静态特性得到拟合方程,P(U)=0.57214+0.052262U,可得最大拟合偏差为0.151在融合后的最大偏差:对各温度下误差取均值,最大误差为0.0265对比零位温度系数、灵敏度温度系数、最大误差,可以得出传感器的温度稳定性得到一定程度的改善。作业三:输入样本进行训练,设置第一层神经数为3个,第二层神经数为1,输入为2个,输出为一个。设置最大训练次数为1000,训练目标最小均方误差为0.001。输出输入到第一层的权值:输出第一层的阈值:输出输入到第一层的权值:输出第二层的阈值:误差为:closeallclearechoonclcP0=[0,0,0,0,0,0,1,1,1,1,1,1,2,2,2,2,2,2,3,3,3,3,3,3,4,4,4,4,4,4,5,5,5,5,5,5];P=P0';h11=[-13.84,-13.49,-10.8,-9.72,-8.62,-7.72,10.69,9.32,7.54,6.56,4.86,3.72,28.88,26.34,24.84,23.87,21.84,21.25,47.05,43.12,42.05,41.21,38.7,38.6,65.19,59.99,59.25,58.58,56.32,55.56,83.36,76.82,76.38,75.87,73.75,73.28];h22=[14.228,14.234,14.236,14.252,14.266,14.288,14.226,14.233,14.235,14.249,14.263,14.285,14.224,14.231,14.234,14.247,14.261,14.281,14.222,14.229,14.231,14.245,14.259,14.279,14.220,14.255,14.229,14.241,14.255,14.275,14.218,14.221,14.223,14.239,14.251,14.271];h1=h11';h2=h22';H1=[h1,h2];H=H1';net=newff(minmax(H),[3,1],{'tansig','purelin'},'trainlm');net.trainParam.show=50;%训练显示间隔net.trainParam.lr=0.05;%学习步长net.trainParam.mc=0.9;%动量项系数net.
本文标题:智能传感器[参考】
链接地址:https://www.777doc.com/doc-7423060 .html