📄 pd_simulate.m
字号:
Atten_Coef = 1.8e-6;
fs = 10e6;
fc = 1e6;
i = 1/fs:1/fs:2048/fs;
s = exp(-i/Atten_Coef);
s1 = SignalDelay(s,300,2.0);
s = exp(-1.3*i/Atten_Coef) - exp(-2.2*i/Atten_Coef);
s2 = SignalDelay(s,600,12.0);
s = exp(-i/Atten_Coef).*sin(2*pi*fc*i);
s3 = SignalDelay(s,1000,4.0);
s = (exp(-1.3*i/Atten_Coef) - exp(-2.2*i/Atten_Coef)).*sin(2*pi*fc*i);
s4 = SignalDelay(s,1600,6.0);
DSIS = sin(2*pi*50e3*i) + sin(2*pi*100e3*i) + sin(2*pi*200e3*i) + sin(2*pi*800e3*i) ;
% DSIS = sin(2*pi*50e3*i) + sin(2*pi*400e3*i);
figure(1)
subplot(311)
PDS = s1 + s2 + s3 + s4;
plot(1e3/fs:1e3/fs:2048e3/fs,PDS);
xlabel('time (ms)');
ylabel('voltage(mv)');
title('Partial Discharge Simulate Signal');
axis([0 0.21 -6 6]);
subplot(312)
plot(1e3/fs:1e3/fs:2048e3/fs,DSIS);
xlabel('time (ms)');
ylabel('voltage(mv)');
title('Discrete Spectrum Interference Signal');
axis([0 0.21 -6 6]);
subplot(313)
s = PDS + DSIS;
plot(1e3/fs:1e3/fs:2048e3/fs,s);
xlabel('time (ms)');
ylabel('voltage(mv)');
title('PDS And DSI Commix Signal');
axis([0 0.21 -6 6]);
f_DSIS = fft(DSIS,2048);
f_PDS = fft(PDS,2048);
f_s = fft(s,2048);
f = 10*(0:1024)/2048;
figure(2)
subplot(311)
p_f_PDS = f_PDS.* conj(f_PDS) / 2048;
plot(f,p_f_PDS(1:1025));
xlabel('f (MHz)');
ylabel('H(w)');
title('Partial Discharge Signal Frequence Spectrum');
subplot(312)
p_f_DSIS = f_DSIS.* conj(f_DSIS) / 2048;
plot(f,p_f_DSIS(1:1025));
xlabel('f (MHz)');
ylabel('H(w)');
title('Discrete Spectrum Interference Signal Frequence Spectrum');
subplot(313)
p_f_s= f_s.* conj(f_s) / 2048;
plot(p_f_s);
% 10*log10(PDS*PDS'/(DSIS*DSIS'))
for i= 1:length(f_s)
if (power(abs(f_s(i)),2.0)/2048)>3
% f_s(i)
f_s(i) = 0;
end
end
figure(3)
subplot(211)
plot(DSIS)
subplot(212)
i_f = ifft(f_s,2048);
plot(i_f);
10*log10((PDS*PDS')/((i_f-PDS)*(i_f-PDS)'))
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -