spikest.asv
来自「电能质量扰动信号」· ASV 代码 · 共 38 行
ASV
38 行
%电压尖峰(spike)的ST变换
clc;clear;
%电压尖峰spike信号
t=0:320;
w0=100*pi;
%t1=64;t2=110;%尖峰时间小于2个T
t1 = randint(1,1,[800 900])/100;
t2 = randint(1,1,[900 1100])/100;
%%%%%%%产生spike信号%%%%%%%%%
s=0; a = randint(1,1,[100 400])/1000;
for i=0:10
s=s+a*(stepfun(t,t1+i*32)-stepfun(t,t2+i*32));
end
data=sin(w0*0.000625*t)+sign(sin(w0*0.000625*t)).*s;
data1=sin(w0*0.000625*t)-sign(sin(w0*0.000625*t)).*s;
noise=awgn(data,30,'measured');%产生30dB的高斯白噪声
data_noise=data+noise;%将产生的30dB高斯白噪声迭加到spike信号中
figure;
%no noise
subplot(2,4,1);plot(t,data);title('电压尖峰 no noise')
[st_matrix,st_time,st_freq]=st(data);%st of the spike signal
subplot(2,4,2);mesh(abs(st_matrix));
subplot(2,4,3);contourf(abs(st_matrix));
subplot(2,4,4);plot(st_time,abs(st_matrix));
figure(2);contourf(abs(st_matrix));title('电压缺口等高线')
fi
subplot(2,4,5);plot(t,data1);title('电压缺口no noise')
[st_matrix,st_time,st_freq]=st(data1);%st of the notch signal
subplot(2,4,6);mesh(abs(st_matrix));
subplot(2,4,7);contourf(abs(st_matrix));
subplot(2,4,8);plot(st_time,abs(st_matrix));
figure(3);contourf(abs(st_matrix));title('电压缺口等高线')
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?