How to find frequency of given signal?
2 views (last 30 days)
Show older comments
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?
Answers (2)
Walter Roberson
on 10 Jan 2023
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
time_for_one_cycle = lcm(lcm(lcm(lcm(4998, 5001), 4999), 5001), fs*100)
frequency = 1/time_for_one_cycle
[49.98/fs, 50.01/fs, 49.99/fs, 50.01/fs] * time_for_one_cycle
That last line shows that at that time, the different frequencies have indeed completed an integer number of cycles.
4 Comments
Walter Roberson
on 10 Jan 2023
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
on 10 Jan 2023
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))
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)
Verify that xp(t) has period Txp
simplify(xp(t) - xp(t + Txp))
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])
simplify(xp(t) - xp(t + time_for_one_cycle))
Image Analyst
on 10 Jan 2023
1 Comment
Walter Roberson
on 10 Jan 2023
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.
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!