How to find frequency of given signal?

3 次查看(过去 30 天)
Shanmuka
Shanmuka 2023-1-10
评论: Paul 2023-1-10
fs=2400;
fo=50;
t=0:100;
xp=sin(2*pi*(49.98/fs)*t)+sin(2*pi*(50.01/fs)*t)+sin(2*pi*(49.99/fs)*t)+sin(2*pi*(50.01/fs)*t);
How to find frequency and rate of change of frequency?

回答(2 个)

Walter Roberson
Walter Roberson 2023-1-10
The frequency is the reciprocal of the time needed for all of the components to first complete an integer number of cycles simultaneously:
format long g
fs = 2400
fs =
2400
time_for_one_cycle = lcm(lcm(lcm(lcm(4998, 5001), 4999), 5001), fs*100)
time_for_one_cycle =
1.66599993336e+15
frequency = 1/time_for_one_cycle
frequency =
6.0024012004802e-16
[49.98/fs, 50.01/fs, 49.99/fs, 50.01/fs] * time_for_one_cycle
ans = 1×4
1.0e+00 * 34694448612222 34715273611389 34701390278611 34715273611389
That last line shows that at that time, the different frequencies have indeed completed an integer number of cycles.
  4 个评论
Walter Roberson
Walter Roberson 2023-1-10
Also note that the units for the xcorr is "lag" (number of signal points) and the units for the other two lines is "seconds".
Paul
Paul 2023-1-10
I got a different answer (Reference)
fs = sym(2400);
syms t real
%fo=50;
%t=0:100;
T = fs./[49.98 50.01 49.99 50.01];
xp(t) = sum(sin(2*pi./T*t));
Ratios of T1/Tj
ratios = simplifyFraction(T(1)./T(2:end))
ratios = 
They are rational, so xp(t) is periodic
Get the LCM of the denominators
[~,den] = numden(ratios);
K = lcm(den);
The fundamental period of xp(t) is (i.e., smallest value of T that satisfies x(t) = x(t + T) )
Txp = K*T(1)
Txp = 
240000
Verify that xp(t) has period Txp
simplify(xp(t) - xp(t + Txp))
ans = 
0
Your solution is a period in that it satisfies the defintion of a periodic signal, but its not the fundamental period
time_for_one_cycle = lcm([4998, 5001, 4999, 5001,fs*100])
time_for_one_cycle = 
1665999933360000
simplify(xp(t) - xp(t + time_for_one_cycle))
ans = 
0

请先登录,再进行评论。


Image Analyst
Image Analyst 2023-1-10
What do you mean by frequency? That signal has several frequencies in it, not just one. From Fourier theory, any signal can be thought of as a sum of all frequencies. In general you can find out the relative power in all frequencies in a signal by using fft or pwelch
  1 个评论
Walter Roberson
Walter Roberson 2023-1-10
When frequency is considered to be the number of complete cycles per second, then you need to figure out the length of a complete cycle. Which I do in my Answer... it's pretty long. And the answer is different than the average number of pairs of zero crossings per second.

请先登录,再进行评论。

Community Treasure Hunt

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

Start Hunting!

Translated by