frequency domain to time domain

10 ビュー (過去 30 日間)
nur syafiqah
nur syafiqah 2021 年 12 月 17 日
コメント済み: Walter Roberson 2021 年 12 月 20 日
i have frequency domain data in excel in term of frequency and amplitude. I need to convert frequency domain to time domain in MATLAB.

採用された回答

Walter Roberson
Walter Roberson 2021 年 12 月 17 日
If you know the sampling frequency and the duration, then you can discretize each frequency to get a bin number for fft purposes.
Sampling frequency times duration gives you the number of original samples.
Now create an spectra that is the same length as the number of original samples.
Take the bin number information relevant to each frequency, and at that offset, store the entire magnitude.
Now,
spectra(end:-1:floor(end/2)+1) = spectra(2:floor(end/2));
which extends the frequency list symmetrically into the negative frequencies.
Now you can ifft(spectra)
The result will be a composition of pure sine (or cosine) waves as if the phase were 0 for all frequencies.
If you want a more accurate approximation, then when you discretize the frequencies to get bin numbers, allocate the magnitude proportionately between floor(bin_number) and ceil(bin_number)
  2 件のコメント
nur syafiqah
nur syafiqah 2021 年 12 月 18 日
i have fs and duration. How to discretize each frequency to get a bin number?
Walter Roberson
Walter Roberson 2021 年 12 月 20 日
Let L (signal length) = Fs * duration . Then the one-side spectrum has frequency bins that are at frequencies Fs * (0:L/2)/L so the difference between them is Fs/L which is Fs/(Fs*duration) = 1/duration Hz
So take floor(frequency/duration)+1 to get the bin number to write the absolute magnitude in to.
[You will stop have to copy the flipped one-side spectra to become the two-sided spectra before doing the ifft)

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

その他の回答 (1 件)

Voss
Voss 2021 年 12 月 17 日
  2 件のコメント
nur syafiqah
nur syafiqah 2021 年 12 月 17 日
cannot ifft if no magnitude. amplitude is real number
Voss
Voss 2021 年 12 月 17 日
I guess it's going to be tough without the phase information.

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

カテゴリ

Help Center および File ExchangeSpectral Measurements についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by