Fourier transform, Position to Jerk differentiation

조회 수: 5 (최근 30일)
Sunny Math
Sunny Math 2016년 2월 21일
편집: Sunny Math 2016년 2월 22일
Hello.. I am learning how to use fft in Matlab. I have X and Y axis values(Position) w.r.t time. I have carried out successively differentiated to velocity and acceleration. I want to find jerk from acceleration. Then I have carried out the Fourier transform by FFFshift Which I found from the article. I have some questions:
1. Why should use FFTshift as the values(position based) are not periodic in nature?. Also the frequency axis should start from 0 to total length.
2. What would be the procedure to carry out fft if I don't opt to use fftshift?
3. What is the dt3 to differentiate from position to jerk? I know dt and dt2.
4. Please check frequency axis for velocity, acceleration and jerk? correct it if its wrong.
Please look at the following code:
>> T = 0.0017; %Sampling Rate in secs
>> t = (0 : 0.0017 : 19.992-T)'; %total time for 9500 samples
>> fs = 1/T; %Samples per second
>> X = (9500x1 double); %Position values along X-axis
>> N = length (t); %length of the samples
>> TotalTime = T * N;
>> df = fs/N; %frequency increment
>> f = (-fs/2: df: fs/2-2*df)'; %frequency axis
>> dX = diff(X); %derivative of samples
>> dt = diff(t); %derivative of time
>> v_x = diff(X)./diff(t); %Velocity
>> fft_v_X = fftshift(v_X); %Fourier Transform
>> FFT_V_x_magnitude = abs(fft_v_x); %absolute values
>> plot(f,FFT_V_x_magnitude)
>> dt2 = (dt(1:end-1)+dt(2:end))/2; %second derivative of time
>> A_x = diff(v_x)./dt2; %Acceleration
>> fft_A_x = fftshift(A_x); % Fourier Transform
>> fft_A_x_magnitude = abs(fft(A_x)); %Absolute Values
>> fa = (-fs/2: df: fs/2-3*df)'; %frequency axis for acceleration
>> plot(fa,fft_A_x_magnitude)
Thank you for help.

채택된 답변

Rick Rosson
Rick Rosson 2016년 2월 21일
fftshift does not compute the Fourier Transform. You need to use the fft function in conjunction with fftshift, as:
V = fftshift(fft(v));
  댓글 수: 5
Rick Rosson
Rick Rosson 2016년 2월 22일
편집: Rick Rosson 2016년 2월 22일
There is no such thing as dt2 or dt3. Just use dt for all derivatives. And there is no need to compute the vector of dt, it is simply a constant:
dt = T = 1/fs
Velocity is not the derivative of position divided by the derivative of time. It is instead the derivative of position with respect to time. It makes no sense to talk about the derivative of one variable without specifying with respect to which variable it is taken. Remember:
v = dx/dt
which is not the same thing as
x' / t'
which is meaningless.
Sunny Math
Sunny Math 2016년 2월 22일
편집: Sunny Math 2016년 2월 22일
If I want to find derivative of position based on some values along X axis and sampling time 0.15sec, how to find derivative in terms of velocity ,acceleration?...
v = dx./dt; (is this the correct one?)
or
how to carry out differentiation with Respect to Particular Variable time t?

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

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