大家好!
我是新手,积分几乎没有,等赚足了积分再多多悬赏。希望大家能给予指导和帮助,谢谢。
如题,我已有频率和加速度功率谱密度的数据,
共有43个离散数据,最高和最低的截止频率(fmax)已知。请问采样频率(fs)是否可以通过>=fmax设置,以及通过采样频率可以确定时间间隔。最后通过傅里叶逆变换是否得到的是时域和加速度的关系?程序如下:
close all
clear,clc
fs=6000; %采样频率fs(frequency of sampling>2fmax)
deltt=1/fs; %采样时间间隔
fmin=15; %采样频率下限
fmax=2000; %采样频率上限
data=load(‘data.txt');
w=data(:,1);
s=data(:,2);
n=length(s); %已给数据数量
t=(0:1/fs:(n-1)/fs)';
deltf=fs/n; %采样间距
nfft=2^nextpow2(n); %采样数量
ni=round(fmin*nfft/fs+1);
na=round(fmax*nfft/fs+1);
a=zeros(1,nfft);
a(ni:na)=s(ni:na);
xifft=ifft(a,nfft);
y=(real(xifft(1:n)))';
u=(abs(xifft(1:n)))';
for j=1:n
t(j)=(j-1)*deltt;
end
subplot(2,1,1)
plot(t,y)
% plot (t, u)
xlabel('时间(t)');
ylabel('加速度(N/g)');
grid on
友情提示: 此问题已得到解决,问题已经关闭,关闭后问题禁止继续编辑,回答。
一周热门 更多>