Calculating frequency of a signal of mixed frequencies - No FFT.
2 views (last 30 days)
Show older comments
I have a test signal of the frequencies y=y1+y2+y3; with frequencies 50 Hz, 93 Hz and a variable frequency 5~18 Hz.
t=0:1/8000:2;
fend=18;
f0=5;
f=f0+t*(fend-f0)/2;
y1=10*sin(2*pi*50*t+30); % fundamental frequency
y2=1*sin(2*pi*f.*t+30); % variable frequency 5~18 Hz
y3=1*sin(2*pi*93*t+30); % higher frequency 93 Hz
y=y1+y2+y3; % signal
I wanted to calculate the frequency of the signal by computing the time period of each cycle using zero-crossings of the signal.
The difference between two zero-crossings would be half of the time period. (T/2) which can then be used to find the frequency as function of time. f(t). It's useless to say I am new to matlab and dont really familiar with MATLAB basic programing skills. Any help would be appreciated.
0 Comments
Accepted Answer
Star Strider
on 2 Feb 2018
Your 8 kHz sampling frequency should provide acceptable frequency resolution. (I am not certain that you will get any useful information from this with your signal.)
Experiment with that code to get the result you want.
0 Comments
More Answers (0)
See Also
Categories
Find more on Measurements and Feature Extraction in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!