I have fft data. How can I predict from the fft data whether the data is of sine or cosine wave?

I have an fft. It is of sine or cosine, I dont know. I want to calculate amplitude, phase, frequency and which signal it is(sine or cosine). The first 3 I was able to do it. I am not able to find whether the signal is sine or cosine.

Antworten (1)

Rick Rosson
Rick Rosson am 13 Nov. 2015
Bearbeitet: Rick Rosson am 13 Nov. 2015
You can tell from the phase. If the phase is 0 degrees, then it's a cosine. If the phase is -90 degrees, then it's a sine. If +/-180 degrees, it's -cosine. And if +90 degrees, it's -sine. If the phase is anything else, it's a mixture of both sine and cosine.
In any event, regardless of the phase, you can always represent it as
a*cos(2*pi*f*t + phi)
where a is the amplitude, f is the frequency (in hertz), t is time (in seconds), and phi is the phase angle (in radians).

3 Kommentare

But sir, I dont want to recreate the signal. a*cos(2*pi*f*t + phi)+a2*sin(2*pi*f2*t + phi2) In fft plot i will get two peaks. One is of cos and one is of sine. But if I only get fft data and asked to differentiate or to tell which one is sine or cosine? that is my question
What happens if you have a sine and a cosine where both are at the same frequency?
a*cos(2*pi*f*t) - b*sin(2*pi*f*t)
Then you will see a single peak in the magnitude response at frequency f even though the signal has two components: a sine and a cosine.
Not to worry, it is possible to show that this signal is mathematically equivalent to:
c*cos(2*pi*f*t + phi)
You can find the value of c from the magnitude response, and the value of phi from the phase response. Then, if you are interested, you can compute the values of a and b as:
a = c*cos(phi)
b = c*sin(phi)
As you can see, these parameters represent a right triangle (in the complex plane), where a and b are the legs of the triangle, c is the hypotenuse, and phi is the angle opposite to b.
Hi.
I know it is a very old issue but:
Is there any reason for the cosine to be 0 degrees and the sine -90 degrees and not the other way around, sine 0 degrees and cosine 90 degrees?
Also, altough it is maybe too big a question, is this always the case?, i mean, everytime someone performs a fft, the way to plot it is always c*cos(2*pi*f*t + phi) instead of c*sin(2*pi*f*t + phi)?
Thanks in advance

Melden Sie sich an, um zu kommentieren.

Gefragt:

am 13 Nov. 2015

Kommentiert:

am 18 Apr. 2022

Community Treasure Hunt

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

Start Hunting!

Translated by