Fourier transform code issues obtaining frequency domain

조회 수: 7 (최근 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 CenterFile Exchange에서 Discrete 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