How do I find the phase for a periodic cos wave using fft?
Ältere Kommentare anzeigen
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 Kommentare
Mathieu NOE
am 28 Jun. 2024
this looks quite similar to this :
Noam
am 28 Jun. 2024
Mathieu NOE
am 28 Jun. 2024
sure
NB that in the other post, the author also wanted to use fft, but did not really succeed
Akzeptierte Antwort
Weitere Antworten (0)
Kategorien
Mehr zu Waveform Generation finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!