Fourier transform code issues obtaining frequency domain

11 ビュー (過去 30 日間)
Jeviah Forrest
Jeviah Forrest 2018 年 3 月 13 日
回答済み: Abhishek Ballaney 2018 年 3 月 14 日
Hello, I am currently trying to run some code to obtain the frequency domain for the vibrations of a cantilever beam using experimental data. The data has been uploaded correctly etc as I have obtained and plotted the time domain so the problem seems to be with the fourier code as I obtain no data running this code, could someone please tell me where I am going wrong? Also attached is the text file with the experimental data.
% a programme for calculating the frequency domain representation of a time domain signal
data = input ('beamwithoutmassdata'); %read the time domain data into the programme
Fs = input ('500'); %read the sample frequency
nfft = input ('2^16');
X=fft(data,nfft); % perform a fast fourier transform on the array data
X=X(1:nfft/2); % The FFT is symetrical so lose the second half
mx=abs(X); % take the absolute value of X
f=(0:nfft/2-1)*(Fs/nfft);
plot(f,mx)

回答 (1 件)

Abhishek Ballaney
Abhishek Ballaney 2018 年 3 月 14 日
https://in.mathworks.com/help/matlab/ref/fft.html

カテゴリ

Help Center および File ExchangeDiscrete Fourier and Cosine Transforms についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by