1

I am using Matlab to do a ground response analysis. I need to do an FFT of a ground motion acceleration, multiply some constant, then get its inverse FFT. However, it's not returning the original signal during the validation.

Can anyone pls help me? Thank you.

Y = fft(acc,N);
h=2*abs(Y(1:N/2+1));
F=1/dt;
f=F/2*linspace(0,1,N/2+1);
f=f';

acc_ifft=ifft(h,N);
time_ifft=[0:N-1]*dt;
plot(time_ifft,acc_ifft);

If I try to plot using Y, it gives the correct signal. But I have to multiply the values in h by a constant, so I need to work from h.

3
  • 1
    You remove half the data, then take the magnitude, before applying the inverse transform. Of course that is not going to work! ifft(Y) is the only way of getting acc back. Oct 29, 2021 at 13:43
  • Is there a way for me to be able to multiply a value (which is a function of frequency) to the FFT before investing it again?
    – bunny
    Oct 29, 2021 at 14:36
  • Yes, you can multiply the complex numbers, no need to take the absolute value. ifft(H.*fft(f)). Oct 29, 2021 at 16:11

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.