estimating oscillation frequency of a signal
Show older comments
I would like to find periodicity and the oscillation frequency in a signal. I used this simple MATLAB code which works find for some signals, but for a harmonic polluted signal like the one given below it generates wrong results. Is there any way to estimate the frequency of oscillation for a signal like the one given here. I appreciate any MATLAB code snippets.
[pks,pktimes] = findpeaks(x, (1:N)*DT);
Period = mean(diff(pktimes))

Accepted Answer
More Answers (1)
Sam Chak
on 27 Dec 2023
1 vote
The fft() command, or Fast Fourier Transform, can be used to estimate the oscillation frequency of a signal. When you apply the FFT to a time-domain sinusoidal signal, it transforms the signal from the time domain to the frequency domain, providing information about the various frequency components present in the signal. The resulting spectrum shows the magnitude and phase of each frequency component.

You can find various examples and code snippets in this documentation:
Categories
Find more on Spectral Measurements in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!

