I'm trying to calculate the frequency of the following signal that has an offset:
So I first try to center it around 0 :
m = max(signal); mi = min(signal); n = signal - (mi + (m-mi)/2);
However as the signal fades over time, it eventually falls below 0 towards the end, resulting in a large maxima at 0 on the Fourier transform.
Although the second largest maxima does give me the correct frequency, Is there a better way to center the signal so that it doesn't fall below zero?