Frequency domain to Time domain
6 ビュー (過去 30 日間)
古いコメントを表示
Hi,
I have experimental data of a signal in terms of frequency and acceleration. I want to convert this signal as a function of time using an inverse Fourier transform (ifft). What script could I use to the ifft? Is my approach correct? or should I have to use any thing about sampling frequency in my code? (if so, please help). The frequencies evenly spaced from 0 to 1024 at an interval of 0.5 Hz?
acceleration = xlsread('data','Sheet1','B3:B2051');
frequency = xlsread('data','Sheet1','A3:A2051');
time = ifft(frequency);
abs_time = abs(time);
subplot(2,1,1), plot(frequency,acceleration)
subplot(2,1,2), plot(abs_time,rms)
Thanks. It would be a huge help, I have no knowledge of signal processing concepts.
2 件のコメント
Paul
2022 年 5 月 5 日
Hi John,
After running the code in the qeustion, can you post the results from the following commands:
[frequency(1:5) frequency(end)]
numel(frequency)
I'm asking because the question doesn't seem to line up with plots in the Answer below.
採用された回答
Star Strider
2022 年 5 月 4 日
The acceleration data must be complex, or the data must consist of an acceleration magnitude and an acceleration phase. The highest frequency should be the Nyquist frequency, or at least the sampling frequency of the original signal must be known.
Assuming that the acceleration magnitude and phase signals both exist, the frequency spacing is regular, and the highest frequency is the Nyquist frequency, the inversion would go something like this —
First, create a complex variable from the magnitude and phase vectors if it is not already complex:
accelz = mag .* exp(1j*phase) % The 'phase' Value Is The Unwrapped Phase In Radians
and the full acceleration signal becomes:
accelz_full = [accelz flip(conj(accelz))]
The time vector is derived from the one-sided frequency vector ‘fv’ as:
tv = linspace(0, numel(accelz_full)-1, numel(accelz_full))/(2*max(fv))
Then take the ifft of ‘accelz_full’ to get the time domain signal:
accelt = ifft(accelz_full, 'symmetric')
The result of the ifft calculation should be real.
.
6 件のコメント
Star Strider
2022 年 5 月 5 日
As always, my pleasure!
If you have the ‘rms’ data with the phase information, then the inversion is possible.
その他の回答 (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!
