Integration of fft signal

조회 수: 10 (최근 30일)
Moza Mohamed
Moza Mohamed 2022년 2월 15일
편집: Paul 2025년 4월 3일
I have the following code
m=importdata("Raw data (1).csv")
t=m(:,1)
v=m(:,2)
L = length(t);
Ts = t(2)-t(1); % Sampling Interval (sec)
Fs = 1/Ts; % Sampling Frequency
Fn = Fs/2;
Good = v- mean(v); % Remove D-C (Constant) Offset
Y = fft(v)/L;
Fv = linspace(0, 1, fix(L/2)+1)*Fn; % Frequency Vector
Iv = 1:length(Fv); % Index Vector For Plot
figure(1)
plot(Fv, 2*abs(Y(Iv)))
grid
xlabel('Frequency')
ylabel('Magnitude')
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
I would like to integrate the signal. How is this possible ?

답변 (2개)

Soumya
Soumya 2025년 4월 3일
Hi Moza,
There are many ways in MATLAB to integrate discrete data, like the FFT signal in your case. One common approach is to use the trapezoidal rule, which can be implemented in MATLAB using the cumtrapz function. The cumtrapz function computes the cumulative integral of a vector using the trapezoidal rule, returning a vector of integrated values at each point:
Q = cumtrapz(X,Y);
You can also use the ‘trapz’ function to compute the total integral, which provides a single scalar value that represents the integral over the entire data range:
Q = trapz(X,Y)
Please refer to the following documentation to get more information on:
I hope this helps!

Walter Roberson
Walter Roberson 2025년 4월 3일
fft() is inherently a discrete process. Integration is inherently a continuous process.
"numerc integration" assumes that the underlying data is a discrete representation of a continous function. However, with fft() being inherently discrete, it is not true that fft() is a discrete representation to a continuous function.
So... logically you cannot integrate the result of fft().
  댓글 수: 3
Walter Roberson
Walter Roberson 2025년 4월 3일
Discrete Time Fourier Transform is not a continuous function of frequency: it is inherently discrete frequency.
Paul
Paul 2025년 4월 3일
편집: Paul 2025년 4월 3일
No, that's not correct.
The Discrete Fourier Transform is a function of discrete frequency (though the definition on the Wikipedia page uses the integers k as the independent variable). To be more precise, the independent variable is defined only at discrete points on a finite domain; some treatments would define the independent variable at discrete points on an infinite domain (e.g. the integers).
The Discrete Time Fourier Transform is a function of continuous frequency (omega) that covers the entire real line. If there is a source that defines the DTFT with an independent variable that is discrete, I'd really like to see it.

댓글을 달려면 로그인하십시오.

Community Treasure Hunt

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

Start Hunting!

Translated by