convert cartesian plot into frequency domain

3 次查看(过去 30 天)
How can I convert Cartesian plot into frequency domain?? Please, help!

回答(1 个)

AR
AR 2025-4-23
We can use the Fast Fourier Transform, “fft” function to convert a cartesian plot into the frequency domain. It takes as input a vector or matrix containing the time-domain data and provides an output of the same size in the frequency domain.
Here is an example code to convert time domain data to frequency domain.
t = 0:0.001:1; % Time vector
x = sin(2*pi*50*t); % Example signal
N = length(x);
Fs = 1/(t(2)-t(1)); % Sampling frequency
X = fft(x);
f = (0:N-1)*(Fs/N);
magnitude = abs(X)/N;
half_N = floor(N/2)+1;
figure;
plot(f(1:half_N), magnitude(1:half_N));
xlabel('Frequency (Hz)');
ylabel('Magnitude');
title('Frequency Domain Representation');
To convert a Cartesian plot to the frequency domain, apply thefft to the y-data (the signal values), not to the plot itself. The x-axis of the original plot is typically time or space, and the y-axis is the signal amplitude.
For more information on “fft”, refer to the below documentation link:

类别

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

标签

产品

Community Treasure Hunt

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

Start Hunting!

Translated by