Fourier Transform - position to velocity derivative
이전 댓글 표시
Hi everybody,
I am trying to do position to velocity differentiation of discrete points along X-axis and carry out the frequency response of the signal by FFT.
Can someone please help me understand how to take the frequency axis in final plot?.. Can we do this by using ODE45 or by writing a function??.. Thank you
x=9000; % the number of data points along a-axis(position based)
t = 0:0.0015:300; %(0.0015 = sampling cycle in seconds)
dx = diff(x);
dt = diff(t);
dxdt = dx./dt;
fft_dxdt = fft(dxdt); % DFT
fft_dxdt_magnitude = abs(fft_dxdt);
figure()
plot(fft_dxdt_magnitude)
채택된 답변
추가 답변 (1개)
Sunny Math
2016년 1월 12일
0 개 추천
댓글 수: 6
Mona Mahboob Kanafi
2016년 1월 12일
Hello, I have updated my answer. Hope it helps you.
Sunny Math
2016년 1월 13일
Mona Mahboob Kanafi
2016년 1월 13일
Using diff function for your problem is correct and common. As you mentioned, ODE is for ordinary differential EQUATIONs and your problem is just a simple differentiation. Since in matlab there is no direct differentiation, using diff is the option here.
Sunny Math
2016년 1월 13일
Mona Mahboob Kanafi
2016년 1월 14일
Hello,
I couldn't download your code, but your velocity PSD looks quite normal. I think what you want to see is in logarithmic scale which you must use:
loglog(f,FFT_V_x_magnitude)
This must solve the problem, but if you still can't get what you want, you must start applying window function (bartlett, tukey,Welch,...) to your signal before applying fft like this, since your signal is not periodic for fft:
V_x = V_x .* bartlett(length(V_x))';
Also, I assumed that you know what that high peak in zero frequency means. It is just related to the mean value of your signal and you can remove signal mean value to be zero before applying fft, or otherwise you can just ignore that high peak. Hope these help you.
Sunny Math
2016년 1월 15일
카테고리
도움말 센터 및 File Exchange에서 Bartlett에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!