Converting frequency data to time data

10 次查看(过去 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.

回答(1 个)

TED MOSBY
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:

类别

Help CenterFile Exchange 中查找有关 Spectral Measurements 的更多信息

标签

产品


版本

R2019a

Community Treasure Hunt

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

Start Hunting!

Translated by