2

I am relatively new to DSP and have been reading a lot on the internet. I have a couple of questions.

I have a signal in the form of a function $$ f(x) = A_0 + A_1 \cos(\omega_1 x) + A_2 \cos(\omega_2 x)+...+ A_n \cos(\omega_n x). $$ I have $f(x)$ and I know the minimum and maximum frequencies. $f(x)$ can have really high frequencies.

a) I need to find the amplitude $A_p$ of a particular frequency $\omega_p$ in $f(x)$. One way to do this is, I could get sample points from $f(x)$ sampling at greater than Nyquist rate and do an FFT and find the amplitude. But if $f(x)$ has really high frequencies, the sampling would take most of the time. If i am interested only in estimating the amplitude $A_p$, is there another way, a faster way, of doing this. In the best case, I would like to estimate $A_p$ to within 0.5 of its actual value.

b)If I want $A_0$, the DC component, I can compute the average of $f(x)$ but with high frequencies in $f(x)$ that would mean high sampling rates. Any other faster way of doing this?

c)The FFT takes $O(n\log(n))$ if $n$ is the size of the input and returns the magnitudes for $n$ different frequencies. If we are only interested in one particular frequency we should be able to alter the source code so that it would take only $O(\log(n))$, right?

Thanks for answering!

Peter K.
  • 25,714
  • 9
  • 46
  • 91
user7502
  • 55
  • 5

2 Answers2

6

The usual way to estimate the amplitude of a particular frequency is to use the Goertzel algorithm. There is a good write-up by Rick Lyons here.

Even though Rick's writeup is about single tone detection, it can be applied when multiple tones are present, too.

Peter K.
  • 25,714
  • 9
  • 46
  • 91
  • 1
    Unless they are close relative to the observation time. Then the estimation isn't good. – Royi Jun 19 '18 at 11:57
3

Maybe you have a look at Goertzels Algorithm.

user7358
  • 1,100
  • 6
  • 10