|
-
Jan 28th, 2011, 04:46 AM
#6
Re: Hilbert Transform in C
The first code uses the formula I quoted in post #4. The second might be using the convolution definition labeled (2) in your link. I'm not qualified to say if they're good implementations or how well they work in edge cases.
Fundamentally, the formula I quoted isn't very hard to apply. You get FFT and IFFT routines, apply the FFT to your signal, multiply the coefficients generated by sgn(k)*i, and apply the IFFT. FFT and IFFT routines should be plentiful, and your first code includes what I hope is a good implementation of each.
It's unclear to me what precisely you meant by "FFT => Phase Shift => IFFT method". If you mean you're phase shifting the Fourier coefficients, then I agree (you're just multiplying by a unit complex number, which is by definition a phase shift). At first I took you to mean phase shifting the time-domain signal, or phase shifting the entire frequency domain signal uniformly, either of which just didn't make sense.
Also, Numerical Recipes is a popular book which gives implementations of numerous numerical problems. Chapter 12 seems to be devoted to the FFT.
Last edited by jemidiah; Jan 28th, 2011 at 04:49 AM.
The time you enjoy wasting is not wasted time.
Bertrand Russell
<- Remember to rate posts you find helpful.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|