1个回答
2019-10-31
展开全部
高通
%parameter
fs=16384;%sampling frequency
N1=fs; %counts of time signal
NFFT=fs; %counts in frequency domain
deltaQ=1/fs; %samping interval
n1=0:NFFT-1; %
tscale=deltaQ*n1;% time series
deltaf=fs/NFFT; %frequency interval
fscale=deltaf*n1;%frequency series
%high pass filter
fp=2000;
wp=fp*2*pi/fs;
n=6;
[b,a]=butter(n,wp/pi,'high');
pathstr1='C:\Users\Administrator\Desktop\U1\ch2.'
for i=1:57
extentname=['0',num2str(i)];
if i<10 extentname=['0',extentname];end
x1=[pathstr1,extentname];
[fid,message]=fopen(x1,'r');
xtime(:,i)=fread(fid,'float32');
[Psd(:,i),F1]=pwelch(xtime(1:NFFT,i),[],[],NFFT,fs);
fclose(fid);
clear fid;
xspectrum(:,i)=abs(fft(xtime(1:NFFT,i)))/NFFT;
Pceps(:,i)=abs(ifft(log(xspectrum(:,i).^2)));
end
figure;
n=1:57;f=1:1:NFFT/4;
[n1,f1]=meshgrid(n,f);
mesh(f1,n1,Psd(f,n));
xlim([0 NFFT/4]);
view([1.5,38]);
xlabel('ƵÂÊ/Hz');zlabel('¹¦ÂÊÆ×ÃܶÈ')
%parameter
fs=16384;%sampling frequency
N1=fs; %counts of time signal
NFFT=fs; %counts in frequency domain
deltaQ=1/fs; %samping interval
n1=0:NFFT-1; %
tscale=deltaQ*n1;% time series
deltaf=fs/NFFT; %frequency interval
fscale=deltaf*n1;%frequency series
%high pass filter
fp=2000;
wp=fp*2*pi/fs;
n=6;
[b,a]=butter(n,wp/pi,'high');
pathstr1='C:\Users\Administrator\Desktop\U1\ch2.'
for i=1:57
extentname=['0',num2str(i)];
if i<10 extentname=['0',extentname];end
x1=[pathstr1,extentname];
[fid,message]=fopen(x1,'r');
xtime(:,i)=fread(fid,'float32');
[Psd(:,i),F1]=pwelch(xtime(1:NFFT,i),[],[],NFFT,fs);
fclose(fid);
clear fid;
xspectrum(:,i)=abs(fft(xtime(1:NFFT,i)))/NFFT;
Pceps(:,i)=abs(ifft(log(xspectrum(:,i).^2)));
end
figure;
n=1:57;f=1:1:NFFT/4;
[n1,f1]=meshgrid(n,f);
mesh(f1,n1,Psd(f,n));
xlim([0 NFFT/4]);
view([1.5,38]);
xlabel('ƵÂÊ/Hz');zlabel('¹¦ÂÊÆ×ÃܶÈ')
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询