Frequency domain to Time domain

6 ビュー (過去 30 日間)
John Gunipe
John Gunipe 2022 年 5 月 4 日
コメント済み: John Gunipe 2022 年 5 月 5 日
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
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.
John Gunipe
John Gunipe 2022 年 5 月 5 日
Error using horzcat
Dimensions of arrays being concatenated are not consistent.
Error in Autopowerat0percentpedal (line 7)
[frequency(1:5) frequency(end)]
where as for numel(frequency)
ans =
2049
Brother Paul, as per discussion in the other comment. Without phase data the inversion of Fourier transorm is not possible. Please refer that discussion for the correct approach. :)

サインインしてコメントする。

採用された回答

Star Strider
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 件のコメント
John Gunipe
John Gunipe 2022 年 5 月 5 日
Yes, I agree. I was just reading upon the documentation provided by the software (I got the data from) in this regards and it was mentioned that the phase information has been removed and only the amplitude values are plotted with respect to frequency.
And that if phase information is needed, I have to take the spectral data which has phase data included. Thank you for the help.
The 'rms' that I mentioned in the code was the rms acceleration values of my data.
Star Strider
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 ExchangeFourier Analysis and Filtering についてさらに検索

製品


リリース

R2020a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by