|
回复 #3 qijunshuai 的帖子
本帖最后由 wdhd 于 2016-7-6 10:02 编辑
能把图传上来分享一下吗?你说的瀑布图是三维谱阵吗?
我前一段用waterfall编了一个三维谱阵图,发上来大家分享一下
% waterfall program
clc;
clf;
clear;
close all;
[filename path]=uigetfile('*.txt','please input you want to get file','file name');
hectorload=[path filename];
x=load(hectorload);
[m,n]=size(x);
a=x(:,1);
b=x(:,2);
m;
k=fix(m/1024);
fs=10000;
x2=b;
t=1/fs:1/fs:(m)/fs;
t=t';
fid=fopen(hectorload,'r');
m1=fscanf(fid,'%d',1);
s2=x2;
a1=polyfit(t,s2,m1);
s2=s2-polyval(a1,t);
b=s2;
%%%%%%%%%%%%%%
n1=k;
k1=50;
ii1=1;
%%%%%%%%%%%%%%%%%%%
nn=80;
n2=fix(n1/k1);
nn2=n1-ii1;
for i=ii1:1:n1;
l1=1024*(i-1);
l2=1024*i;
j=1;
if l1==0;
l1=1;
l2=1025;
end
t=l1:1:l2;
Y=fft(b(t),1024)/1024;
Pyy=sqrt(2*Y.*conj(Y));
f=fs*(0:511)/1024;
z=Pyy;
Z(:,i)=z(1:nn);
end
Z=Z';
T=Z;
T1=T;
T1(:,1)=0;
for i=1:n2;
T2(i,:)=T1(k1*i,:);
end
n=2*n2-1;
f=1:0.0001:nn*0.00001;
t=1:2:n;
figure(1)
waterfall(f,t,T2);
[ 本帖最后由 hector1982 于 2007-7-18 10:34 编辑 ] |
评分
-
1
查看全部评分
-
|