⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 huodeshuju.m

📁 产生电压扰动数据
💻 M
字号:
%数据抽取
for i=1:1:1000
dianyazanjiang(i)=x(40*i)
end
sig=dianyazanjiang(201:length(dianyazanjiang));
plot(sig);
fs=100
f=sig;
fc=f(1:length(sig)-100)
fb=f(1+fs/3:length(sig)+fs/3-100)
fa=f(1+2*fs/3:length(sig)+2*fs/3-100);
subplot(3,1,1);
plot(fa);
grid on;
title('原始信号');
subplot(3,1,2);
hold on;
%plot(fb);
grid on;
%title('b相');
hold on;
%subplot(3,1,3);
%plot(fc);
grid on;
%title('c相');
xlabel 't/s';
ylabel 'U/kV';
hold on;
N=length(fa)
%构造ab分量
C32=(2/3)^0.5*[1 -1/2 -1/2;0 3^0.5/2 -3^0.5/2];
A=[fa;fb;fc];
X=C32*A;

%gouzaodq分量
for n=1:1:N
t(n)=0.020/100*n
end
for n=1:1:N
ua(n)=X(1,n);
ub(n)=X(2,n);
  B=[sin(2*pi*50*t(n)) -cos(2*pi*50*t(n));-cos(2*pi*50*t(n)) -sin(2*pi*50*t(n))];
  C=[ua(n);ub(n)]
  X1=B*C;
    ud(n)=X1(1,1);
    uq(n)=X1(2,1);
    U2(n)=ud(n)^2+uq(n)^2;
end;
%quzao1
M=60;
lg=2;
input=ud;
ud1=quzao1(ud,60,2,64,2);
uq1=quzao1(uq,60,2,64,2);
t1=t(1:length(ud1));
%hold off;
%plot(t1,ud1,'r');
N=length(ud1);
ud2=quzao1(ud1,60,2,64,2);
uq2=quzao1(uq1,60,2,64,2);
%hold off;
%plot(t2,uq2,'r');
%dq分量fanbianhuan
N=length(ud2);

for n=1:1:N
  B=[sin(2*pi*50*t(n)) -cos(2*pi*50*t(n));-cos(2*pi*50*t(n)) -sin(2*pi*50*t(n))];
  Bn=inv(B);
  X2=Bn*[ud2(n);uq2(n)];
    ua1(n)=X2(1,1);
    ub1(n)=X2(2,1);
end;
%a bfanbianhaun
for n=1:1:N
 D=[ua1(n);ub1(n)];
 C23=(2/3)^0.5*[1 0;-1/2 3^0.5/2;-1/2 -3^0.5/2];
   X3=C23*D;
   faj(n)=X3(1,1);
   fbj(n)=X3(2,1);
   fcj(n)=X3(3,1);
end;
%hold off;
subplot(3,1,2);
plot(faj);
grid on;
title('基波分量');
grid on;
hold on;
%subplot(3,1,2);
%plot(t,fbj,'r');
hold on;
%subplot(3,1,3);
%plot(t,fcj,'k');
hold on;
xieboa=fa-faj;
xiebob=fb-fbj;
xieboc=fc-fcj;
subplot(3,1,3);
plot(xieboa);
title('谐波分量');
grid on;
hold on;
%subplot(3,1,2);
%plot(t,xiebob,'r');
hold on;
%subplot(3,1,3);
%plot(t,xieboc,'k');
hold on;
%%%%%%%%%%%%%%%%%%%%
%信号频率归一化和hilbert变换
sig=xieboa'
sig=(sig-mean(sig))/std(sig,1);
sig=hilbert(sig);
%平滑伪分布
%g=window(@gausswin,M/10+1)
%h=window(@gausswin,M/4+1)
%[tfr,t,f]=tfrspwv(sig,1:M,M,g,h);
M=length(xieboa)
t=1:M;
f=0:0.5/M:0.5-0.5/M;
[tfr,rtfr,hat]=tfrrspwv(sig,1:M,M);
%[tfr,t,f]=tfrspwv(sig,1:M,M);
figure(2)
subplot(211)
contour(t,f,abs(tfr));
title '平滑伪wigner分布'
xlabel 'n'
ylabel 'f'
%mesh(t,f,abs(tfr))
%figure(3)
subplot(212)
contour(t,f,abs(rtfr));
title '重排平滑伪wigner分布'
xlabel 'n'
ylabel 'f'

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -