tjakeman
Mechanical
- Oct 21, 2009
- 29
Hello,
I'm sure this topic has been covered before, but I'm still struggling with it.
The Story:
I have signal data from an accelerometer mounted to a car - one lap around a track. After filtering this data (high pass 13Hz) to remove ridgid body motion, I used it to drive a shaker rig with a component attached. An accelerometer on the conpoent was used to measure the response acceleration.
In order to convert to displacement (which I gather isn't an ideal process) I FFT the response, divide by the samping frequency squared then inverse FFT...?
My displacements are tiny, not really sure why. This is my m-file:
Fs = 512; % Sampling frequency
T = 1/Fs; % Sample time
L = 53760; % Length of signal(no. of data lines)
t = (0:L-1)*T; % Time vector
a = load('TrackReplay Z-axis.txt');
x = a
,2);
y = a
,3);
z = a
,4);
x = x-mean(x*9.81);
x = detrend(x, 'linear');
y = y-mean(y*9.81);
y = detrend(y, 'linear');
z = z-mean(z*9.81);
z = detrend(z, 'linear');
X = fft(x,L)/L; % FFT of x
Y = fft(y,L)/L;
Z = fft(z,L)/L;
Xd = X/(2*pi*Fs)^2;
Yd = Y/(2*pi*Fs)^2;
Zd = Z/(2*pi*Fs)^2;
dx = ifft(Xd);
dy = ifft(Yd);
dz = ifft(Zd);
figure(1)
plot(t,dy)
Any help greatly appreciated
Tom
I'm sure this topic has been covered before, but I'm still struggling with it.
The Story:
I have signal data from an accelerometer mounted to a car - one lap around a track. After filtering this data (high pass 13Hz) to remove ridgid body motion, I used it to drive a shaker rig with a component attached. An accelerometer on the conpoent was used to measure the response acceleration.
In order to convert to displacement (which I gather isn't an ideal process) I FFT the response, divide by the samping frequency squared then inverse FFT...?
My displacements are tiny, not really sure why. This is my m-file:
Fs = 512; % Sampling frequency
T = 1/Fs; % Sample time
L = 53760; % Length of signal(no. of data lines)
t = (0:L-1)*T; % Time vector
a = load('TrackReplay Z-axis.txt');
x = a
y = a
z = a
x = x-mean(x*9.81);
x = detrend(x, 'linear');
y = y-mean(y*9.81);
y = detrend(y, 'linear');
z = z-mean(z*9.81);
z = detrend(z, 'linear');
X = fft(x,L)/L; % FFT of x
Y = fft(y,L)/L;
Z = fft(z,L)/L;
Xd = X/(2*pi*Fs)^2;
Yd = Y/(2*pi*Fs)^2;
Zd = Z/(2*pi*Fs)^2;
dx = ifft(Xd);
dy = ifft(Yd);
dz = ifft(Zd);
figure(1)
plot(t,dy)
Any help greatly appreciated
Tom