
Converting frequency data to time data
20 ビュー (過去 30 日間)
古いコメントを表示
Hi Experts,
I have a Force vs Frequency data of 51 points. frequency starting from 39 and ending with 2000Hz
How do I convert it into Force vs Time using matlab and my time domain result should start with 0.
Can anyone please help with this.
0 件のコメント
回答 (1 件)
TED MOSBY
2024 年 10 月 19 日
Hi Lokesh,
To convert your Force vs Frequency data into Force vs Time in MATLAB, you can use the inverse Fourier transform as below:
Define the Time Domain: Decide on the time duration you want for your signal. The time vector will depend on your sampling rate. For example, if you want a total time of T seconds and you're sampling at a frequency of Fs Hz, you can create a time vector like this:
Fs = 10000; % Example sampling frequency (10 kHz)
T = 1; % Total time in seconds
t = 0:1/Fs:T; % Time vector from 0 to T with sampling interval
Interpolate Your Frequency Data:
f_interp = linspace(min(f), max(f), length(t)); % Interpolated frequency vector
F_interp = interp1(f, F, f_interp, 'linear', 'extrap'); % Interpolated force data
Compute the Inverse Fourier Transform: Use the ifft function to convert the frequency domain data back into the time domain:
F_time = ifft(F_interp); % Inverse Fourier Transform
Plot the Results:
figure;
plot(t, real(F_time)); % Plot real part of the signal
xlabel('Time (s)');
ylabel('Force');
title('Force vs Time');
grid on;
You should see something like this:

Hope this helps!
Here is the documentation for the “ifft” function of MATLAB:
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Spectral Measurements についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!