How do I find the phase for a periodic cos wave using fft?
Show older comments
I have a simple cos wave that has a period, in this case 6. I am offsetting the wave by an angular amount with phase. How can I use the fft function to recover back my initial phase offset? I tried converting the fourier transformed value with the highest amplitude using abs (which does correclty identify the period) back to a phase using angle, but this never seems to work. If someone could enlighten me as to how to do this, I would be so grateful! (Edit: I would like to see how to correctly recover the original period as well)
n = 1e3;
a = linspace(0, 2*pi, n);
period = 6;
phase = rand * 2*pi;
f = rescale(cos((a-phase)*pr));
3 Comments
Mathieu NOE
on 28 Jun 2024
this looks quite similar to this :
Noam
on 28 Jun 2024
Mathieu NOE
on 28 Jun 2024
sure
NB that in the other post, the author also wanted to use fft, but did not really succeed
Accepted Answer
More Answers (0)
Categories
Find more on Fourier Analysis and Filtering 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!