Velocity spectra for Time and Velocity data with FFT
조회 수: 6 (최근 30일)
이전 댓글 표시
Hello I have an evenly spaced time series data as attached. I want to find velocity spectra (as the below figure) from it.
How to start?
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/156272/image.jpeg)
댓글 수: 1
Fei Deng
2016년 9월 19일
Hi Sayeed, you can get velocity spectrum via fft analyses by doing following:
Fs = 1000; % Sampling frequency
T = 1/Fs; % Sampling period
L = 1000; % Length of signal
t = (0:L-1)*T; % Time vector
S = 0.7*sin(2*pi*50*t) + sin(2*pi*120*t); % Signal
Y = fft(S);
P2 = abs(Y/L);
P1 = P2(1:L/2+1);
P1(2:end-1) = 2*P1(2:end-1);
f = Fs*(0:(L/2))/L;
plot(f,P1)
P1 is the spectrum that you need.
Refer the link for more details: http://www.mathworks.com/help/matlab/ref/fft.html?searchHighlight=fft
답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Fourier Analysis and Filtering에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!