MATLAB Answers

I have a time domain signal.I want to calculate energy of my signal......

조회 수: 570(최근 30일)
vahid torabi
vahid torabi 18 Oct 2014
편집: panchami Rhk 3 Apr 2017
Suppose my signal is X(t) then I want to get Fourier Transform >>> X(f) and then I want to calculate energy of my signal...
Can anyone help me? Thank you so much

  댓글 수: 1

panchami Rhk
panchami Rhk 3 Apr 2017
How to get time domain signal from .wav file

로그인 to comment.

채택된 답변

SK
SK 18 Oct 2014
편집: SK 18 Oct 2014
Use the fft() function to calculate fourier transform. Then take the of squares of the coefficients:
F = fft(X);
pow = F.*conj(F);
This gives the power at each frequency. You can sum it (using the sum() fumction) to get the total power.

  댓글 수: 3

vahid torabi
vahid torabi 19 Oct 2014
Thank you so much sir for your answer.Actually I have my time domain signal in workspace in matlab(.mat data... time & value) in this case>>
what would be the code to calculate energy of signal??
SK
SK 19 Oct 2014
Are the time points uniformly spaced? If so, you can use fft() just as above:
F = fft(values);
pow = F.*conj(F);
total_pow = sum(pow);
Note: fft() is taken along the columns so ensure that values is a column vector. For a matrix with multiple columns, fft() returns a matrix whose each column has the discrete fourier transform for the corresponding input column. Check the documentation for fft().
For non uniformly spaced points, you could interpolate first to get uniformly spaced points and then use the procedure above.
vahid torabi
vahid torabi 20 Oct 2014
I've attached my signal for you sir.Please place that in workspace in your matlab program. I want to calculate its energy in frequency domain. How much is its energy if you want to calculate that??? Let me know your result sir. Thank you very much sir.

로그인 to comment.

추가 답변(2개)

SK
SK 20 Oct 2014
Your time values are more or less uniformly spaced with some slight variation but that shouldn't matter. Just type in the exact same code as above. I get as my answer:
total_pow =
4.7414e+03

  댓글 수: 3

vahid torabi
vahid torabi 20 Oct 2014
Your result is same as mine.plz have a look at this pdf. I really appreciate your help.
SK
SK 20 Oct 2014
You have to normalize by the frequency step:
Frequency step is approximately 1/20000 in your pdf example (freq goes from 0 to 1 over 20000 steps). Multiply the answer by 1/20000 and the result is the same.
vahid torabi
vahid torabi 22 Oct 2014
You're right sir.plz have a look at my file again. I can't write formula in here,So I have to attach pdf file. Thank you very much sir.

로그인 to comment.


SK
SK 22 Oct 2014
편집: SK 22 Oct 2014
I'm not sure what your question is, but if you want to understand how it works, you will have to study the "Discrete Time Fourier Trasform" (DTFT) and "Discrete Fourier Transform" (DFT). This is the discrete time, discrete frequency version of the continuous Fourier transform. "Fast Fourier Transfrom" (FFT) is a fast algorithm to compute the DFT. You can easily find many tutorials online on these topics.
Mathematically there is an elegant theory for Fourier transforms and if you are an engineer it will be worth it to invest the time to know the theory. The equivalence of the variance and the sum of squares of the fourier coefficients comes from there and is known as Parseval's theorem. Another way to say it is that the fourier transform maps the space of square summable sequences (square integrable functions in the continuous case) onto the same space and preserves distance in that space (this is called isometry).
The naive implementation of dft is simple. fft is more involved so this is not the place to describe it, but you can find the implementation in some textbooks. A good textbook is "Linear Algebra and its applications" by Gilbert Strang.

  댓글 수: 2

vahid torabi
vahid torabi 23 Oct 2014
Thanks a lot for your complete explanation sir.Your tips really helped me. I wish you all the best.

로그인 to comment.

이 질문에 답변하려면 로그인을(를) 수행하십시오.


Translated by