Converting frequency data to time data

조회 수: 22 (최근 30일)
Lokesh Katari
Lokesh Katari 2021년 9월 24일
답변: TED MOSBY 2024년 10월 19일
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