Fourier transform, Position to Jerk differentiation
3 次查看(过去 30 天)
显示 更早的评论
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.
0 个评论
采纳的回答
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
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.
更多回答(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!