1

私は振動にかなり慣れていないため、matalb fft を使用しています。長さ 15000 の一連のデータ (1D 配列) が与えられ (これが関連しているかどうかはわかりません)、このデータに波が埋め込まれているかどうかを調べようとしています。全て。おそらくmatlab fftを使用するように指示されました。それは正しい方法ですか?私は何を見ると思いますか?得られる結果をどのように解釈すればよいか、本当にわかりません。皆様のご意見をお聞かせください。ありがとうございます。詳細が必要な場合は、提供します。例:

% Df=[array is given to me and it is of size 15000];
% t=[time used for the above array, and if it is of the same size, also provided to me]


N_0= length(t);

fs_0=length(Dfxz);

Y_0=fft(Dfxz,N_0);

k_0=-N_0/2:N_0/2-1;

%Find the phase angle
p_0 = (angle(Y_0));
R_0 = norm(Y_0);

ff_0 = (0:length(Y_0)-1)'/length(Y_0)*100;    % Frequency vector
FT_power1_0 = abs(Y_0);

plot(k_0*fs_0/N_0,fftshift(abs(Y_0)))

周波数 = 0 でピークが 1 つしか表示されませんが、ゼロ以外の周波数があることは確かです。何が間違っていますか? ありがとう!PS:サンプリング周波数の選択方法もわかりませんか? ヒントをお願いします(元の周波数がわからないことに注意してください)

4

1 に答える 1

4

私のバージョンを試してください。データ内の周波数ピークが存在する場合、それらを見つけるために必要なすべての情報を持っているように見えます。あなたが見ることができるのがゼロ周波数での大きなピークだけであるならば、あなたはおそらくあなたの他のすべてのデータを溺れさせている巨大なDCオフセットを持っています。私は自分のコードに救済策を入れました。。

x = randn(15000,1); %//This is the data you were given - I'll use noise for demonstration - replace x with your Df data

%//If youre getting a massive peak at zero that dwarfs everything else, you
%//probably have a large DC offset. Easily removed in the time domain using
%//the following ..
x = x-mean(x);

tAxis = linspace(3/15000,3,15000); %//You said you have this too - I'll make up something for demonstration - make sure you replace this with your t data
dt = diff(tAxis(1:2)); %//sample period from time axis
fs = 1/dt;%//sample rate from sample period

NFFT = numel(x); %//number of fft bins - change if you like
Y = abs(fft(x, NFFT)).^2; %power spectrum

%//Calculate frequency axis
df = fs/NFFT;
fAxis = 0:df:(fs-df);

%//Plot it all
figure; plot(fAxis(1:NFFT/2), Y(1:NFFT/2))
xlabel('Frequency in Hz')
ylabel('Power')

それで問題が解決した場合は、stackoverflowで別のFFTの回答を確認することで、さらに深く掘り下げることができます。

于 2012-10-18T22:12:28.630 に答える