Skip to content

Calculate amplitude and phase of a given harmonic #241

@escherstair

Description

@escherstair

I can use Real FFT Functions to calculate the amplitude and phase of all the harmonics in the signal represented by the input buffer.
And this is ok.
But sometimes I need to calculate only one specific harmonic (known in advance) and so using the FFT Functions (of 4096 samples, as an example) to keep only one FFT line (amplitude + phase) is far for optmized.

Can I use some internal FFT function (calling it directly) to get this result (using the same twiddle tables already available for FFT)?
Or should I implement the calculation from scratch, with the formula below?
X = sum(x.*exp(-i*2*pi*k*[0:N-1]/N));
and then

amplitude = mag(X)
phase = arg(X)

Thanks

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions