convert the time domain signal into frequency domain signal

2 次查看(过去 30 天)
hi guys, this is the second part of this topic ,
I have divided into two part in order to make the topic readable and useful and I'd like to thank Mr Star Strider for his useful answer and support
Ok, let carry on
I have the acceleration data of 3 axes(x, y, and z) and it's represented in time domain signal.
There are about 10500 records (data points or samples)in the file for each axis and I have divided these records into segments ( each segment contains 256 data points.
now, I'd like to convert each segment in the time domain into frequency domain .
As we know this can be done using FFT function
One of the limitations of using the FFT function is that the number of data points in the segment must be a power of two. and I have already fixed the size of each segment into 256( 2 to the power 8)
i have used this code,
% FD_Signal_X{nn,1}=fft(X_Segments_256{nn});
Note, NN is the number of segments, X_Segments_256 contains the data of X axes of each segment, which is 256
my question is
1- I have used this code to calculate the Energy of the frequency domain signal,
FD_Signal_X{nn,1}=fft(X_Segments_256{nn});
Energy_X{nn,1} = (FD_Signal_X{nn}).^2;
or this one is correct?
FD_Signal_X{nn,1}=fft(X_Segments_256{nn});
Magnitude_X {nn,1} = abs(FD_Signal_X{nn});
Energy_X{nn,1} = (Magnitude_X{nn}).^2;
With my respect

采纳的回答

Star Strider
Star Strider 2016-9-6
The second is correct.
The first squares a complex signal, so both the real an imaginary parts of the signal are squared, producing a complex result. I do not believe that is what you want. I would not use it.
The second squares the absolute value of the complex signal, producing a real result. That calculates the power in your signal, essentially the power spectral density of your signal.
The energy of your signal at each frequency is the absolute value of the Fourier transform of your signal. The power at each frequency is the square of the energy.
  32 个评论
neamah al-naffakh
Dear Star Strider, how are you? sorry for bothering again, could you please help me with this topic, it is signal processing!

请先登录,再进行评论。

更多回答(0 个)

类别

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

Community Treasure Hunt

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

Start Hunting!

Translated by