| Author |
Message |
savage67
Joined: 25 Sep 2006 Posts: 18
|
01 Dec 2007 19:33 pxx = x.*conj(x)/512; |
|
|
|
|
i m writing a program in matlab to make the fft analysis of the signal which the user determine
but i dont know how to measure the period of tha signal..
how to calculate the frequency or period of a signal which has two component with different frequencies
like A.sin(w1.t)+B.cos(w2.t)
plz help meee
|
|
| Back to top |
|
 |
DMan
Joined: 20 Oct 2005 Posts: 41 Helped: 6 Location: Slovenia
|
01 Dec 2007 21:13 how to calculate the frequency of a signal ... |
|
|
|
|
It strongly depends upon coeficients A,B,w1, w2.
But in most cases signal would not be periodical but pseudoperiodical if not even nonperidical.
f(t)=A.sin(w1.t)+B.cos(w2.t)
The definition for peridical signals says:
f(t)=f(t+T), where t is time and T period.
so you should solve the equation:
A.sin(w1.t)+B.cos(w2.t) =A.sin(w1(t+T))+B.cos(w2(t+T))
and get T if f(t) would be periodical but I don't thik it is since it has boath frequencies w1 and w2
|
|
| Back to top |
|
 |
ebook123456789
Joined: 09 Mar 2007 Posts: 50 Helped: 1
|
05 Dec 2007 8:39 how to calculate the frequency of a signal ... |
|
|
|
|
| as long as w1 and w2 are far enough, you should see 2 peaks after fft analysis.
|
|
| Back to top |
|
 |
Google AdSense

|
05 Dec 2007 8:39 Ads |
|
|
|
|
|
|
| Back to top |
|
 |
mudrik
Joined: 05 Mar 2005 Posts: 123 Helped: 13
|
05 Dec 2007 13:07 Re: how to calculate the frequency of a signal ... |
|
|
|
|
In help of Matlab you can find an example:
t = 0:0.001:0.6;
x = sin(2*pi*50*t)+sin(2*pi*120*t);
y = x + 2*randn(size(t));
plot(1000*t(1:50),y(1:50))
title('Signal Corrupted with Zero-Mean Random Noise')
xlabel('time (milliseconds)')
X = fft(x,512);
Y = fft(y,512);
Pxx = X.* conj(X) / 512;
Pyy = Y.* conj(Y) / 512;
f = 1000*(0:256)/512;
plot(f,Pyy(1:257))
title('Frequency content of y')
xlabel('frequency (Hz)')
x : periodical signal
y ; with additional noise
Visualisation of Pyy or Pxx reveals the frequency content of the signals y and x
|
|
| Back to top |
|
 |