1 主要内容
该程序参考《基于混沌集成决策树的电能质量复合扰动识别》,主要做的是S变换电能质量扰动识别,通过S变换对电能质量扰动(谐波,闪变,暂升等单一扰动和复合扰动)进行变换得到时频图,并对其进行特征提取。
2 部分代码
%% 电能质量扰动函数 V1=sin(w*x)+a_3*sin(3*w*x+b_3)+a_5*sin(5*w*x+b_5)+a_7*sin(7*w*x+b_7); % plot(t,V1); title('1:谐波'); 谐波 V2=(1-a2.*(stepfun(x,0.08)-stepfun(x,0.16))).*sin(w*x); % plot(t,V2) 电压暂降 0.1-0.9 V3=(1+a2.*(stepfun(x,0.08)-stepfun(x,0.16))).*sin(w*x); % 电压暂升 V4=(1-a4.*(stepfun(x,0.08)-stepfun(x,0.16))).*sin(w*x); % plot(t,V4) %0.9-1 电压中断 V5=(1+a_f*sin(b*w*x)).*sin(w*x); %subplot(2,1,2); plot(t,V5); title('5:闪变'); V6=sin(w*x)+a6*exp(-(x-0.02)/tao).*sin(Wn*w*x).*(stepfun(x,0.02)-stepfun(x,0.03)); %plot(t,V6) 暂态振荡 V7=sin(w*x)+a7*exp(-(x-0.02)/tao).*(stepfun(x,0.02)-stepfun(x,0.06)); %plot(t,V7) 暂态脉冲 V8=(1-a2.*(stepfun(x,0.18)-stepfun(x,0.26))).*sin(w*x)+a_3*sin(3*w*x+b_3)+a_5*sin(5*w*x+b_5)+a_7*sin(7*w*x+b_7); %电压暂降+谐波 V9=(1+a2.*(stepfun(x,0.18)-stepfun(x,0.26))).*sin(w*x)+a_3*sin(3*w*x+b_3)+a_5*sin(5*w*x+b_5)+a_7*sin(7*w*x+b_7); %电压暂升+谐波 V10=(1-a4.*(stepfun(x,0.08)-stepfun(x,0.16))).*sin(w*x)+a_3*sin(3*w*x+b_3)+a_5*sin(5*w*x+b_5)+a_7*sin(7*w*x+b_7); %电压中断+谐波 V11=(1+a_f*sin(b*w*x)).*sin(w*x)+a_3*sin(3*w*x+b_3)+a_5*sin(5*w*x+b_5)+a_7*sin(7*w*x+b_7); %电压闪变+谐波 V12=(1-a2.*(stepfun(x,0.08)-stepfun(x,0.16))).*sin(w*x)+a6*exp(-(x-0.02)/tao).*sin(Wn*w*x).*(stepfun(x,0.02)-stepfun(x,0.03)); %电压暂降+暂态振荡 V13=(1+a2.*(stepfun(x,0.08)-stepfun(x,0.16))).*sin(w*x)+a6*exp(-(x-0.02)/tao).*sin(Wn*w*x).*(stepfun(x,0.02)-stepfun(x,0.03)); %电压暂升+暂态振荡 V14=(1+a_f*sin(b*w*x)).*sin(w*x)+a6*exp(-(x-0.02)/tao).*sin(Wn*w*x).*(stepfun(x,0.02)-stepfun(x,0.03)); %电压闪变+暂态振荡 V15=sin(w*x)+a_3*sin(3*w*x+b_3)+a_5*sin(5*w*x+b_5)+a_7*sin(7*w*x+b_7)+a6*exp(-(x-0.02)/tao).*sin(Wn*w*x).*(stepfun(x,0.02)-stepfun(x,0.03)); %谐波+暂态振荡 V16=(1-a2.*(stepfun(x,0.08)-stepfun(x,0.16))).*sin(w*x)+a7*exp(-(x-0.02)/tao).*(stepfun(x,0.02)-stepfun(x,0.06)); %电压暂降+暂态脉冲 V17=(1+a2.*(stepfun(x,0.08)-stepfun(x,0.16))).*sin(w*x)+a7*exp(-(x-0.02)/tao).*(stepfun(x,0.02)-stepfun(x,0.06)); %电压暂升+暂态脉冲 V18=(1+a_f*sin(b*w*x)).*sin(w*x)+a7*exp(-(x-0.02)/tao).*(stepfun(x,0.02)-stepfun(x,0.06)); %闪变+暂态脉冲 V19=sin(w*x)+a_3*sin(3*w*x+b_3)+a_5*sin(5*w*x+b_5)+a_7*sin(7*w*x+b_7)+a7*exp(-(x-0.02)/tao).*(stepfun(x,0.02)-stepfun(x,0.06)); %谐波+暂态脉冲 V20=(1-a2.*(stepfun(x,0.08)-stepfun(x,0.16))).*sin(w*x)+a_3*sin(3*w*x+b_3)+a_5*sin(5*w*x+b_5)+a_7*sin(7*w*x+b_7)+a6*exp(-(x-0.02)/tao).*sin(Wn*w*x).*(stepfun(x,0.02)-stepfun(x,0.03)); %暂降+谐波+暂态振荡 V21=(1+a2.*(stepfun(x,0.08)-stepfun(x,0.16))).*sin(w*x)+a_3*sin(3*w*x+b_3)+a_5*sin(5*w*x+b_5)+a_7*sin(7*w*x+b_7)+a6*exp(-(x-0.02)/tao).*sin(Wn*w*x).*(stepfun(x,0.02)-stepfun(x,0.03)); %暂升+谐波+暂态振荡 V22=(1+a_f*sin(b*w*x)).*sin(w*x)+a_3*sin(3*w*x+b_3)+a_5*sin(5*w*x+b_5)+a_7*sin(7*w*x+b_7)+a7*exp(-(x-0.02)/tao).*(stepfun(x,0.02)-stepfun(x,0.06)); %闪变+谐波+暂态脉冲 V23=(1-a2.*(stepfun(x,0.08)-stepfun(x,0.16))).*sin(w*x)+a_3*sin(3*w*x+b_3)+a_5*sin(5*w*x+b_5)+a_7*sin(7*w*x+b_7)+a6*exp(-(x-0.02)/tao).*sin(Wn*w*x).*(stepfun(x,0.02)-stepfun(x,0.03))+a7*exp(-(x-0.02)/tao).*(stepfun(x,0.02)-stepfun(x,0.06)); %暂降+谐波+暂态振荡+暂态脉冲 %plot(x,V20) %% V1 谐波 S变换 做时频图
3 程序结果